# Getting linear distances between fiducial landmarks

**URL:** https://discourse.slicer.org/t/getting-linear-distances-between-fiducial-landmarks/33065
**Category:** Development
**Tags:** markups-fiducials, markups
**Created:** [November 27, 2023, 3:46pm UTC](https://discourse.slicer.org/t/getting-linear-distances-between-fiducial-landmarks/33065 "2023-11-27T15:46:57Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![paleomariomm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/paleomariomm/32/68475_2.png) [@paleomariomm](https://discourse.slicer.org/u/paleomariomm)
#### Post date: [November 27, 2023, 3:46pm UTC](https://discourse.slicer.org/t/getting-linear-distances-between-fiducial-landmarks/33065/1 "2023-11-27T15:46:57Z")

</div>

I have created 5 fiducial markups in Slicer.

I would like to obtain the linear measurements between all of them (two by two).

I know that by selecting two points and right clicking we can obtain the linear measurement between those two landmarks. However, I was unable to find a way to get all linear distances.

Is there a way? maybe a quick Python script?

This is the example

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

---

<div class="post-metadata">

### Author: ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)
#### Post date: [November 27, 2023, 4:00pm UTC](https://discourse.slicer.org/t/getting-linear-distances-between-fiducial-landmarks/33065/2 "2023-11-27T16:00:43Z")

</div>

> [@paleomariomm](#):
>
> I would like to obtain the linear measurements between all of them (two by two).

If you mean all pairwaise distance, no there is no GUI way of doing it. You need to write a short python script.

---

<div class="post-metadata">

### Author: ![paleomariomm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/paleomariomm/32/68475_2.png) [@paleomariomm](https://discourse.slicer.org/u/paleomariomm)
#### Post date: [January 16, 2024, 4:22pm UTC](https://discourse.slicer.org/t/getting-linear-distances-between-fiducial-landmarks/33065/3 "2024-01-16T16:22:13Z")

</div>

Finally we solved this by exporting landmarks in JSON files and importing in R. Thanks

---

<div class="post-metadata">

### Author: ![jumbojing](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jumbojing/32/10811_2.png) [@jumbojing](https://discourse.slicer.org/u/jumbojing)
#### Post date: [January 16, 2024, 4:33pm UTC](https://discourse.slicer.org/t/getting-linear-distances-between-fiducial-landmarks/33065/4 "2024-01-16T16:33:34Z")

</div>

psDst = lambda pN: np.linalg.norm(ndA(pN), axis=-1, keepdims=True) # return (n, 1)

# psDst(ps-p)
