# Finding a midpoint between a line

**URL:** <https://discourse.slicer.org/t/finding-a-midpoint-between-a-line/32678>\
**Category:** Support\
**Created:** [November 8, 2023, 4:39pm UTC](https://discourse.slicer.org/t/finding-a-midpoint-between-a-line/32678 "2023-11-08T16:39:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SlicerNewUser](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/slicernewuser/32/68223_2.png) [@SlicerNewUser](https://discourse.slicer.org/u/SlicerNewUser)\
**Post date:** [November 8, 2023, 4:39pm UTC](https://discourse.slicer.org/t/finding-a-midpoint-between-a-line/32678/1 "2023-11-08T16:39:12Z")

</div>

Hi there,

If I make a Line in Markup (so there is 2 points). Is there anyway for the software to automatically mark another point that is the midpoint of that line?

Thank you

---

<div class="post-metadata">

**Author:** ![MariaGraf](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mariagraf/32/79290_2.png) [@MariaGraf](https://discourse.slicer.org/u/MariaGraf)\
**Post date:** [July 8, 2024, 11:27am UTC](https://discourse.slicer.org/t/finding-a-midpoint-between-a-line/32678/2 "2024-07-08T11:27:29Z")

</div>

Does anyone have an update on how to do this? I have been completing the midpoint by hand and it is quite time consuming.

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [July 8, 2024, 11:39am UTC](https://discourse.slicer.org/t/finding-a-midpoint-between-a-line/32678/3 "2024-07-08T11:39:36Z")

</div>

It is a few lines of Python code. This is an example for going through the points of a fiducial list:  
[https://slicer.readthedocs.io/en/latest/developer\_guide/script\_repository.html#write-markup-control-point-positions-to-json-file](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#write-markup-control-point-positions-to-json-file)

From here you only need to average the two points.
