In all cases of diagnosing any injury or condition you have to
1. listen to the patients presenting symptoms and history and after come up with a checklist of the top 5-6 things they COULD have
2. Through a series of orthopedic/neurological/provocative testing eliminate conditions one at a time
for Piriformis Syndrome the top 5 things it COULD be are
1. Sciatica (probably the most often confused with)
3. Gluteus Medius Syndrome ( also called “Runners Butt”) this is often misdiagnosed as sciatica or Piriformis Syndrome
there are other conditions to eliminate such as the SI joint but so that you understand the logical thought process.
Sciatica is a result of a swollen or protruded/herniated disc that puts pressure on the L5-S1 nerve root resulting in radiating pain and/or numbness down the leg into the foot in a very recognizable pattern.  Piriformis Syndrome has the same set of symptoms but results from compression of the same nerve by the Piriformis Muscle(s).
Gluteus Medius Syndrome does not radiate down the leg into the foot but is mostly localized pain in the Gluteal region sometimes accompanied by hamstring spasm called muscle splinting.
High Hamstring Tear or Tendonosis gets hamstring muscle splinting and causes pain sitting, walking especially uphill and running especially fast.  Ischial Bursitis is very similar but the two can be distinguished by a manual hamstring muscle test typically.
If necessary and MRI is ordered as X-rays are useless in these cases.  The MRI is used to CONFIRM what the orthopedic/neurological/provocative testing PREDICTED.
So basically using logic, deductive diagnostics, common sense and years of experience you can usually narrow down the diagnosis even without MRI but if there is any doubt the MRI can be used to help confirm.
Once the diagnosis is made treatment strategies are offered.  One of the most important things as far as treatment is concerned is to eliminate any offending variables.  If it hurts to sit a stand up desk is prescribed.  If it hurts to run then running must be stopped for awhile etc
Also is it crucial that the patient is educated on the condition and given home strategies/rehab to do on their own. For example in the case of Piriformis Syndrome patients are instructed to perform 2 stretches every WAKING hour and hold each stretch for