# How to draw a line on sagittal view

**URL:** <https://discourse.slicer.org/t/how-to-draw-a-line-on-sagittal-view/13306>\
**Category:** Development\
**Created:** [September 2, 2020, 8:54pm UTC](https://discourse.slicer.org/t/how-to-draw-a-line-on-sagittal-view/13306 "2020-09-02T20:54:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![DavidCai1246](https://avatars.discourse-cdn.com/v4/letter/d/e99b99/32.png) [@DavidCai1246](https://discourse.slicer.org/u/DavidCai1246)\
**Post date:** [September 2, 2020, 8:54pm UTC](https://discourse.slicer.org/t/how-to-draw-a-line-on-sagittal-view/13306/1 "2020-09-02T20:54:07Z")

</div>

For the application I am working on, I would like to draw horizontal lines in the sagittal view to mark specific slices that I am interested in. Is there code that can help me achieve this?

I know that in the Markups module I can use a button to draw a markup line, I would like something similar to that.

Thanks in advance!

---

<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:** [September 2, 2020, 9:09pm UTC](https://discourse.slicer.org/t/how-to-draw-a-line-on-sagittal-view/13306/2 "2020-09-02T21:09:44Z")

</div>

Markup lines or planes should work well for this. You can place them easily from Python script: add a markups line/plane node to the scene and set control point positions.

---

<div class="post-metadata">

**Author:** ![DavidCai1246](https://avatars.discourse-cdn.com/v4/letter/d/e99b99/32.png) [@DavidCai1246](https://discourse.slicer.org/u/DavidCai1246)\
**Post date:** [September 2, 2020, 9:25pm UTC](https://discourse.slicer.org/t/how-to-draw-a-line-on-sagittal-view/13306/3 "2020-09-02T21:25:44Z")

</div>

For the python script do you mean:

[https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Rotate\_a\_node\_around\_a\_specified\_line](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Rotate_a_node_around_a_specified_line)

---

<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:** [September 2, 2020, 10:57pm UTC](https://discourse.slicer.org/t/how-to-draw-a-line-on-sagittal-view/13306/4 "2020-09-02T22:57:46Z")

</div>

There are several relevant examples, see here: [https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Markups](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Markups)

---

<div class="post-metadata">

**Author:** ![DavidCai1246](https://avatars.discourse-cdn.com/v4/letter/d/e99b99/32.png) [@DavidCai1246](https://discourse.slicer.org/u/DavidCai1246)\
**Post date:** [September 2, 2020, 11:03pm UTC](https://discourse.slicer.org/t/how-to-draw-a-line-on-sagittal-view/13306/5 "2020-09-02T23:03:53Z")

</div>

thank you very much!
