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

**URL:** https://discourse.slicer.org/t/aligning-a-markup-plane-to-world-coordinate-system-with-orthogonal-planes/42032
**Category:** Development
**Tags:** python
**Created:** [March 8, 2025, 7:44pm UTC](https://discourse.slicer.org/t/aligning-a-markup-plane-to-world-coordinate-system-with-orthogonal-planes/42032 "2025-03-08T19:44:32Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![kat\_b](https://avatars.discourse-cdn.com/v4/letter/k/cab0a1/32.png) [@kat\_b](https://discourse.slicer.org/u/kat_b)
#### Post date: [March 8, 2025, 7:44pm UTC](https://discourse.slicer.org/t/aligning-a-markup-plane-to-world-coordinate-system-with-orthogonal-planes/42032/1 "2025-03-08T19:44:32Z")

</div>

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.

 ![AnnotatedScapula](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/6/763c6e87456053f34298cecd9f9bfe1d611cd873.png)

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!

---

<div class="post-metadata">

### Author: ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)
#### Post date: [March 8, 2025, 8:26pm UTC](https://discourse.slicer.org/t/aligning-a-markup-plane-to-world-coordinate-system-with-orthogonal-planes/42032/2 "2025-03-08T20:26:35Z")

</div>

If i have well understood your requirement, this [reply](https://discourse.slicer.org/t/how-rotate-the-axial-slice-in-script-to-make-it-parallel-with-the-plane-across-3-specified-points/41187/2) to a _more or less_ similar question may be helpful. If you [copy and paste](https://gitlab.com/chir-set/RcHacks7/-/tree/900664b75fca04210a065f1324d7fae0214eb559#2-reslice-functions) the reference codes in your [application startup file](https://slicer.readthedocs.io/en/latest/user_guide/settings.html#application-startup-file), you’ll get a nice GUI as a toolbar to perform such reslicing.

---

<div class="post-metadata">

### Author: ![Antmaker](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/antmaker/32/81424_2.png) [@Antmaker](https://discourse.slicer.org/u/Antmaker)
#### Post date: [February 21, 2026, 12:47am UTC](https://discourse.slicer.org/t/aligning-a-markup-plane-to-world-coordinate-system-with-orthogonal-planes/42032/3 "2026-02-21T00:47:44Z")

</div>

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

---

<div class="post-metadata">

### Author: ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)
#### Post date: [February 21, 2026, 9:02pm UTC](https://discourse.slicer.org/t/aligning-a-markup-plane-to-world-coordinate-system-with-orthogonal-planes/42032/4 "2026-02-21T21:02:54Z")

</div>

You may use this [module](https://gitlab.com/chir-set/Tools7/-/tree/master/ManyThingsToolBar/) instead. The 404 is because the referenced code has been integrated in this [extension](https://gitlab.com/chir-set/Tools7) differently and the original repository has been deleted.

---

<div class="post-metadata">

### Author: ![Antmaker](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/antmaker/32/81424_2.png) [@Antmaker](https://discourse.slicer.org/u/Antmaker)
#### Post date: [February 23, 2026, 8:11pm UTC](https://discourse.slicer.org/t/aligning-a-markup-plane-to-world-coordinate-system-with-orthogonal-planes/42032/5 "2026-02-23T20:11:45Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)
#### Post date: [February 23, 2026, 8:33pm UTC](https://discourse.slicer.org/t/aligning-a-markup-plane-to-world-coordinate-system-with-orthogonal-planes/42032/6 "2026-02-23T20:33:42Z")

</div>

> [@Antmaker](#):
>
> transforms the volume

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

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

---

<div class="post-metadata">

### Author: ![Antmaker](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/antmaker/32/81424_2.png) [@Antmaker](https://discourse.slicer.org/u/Antmaker)
#### Post date: [February 23, 2026, 8:50pm UTC](https://discourse.slicer.org/t/aligning-a-markup-plane-to-world-coordinate-system-with-orthogonal-planes/42032/7 "2026-02-23T20:50:08Z")

</div>

Got it. Thank you for your help.
