Image Modalities

Aug 9, 2016 at 9:59 PM

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)
And suggestions are greatly appreciated!
Aug 10, 2016 at 12: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 7: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' 

Aug 10, 2016 at 7:06 PM
Try using F12 in Visual Studio to explore the Study, Series, and Image classes. There might be something equivalent to Modality there.
Aug 10, 2016 at 7: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)
Aug 10, 2016 at 7:59 PM
That works thanks!