Portal Dosimetry Scripting

Aug 5, 2015 at 11:05 AM
Can I retrieve parameter information of images in Portal Dosimetry through API scripting?

Currently to check these parameters, one has to selected right click on each image > properties and check these parameters e.g IDULat, IDUln etc. I was wondering if it is possible to write a script that could read such information on Portal Dosimetry.

I have tried and looked through the objects but cant find such information, I was wondering if they are hidden and inaccessible?
Coordinator
Aug 5, 2015 at 3:32 PM
You can do that using Portal Dosimetry scripting API. You find its script wizard in the tool menu of the Portal Dosimetry application.

The wizard will create a skeleton project with the correct references and using statements (which are different from those of Eclipse scripting API).

Then you'll have access to image properties:
context.DoseImage.Image.IDULat
The script wizard also has a tab where you can copy example scripts to your disk.

The online help for the API can be found on the Portal Dosimetry help menu.
Aug 12, 2015 at 9:49 AM
Thank you
Aug 13, 2015 at 4:00 PM
Hi again,


I am now trying to look at each image in a session (rather than individually selecting the images) to record/display the " IDULat, IDULng and SID" information for each image.
However, I can't access these information through PDSession!

Sometimes I get the error that they are a variable in VMS.CA.Scripting.ImageRT and cant be operated on.

Any suggestions?

Kamran
Aug 14, 2015 at 2:24 PM
stuomaal wrote:
You can do that using Portal Dosimetry scripting API. You find its script wizard in the tool menu of the Portal Dosimetry application.

The wizard will create a skeleton project with the correct references and using statements (which are different from those of Eclipse scripting API).

Then you'll have access to image properties:
context.DoseImage.Image.IDULat
The script wizard also has a tab where you can copy example scripts to your disk.

The online help for the API can be found on the Portal Dosimetry help menu.
Hi again,


I am now trying to look at each image in a session (rather than individually selecting the images) to record/display the " IDULat, IDULng and SID" information for each image.
However, I can't access these information through PDSession!

Sometimes I get the error that they are a variable in VMS.CA.Scripting.ImageRT and cant be operated on.

Any suggestions?

Kamran
Coordinator
Aug 17, 2015 at 8:04 PM
So are you doing something like this:
foreach (var image in session.PortalDoseImages)
{
  MessageBox.Show(image.Image.IDULat.ToString());
}
What does the error message say exactly?
Sep 23, 2015 at 3:37 PM
stuomaal wrote:
So are you doing something like this:
foreach (var image in session.PortalDoseImages)
{
  MessageBox.Show(image.Image.IDULat.ToString());
}
What does the error message say exactly?
Sorry for my belated reply, I was away.

Yes, I tried exactly what you said too.
The error I get is (apparently common but not many do know its meaning):
Error CS0120, An object reference is required for the non-static field, method or property 'VMS.DV.PD.Scripting.PortalDoseImages.get'


I used PDSessions.PortalDoseImages rather than session.PortalDoseImages simply because PortalDoseImages is a member of PDSession and not session.

Looking forward to hearing from you
Sep 24, 2015 at 7:23 AM
Hi,
It looks like you need to create an instance of the class and then invoke the method ? I'm assuming VMS.DV.PS.Scripting is in Aria v13 (I'm currently at v11), so I can't confrim by testing unfortunately.

Good luck.

Dave
Oct 8, 2015 at 10:06 AM
Many Thanks Stuomaal,

I am now getting the information I was looking for but I had another question.

This is the way I have done it (v11):

foreach (var session in PDPlanSetup.Sessions)
{
  foreach(var image in session.PortalDoseImages)
   {
      string SID = image.Image.SID/10.0; // dividing it by 10 to convert it to cm
   }
}
Initially I tried to convert the string SID into an int/double but could get it to work!
Now I was wondering if it is possible to control the precision of the output data. I only need them in 1d.p.
Set.Percision
doesnt function in Portal Dosimetry.

nor does doing something like:
SID ("%d");
Any idea how I could overcome this?

Thanks
Kamran
Marked as answer by kamran68 on 10/13/2015 at 7:02 AM
Oct 13, 2015 at 2:02 PM
My bad, easier solution found:
double SID = Math.Round(image.Image.SID/10.0, 1);
Math.Round(context, number of decimal places);

Kamran
Marked as answer by kamran68 on 10/13/2015 at 7:02 AM