# Can I draw a line in a segment by two points(X,Y)

**URL:** <https://discourse.slicer.org/t/can-i-draw-a-line-in-a-segment-by-two-points-x-y/15579>\
**Category:** Development\
**Created:** [January 18, 2021, 12:58pm UTC](https://discourse.slicer.org/t/can-i-draw-a-line-in-a-segment-by-two-points-x-y/15579 "2021-01-18T12:58:48Z")\
**Posts on this page:** 3\
**Page:** 1

<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:** [January 18, 2021, 12:58pm UTC](https://discourse.slicer.org/t/can-i-draw-a-line-in-a-segment-by-two-points-x-y/15579/1 "2021-01-18T12:58:48Z")

</div>

Can I draw a line in a single slice of a segment by two points(x,y), and then apply it in this segment by python.

---

<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:** [January 18, 2021, 1:00pm UTC](https://discourse.slicer.org/t/can-i-draw-a-line-in-a-segment-by-two-points-x-y/15579/2 "2021-01-18T13:00:14Z")

</div>

Just like this picture I know two points. the result-line should be added in segment.  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/2/2/22b5e3ddeec0e4be2976eea67c0572613686e1d7.png)

---

<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:** [January 18, 2021, 3:02pm UTC](https://discourse.slicer.org/t/can-i-draw-a-line-in-a-segment-by-two-points-x-y/15579/3 "2021-01-18T15:02:28Z")

</div>

You can use Draw Tube effect (provided by SegmentEditorExtraEffects extension).
