Image Modalities

Aug 9, 2016 at 10:59 PM
Hello,

I am making a report generator script (Eclipse v11) and would like to list what image modalities are registered with the patient. Unfortunately I can't seem to figure out how to access the images other than the planning CT.

I would like to do something like the below - except that PlanSetup.Images doesn't exist
IEnumerable<Image> images = context.PlanSetup.Images; ;
            foreach (Image i in images)
            {
                MessageBox.Show(i.Series.Modality.ToString());
            }
And suggestions are greatly appreciated!
Coordinator
Aug 10, 2016 at 1:57 PM
I'm not sure about Eclipse v. 11, but in v. 13.6, the Patient has a property called Studies. These contain Series, which have the Modality property.
Aug 10, 2016 at 8:01 PM
Thank you. In might be an issue with v.11 then as I am not seeing the Modality property in the Studies
           IEnumerable<Study> studies = patient.Studies;
            foreach (Study i in studies)
            {
               MessageBox.Show(i.Series.Modality); \\Error:<VMS.TPS.Common.Model.API.Series>' does not contain a definition for 'Modality' and no extension method 'Modality' 

            }
Coordinator
Aug 10, 2016 at 8:06 PM
Try using F12 in Visual Studio to explore the Study, Series, and Image classes. There might be something equivalent to Modality there.
Coordinator
Aug 10, 2016 at 8:28 PM
Modality is there in v11. The trick is that plural of Series is Series :)
      var pat = context.Patient;
      foreach (var study in pat.Studies)
      {
        foreach (var series in study.Series)
        {
          MessageBox.Show(series.Modality.ToString());
        }
      }
Aug 10, 2016 at 8:59 PM
That works thanks!