# Generate a plane through the markups

**URL:** <https://discourse.slicer.org/t/generate-a-plane-through-the-markups/3273>\
**Category:** Support\
**Created:** [June 24, 2018, 12:34pm UTC](https://discourse.slicer.org/t/generate-a-plane-through-the-markups/3273 "2018-06-24T12:34:39Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![George](https://avatars.discourse-cdn.com/v4/letter/g/71e660/32.png) [@George](https://discourse.slicer.org/u/George)\
**Post date:** [June 24, 2018, 12:34pm UTC](https://discourse.slicer.org/t/generate-a-plane-through-the-markups/3273/1 "2018-06-24T12:34:39Z")

</div>

Hello! I’m very sorry if this problem has already been resolved, but I didn’t manage to find the answer. I need to draw (generate?) a large plane that passes through the three points (markups) as depicted in this photoshopped example:

 ![Slicer](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/3/739bd3dd58e268a3edef3ed33a700e0e5470fd51.png)

Thank you very much for your help!

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [June 24, 2018, 3:45pm UTC](https://discourse.slicer.org/t/generate-a-plane-through-the-markups/3273/2 "2018-06-24T15:45:38Z")

</div>

You can create a plane polydata using VTK and set it as polydata of a model node. Probably 6-8 lines of Python code. Check out Slicer script repository for examples. [https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Set\_slice\_position\_and\_orientation\_from\_3\_markup\_fiducials](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Set_slice_position_and_orientation_from_3_markup_fiducials)

There are many other ways to do this. What would you like to achieve?

---

<div class="post-metadata">

**Author:** ![timeanddoctor](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/timeanddoctor/32/5839_2.png) [@timeanddoctor](https://discourse.slicer.org/u/timeanddoctor)\
**Post date:** [June 25, 2018, 11:58am UTC](https://discourse.slicer.org/t/generate-a-plane-through-the-markups/3273/3 "2018-06-25T11:58:55Z")

</div>

Did you resolve it and I am very interesting for that even I can do it easily in Mimics

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [June 25, 2018, 12:18pm UTC](https://discourse.slicer.org/t/generate-a-plane-through-the-markups/3273/4 "2018-06-25T12:18:59Z")

</div>

It’s very easy to define a plane using markups (the linked example shows how to create a sphere based on markups). The question is what to do with it once you have it. Just display the plane, or cut models with it, or use it as a reference for measurements, …?

---

<div class="post-metadata">

**Author:** ![timeanddoctor](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/timeanddoctor/32/5839_2.png) [@timeanddoctor](https://discourse.slicer.org/u/timeanddoctor)\
**Post date:** [June 25, 2018, 12:34pm UTC](https://discourse.slicer.org/t/generate-a-plane-through-the-markups/3273/5 "2018-06-25T12:34:44Z")

</div>

what I went to do usually in Mimics just to cut a model, define a point or a midline for my model. I think it is important we can extend the plane created by three makeups

---

<div class="post-metadata">

**Author:** ![George](https://avatars.discourse-cdn.com/v4/letter/g/71e660/32.png) [@George](https://discourse.slicer.org/u/George)\
**Post date:** [June 28, 2018, 11:34am UTC](https://discourse.slicer.org/t/generate-a-plane-through-the-markups/3273/6 "2018-06-28T11:34:00Z")

</div>

Thank you very much for the prompt answer! The code with shpere looks perfect in this situation, except I don’t have enough coding experience to modify it myself. If you could advise me on how to change figure from the spehere to the plane (rectangle?) and define two additional coordinate points from two additional markups (the first coordinate “SetCenter(centerPointCoord)” would work fine, I think?). And how to define the size of the rectangle/square?  
This plane would work as a reference for assessing the site of arterial disease in relation to bony markings, i.e. we will set three marks on the bony structures at predefined sites, then generate the plane trough these marks and look at the diseased arterial segment - if it is situated above or below the plane.  
Thank you very much for your assistance!

---

<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:** [June 28, 2018, 1:26pm UTC](https://discourse.slicer.org/t/generate-a-plane-through-the-markups/3273/7 "2018-06-28T13:26:59Z")

</div>

> [@George](#):
>
> and look at the diseased arterial segment - if it is situated above or below the plane.

Would something like in the attachement be sufficient ? It’s much simpler to do for locating a diseased artery. Your use case context is yet not clear.

 ![Screenshot](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/3/4/34ae0b91e51493cd1a6e5a121624532905f6cb5d.png)

---

<div class="post-metadata">

**Author:** ![Arnaud](https://avatars.discourse-cdn.com/v4/letter/a/e8c25b/32.png) [@Arnaud](https://discourse.slicer.org/u/Arnaud)\
**Post date:** [July 4, 2018, 2:36pm UTC](https://discourse.slicer.org/t/generate-a-plane-through-the-markups/3273/8 "2018-07-04T14:36:46Z")

</div>

Hi,  
I’d be interested to know how to cut a model above a plane defined by markup.

thank you

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [July 4, 2018, 4:31pm UTC](https://discourse.slicer.org/t/generate-a-plane-through-the-markups/3273/9 "2018-07-04T16:31:50Z")

</div>

I’ve added a short example to the script repository that positions the _red_ slice viewer to fit on first 3 points of _F_ markup fiducial list: [Documentation/Nightly/ScriptRepository - Slicer Wiki](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Set_slice_position_and_orientation_from_3_markup_fiducials)

You can clip a model using a slice view’s plane using [EasyClip extension](http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Extensions/EasyClip).

If you segment the structure using Segment Editor module, then you can use _Scissors effect_ with _Slice cut_ option set to positive or negative. It’ll cut only on one side of the slice where you are drawing at.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/a/7a45b250d98bd2092eb61b822a5693196c546ad9.jpeg)

---

<div class="post-metadata">

**Author:** ![Arnaud](https://avatars.discourse-cdn.com/v4/letter/a/e8c25b/32.png) [@Arnaud](https://discourse.slicer.org/u/Arnaud)\
**Post date:** [July 10, 2018, 9:50am UTC](https://discourse.slicer.org/t/generate-a-plane-through-the-markups/3273/10 "2018-07-10T09:50:20Z")

</div>

Hi and thanks for the code.  
I tried it and it’s very usefull to segment just one side of the skull and make the model

Finally what I’d like to obtain is the mirror of this model but when I use the mirror in surface toolbox I can’t choose the mirror plane that I whant (the same than for the segmentation) and this is what I have

 ![21](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/4/1/41f5fb0e800204e1a0d2ea684a8eb79da24c84a9.png)

Any solution to choose the plane?

Sorry to insist but I’m stuck…

thanks for helping me

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [July 10, 2018, 2:30pm UTC](https://discourse.slicer.org/t/generate-a-plane-through-the-markups/3273/11 "2018-07-10T14:30:07Z")

</div>

See my response in your other thread: [Mirror in surface toolbox](https://discourse.slicer.org/t/mirror-in-surface-toolbox/3297/2?u=lassoan)

---

<div class="post-metadata">

**Author:** ![haylea.b](https://avatars.discourse-cdn.com/v4/letter/h/f07891/32.png) [@haylea.b](https://discourse.slicer.org/u/haylea.b)\
**Post date:** [July 20, 2018, 10:14am UTC](https://discourse.slicer.org/t/generate-a-plane-through-the-markups/3273/12 "2018-07-20T10:14:07Z")

</div>

Hi there, I would like to make a reference plane for measurements, are you able to help? many thanks 🙂

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [July 23, 2018, 4:22am UTC](https://discourse.slicer.org/t/generate-a-plane-through-the-markups/3273/13 "2018-07-23T04:22:32Z")

</div>

Please write this question in a new post and give some more details about what exactly you would like to do.
