Aligning a markup plane to world coordinate system, with orthogonal planes

I am relatively new to 3D Slicer, and haven’t programmed in Python for a while, so please bear with me. In my Slicer environment, I have placed a scapular model (“Model”), and a markup plane (“P”) with associated points “P1”, “P2”, and “P3.”

I have two aims:

  1. Align the current markup plane “P” with the existing world coordinate system X and Y axes such that when I navigate to different views in Slicer (e.g. superior or inferior), they are consistent with my markup plane
  2. Create an orthogonal transverse plane that passes through P1 and P2 and is representative of the Z axis

Please see the accompanied annotated image to better describe what I am looking to do.

I have read a number of articles on this forum, and I believe that I’ll need to do some transformations and apply them to both the model and the plane(s), but I am unsure on how to move forward with this from a script perspective. Manual registration is unfortunately not accurate enough for what I am doing.

Thank you in advance for any assistance that anyone is able to provide!

1 Like

If i have well understood your requirement, this reply to a more or less similar question may be helpful. If you copy and paste the reference codes in your application startup file, you’ll get a nice GUI as a toolbar to perform such reslicing.

The links return 404, could you provide a new link or the code that was referenced in the repo?

You may use this module instead. The 404 is because the referenced code has been integrated in this extension differently and the original repository has been deleted.

1 Like

Thanks for the code.
I was able to install your source and get it working. However, I realized the difference between aligning markups vs transforming the volume by aligning the markups.

Is there something in your toolkit that also transforms the volume by aligning the markup lines to each of the LAI global axes?

No, applying transforms to a volume was not a goal.

In fact, the code only reformats slice views, nothing is being transformed.

1 Like

Got it. Thank you for your help.