# How to get the shortest path from a fiducialmarkupnode to a curvenode

**URL:** <https://discourse.slicer.org/t/how-to-get-the-shortest-path-from-a-fiducialmarkupnode-to-a-curvenode/30750>\
**Category:** Development\
**Created:** [July 24, 2023, 6:41am UTC](https://discourse.slicer.org/t/how-to-get-the-shortest-path-from-a-fiducialmarkupnode-to-a-curvenode/30750 "2023-07-24T06:41:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jay1987](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jay1987/32/16183_2.png) [@jay1987](https://discourse.slicer.org/u/jay1987)\
**Post date:** [July 24, 2023, 6:41am UTC](https://discourse.slicer.org/t/how-to-get-the-shortest-path-from-a-fiducialmarkupnode-to-a-curvenode/30750/1 "2023-07-24T06:41:38Z")

</div>

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/6/56759c7f63ca35fd3c858ba8ae3a4d26e5cf1b18.jpeg)  
i create a curve use several control points (yellow arrow)  
and then i create a point (red arrow)  
i want to get the projection point from the point(right arrow) to the curve(yellow arrow) , whick means get the point in the curve which has the shortest path to the point

(PS. I try to change the curve into a model node and use FiducialsToModelDistance to get the shortest path , but it failed , the output is always (0,0,0) )

---

<div class="post-metadata">

**Author:** ![Sunderlandkyl](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sunderlandkyl/32/79987_2.png) [@Sunderlandkyl](https://discourse.slicer.org/u/Sunderlandkyl)\
**Post date:** [July 24, 2023, 2:15pm UTC](https://discourse.slicer.org/t/how-to-get-the-shortest-path-from-a-fiducialmarkupnode-to-a-curvenode/30750/2 "2023-07-24T14:15:56Z")

</div>

You could try [vtkMRMLMarkupsCurveNode::GetClosestPointPositionAlongCurveWorld()](https://apidocs.slicer.org/main/classvtkMRMLMarkupsCurveNode.html#af010bba5a55c6e1483ccbd80b5dcef05).

---

<div class="post-metadata">

**Author:** ![jay1987](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jay1987/32/16183_2.png) [@jay1987](https://discourse.slicer.org/u/jay1987)\
**Post date:** [July 25, 2023, 1:50am UTC](https://discourse.slicer.org/t/how-to-get-the-shortest-path-from-a-fiducialmarkupnode-to-a-curvenode/30750/3 "2023-07-25T01:50:30Z")

</div>

thank you @Sunderlandkyl ,it’s really work!!
