How to retrieve a reference point location?

Developer
Oct 1, 2015 at 7:36 PM
Reference point location is not provided by Eclipse API directly. It is saved to the database as a binary [24] data type. How can I convert the binary data to the location coordinate (x,y,z)?
Coordinator
Oct 5, 2015 at 4:00 PM
Reference point location is provided by the API. It can be accessed through FieldReferencePoint:
      PlanSetup plan = context.PlanSetup;
      ReferencePoint refpoint = ps.PrimaryReferencePoint;
      FieldReferencePoint fieldRefPoint = plan.Beams.First().FieldReferencePoints.First(frp => frp.ReferencePoint == refpoint);
      VVector location = fieldRefPoint.RefPointLocation;
Developer
Oct 6, 2015 at 6:33 PM
Edited Oct 6, 2015 at 6:44 PM
Hi stuomaal,

Thank you very much for your response and guidance. There are two reference points in my plan. The code you provided to me can retrieve one location of reference points, which is a primary reference point in the plan. (In my case, it got location coordinate (NaN, NaN, NaN)). Is there any way that I can get another reference point location?

The screenshot that shows reference points in my plan will be attached by email (hope you can get it).

Thanks,

Angell
Developer
Oct 6, 2015 at 6:37 PM
Hi stuomaal,
Thank you very much for your response and guidance. There are two reference points in my plan. The code you provided to me can retrieve one location of reference points, which is a primary reference point in the plan. (In my case, it got location coordinate (NaN, NaN, NaN)). Is there any way that I can get another reference point location?
The screenshot that shows reference points in my plan will be attached by mail.
Thanks,
Angell


Coordinator
Oct 6, 2015 at 6:50 PM
You can get any reference point location using the reference point Id:
      String refPointId = "Mandible";
      FieldReferencePoint fieldRefPoint = plan.Beams.First().FieldReferencePoints.First(frp => frp.ReferencePoint.Id == refPointId);
      VVector location = fieldRefPoint.RefPointLocation;
Developer
Oct 7, 2015 at 3:15 PM
Hi stuimaal,

Thanks for your quick response.
I used the code you provided and got location value (-0.80, 202.57, 357.50). The value does not matach the value (-4.62, 12.45, -14.73), which is shown in the reference point Property ->Location Window.
Dose it need to be converted in some way ? or I did something wrong?

Thanks,

Angell
Coordinator
Oct 7, 2015 at 4:52 PM
Hi Angell,

try adding this:
      Image image = plan.StructureSet.Image;
      location = image.DicomToUser(location, plan);
Developer
Oct 7, 2015 at 6:33 PM
It works! Thank you very much!