# Route calculation between two points

**URL:** <https://discourse.slicer.org/t/route-calculation-between-two-points/11590>\
**Category:** Support\
**Created:** [May 6, 2020, 5:56pm UTC](https://discourse.slicer.org/t/route-calculation-between-two-points/11590 "2020-05-06T17:56:53Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jini](https://avatars.discourse-cdn.com/v4/letter/j/5daacb/32.png) [@Jini](https://discourse.slicer.org/u/Jini)\
**Post date:** [May 6, 2020, 5:56pm UTC](https://discourse.slicer.org/t/route-calculation-between-two-points/11590/1 "2020-05-06T17:56:53Z")

</div>

thanks 🙂  
we I can calculation the route from example two point with slicer?

---

<div class="post-metadata">

**Author:** ![Jini](https://avatars.discourse-cdn.com/v4/letter/j/5daacb/32.png) [@Jini](https://discourse.slicer.org/u/Jini)\
**Post date:** [May 17, 2020, 8:58am UTC](https://discourse.slicer.org/t/route-calculation-between-two-points/11590/2 "2020-05-17T08:58:06Z")

</div>

How can I do a route calculation in Cartesian coordinates with slicer? Is there a tool for the calculation?

---

<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:** [May 17, 2020, 2:18pm UTC](https://discourse.slicer.org/t/route-calculation-between-two-points/11590/3 "2020-05-17T14:18:47Z")

</div>

Slicer can compute route between two points on a mesh surface or a network of lines. If your input is an image you need to segment it first. If you wan find route in the centerline then you can use VMTK extension’s centerline extraction module (clicking on “Preview” is enough, no need to run the full computation).

[![](https://img.youtube.com/vi/UpfDP6ejCjg/hqdefault.jpg "Finding shortest path between two points in the bronchial tree") ](https://www.youtube.com/watch?v=UpfDP6ejCjg)

---

<div class="post-metadata">

**Author:** ![Jini](https://avatars.discourse-cdn.com/v4/letter/j/5daacb/32.png) [@Jini](https://discourse.slicer.org/u/Jini)\
**Post date:** [May 17, 2020, 5:28pm UTC](https://discourse.slicer.org/t/route-calculation-between-two-points/11590/4 "2020-05-17T17:28:38Z")

</div>

I would like to be able to calculate the vector of the route. For that I have to get the x, y, z values? Where can I read the vectors of these points in the slicer?

---

<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:** [May 17, 2020, 5:42pm UTC](https://discourse.slicer.org/t/route-calculation-between-two-points/11590/5 "2020-05-17T17:42:28Z")

</div>

Can you tell a bit more about what you would like to achieve?

---

<div class="post-metadata">

**Author:** ![Jini](https://avatars.discourse-cdn.com/v4/letter/j/5daacb/32.png) [@Jini](https://discourse.slicer.org/u/Jini)\
**Post date:** [May 18, 2020, 8:47am UTC](https://discourse.slicer.org/t/route-calculation-between-two-points/11590/6 "2020-05-18T08:47:06Z")

</div>

I would like to invite two segmentation models into slicer and determine the deformation of the two models using the route calculation in Cartesian coordinates. For the route calculation in Cartesian coordinates, I need vectors and angles. I must to set the zero point (3D axis, xyz) on segmentation Modell to calculate from there ?

---

<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:** [May 18, 2020, 5:19pm UTC](https://discourse.slicer.org/t/route-calculation-between-two-points/11590/7 "2020-05-18T17:19:21Z")

</div>

Now I’m even more confused about what you mean by route calculation. Can you post an annotated screenshot or draw a sketch that explains what you want to achieve?

If you want to spatially align segments by translating/rotating/warping then you can use SegmentRegistration extension.

---

<div class="post-metadata">

**Author:** ![Jini](https://avatars.discourse-cdn.com/v4/letter/j/5daacb/32.png) [@Jini](https://discourse.slicer.org/u/Jini)\
**Post date:** [May 19, 2020, 7:18pm UTC](https://discourse.slicer.org/t/route-calculation-between-two-points/11590/8 "2020-05-19T19:18:59Z")

</div>

I post tommoro a picture what i mean with route calulation in the model 🙂

---

<div class="post-metadata">

**Author:** ![Jini](https://avatars.discourse-cdn.com/v4/letter/j/5daacb/32.png) [@Jini](https://discourse.slicer.org/u/Jini)\
**Post date:** [May 20, 2020, 9:52am UTC](https://discourse.slicer.org/t/route-calculation-between-two-points/11590/9 "2020-05-20T09:52:26Z")

</div>

![IMG_3316](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/f/0/f0353f988dbab4b66af6b2f00b69e0af30f824e0.jpeg)

In the picture you can see what I mean with roue calculation.

---

<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:** [May 20, 2020, 3:52pm UTC](https://discourse.slicer.org/t/route-calculation-between-two-points/11590/10 "2020-05-20T15:52:43Z")

</div>

Do you just want to compute vectors between points?

---

<div class="post-metadata">

**Author:** ![Jini](https://avatars.discourse-cdn.com/v4/letter/j/5daacb/32.png) [@Jini](https://discourse.slicer.org/u/Jini)\
**Post date:** [May 20, 2020, 5:43pm UTC](https://discourse.slicer.org/t/route-calculation-between-two-points/11590/11 "2020-05-20T17:43:03Z")

</div>

I want to calculate vectors in Cartesian coordinates. I want to calculate the distance (vector) between the points for example from two models. For this, I must to set the zero point on axis for the first model and calculate the distance to other models from there. The angle calculation is also important, to consider the deformation of the two models.

---

<div class="post-metadata">

**Author:** ![Jini](https://avatars.discourse-cdn.com/v4/letter/j/5daacb/32.png) [@Jini](https://discourse.slicer.org/u/Jini)\
**Post date:** [May 20, 2020, 5:45pm UTC](https://discourse.slicer.org/t/route-calculation-between-two-points/11590/12 "2020-05-20T17:45:24Z")

</div>

If I get the vectors and angles from slicer, I can also calculate them with an excel table. For this I need the values in a 3D room.

---

<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:** [May 20, 2020, 5:49pm UTC](https://discourse.slicer.org/t/route-calculation-between-two-points/11590/13 "2020-05-20T17:49:48Z")

</div>

You can get point coordinates of models using [slicer.util.arrayFromModelPoints](https://slicer.readthedocs.io/en/latest/developer_guide/slicer.html#slicer.util.arrayFromModelPoints). VTK has functions for finding closest points, you can also get distances between closest points of two models, etc. If you describe specifically what you want to compute then we can recommend which methods to use.

---

<div class="post-metadata">

**Author:** ![Jini](https://avatars.discourse-cdn.com/v4/letter/j/5daacb/32.png) [@Jini](https://discourse.slicer.org/u/Jini)\
**Post date:** [May 22, 2020, 8:15am UTC](https://discourse.slicer.org/t/route-calculation-between-two-points/11590/14 "2020-05-22T08:15:08Z")

</div>

What the tool Vector to scalar volume does?

---

<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:** [May 23, 2020, 4:53am UTC](https://discourse.slicer.org/t/route-calculation-between-two-points/11590/15 "2020-05-23T04:53:33Z")

</div>

Vector to scalar volume module converts a vector volume (each voxel of the volume is a vector) to a scalar volume (each voxel of the volume is a scalar value).

---

<div class="post-metadata">

**Author:** ![Jini](https://avatars.discourse-cdn.com/v4/letter/j/5daacb/32.png) [@Jini](https://discourse.slicer.org/u/Jini)\
**Post date:** [May 26, 2020, 9:31am UTC](https://discourse.slicer.org/t/route-calculation-between-two-points/11590/16 "2020-05-26T09:31:03Z")

</div>

![Fiducial](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/d/8/d8ee30e8c75273ccfabd0d6753beb59dde0a0aa6.png)

Is this a usefull for catesiche cordination calculation? What is R, A ans S in this Markups?  
I dont understand we I get a Vector from this Fiducial marker?

---

<div class="post-metadata">

**Author:** ![Jini](https://avatars.discourse-cdn.com/v4/letter/j/5daacb/32.png) [@Jini](https://discourse.slicer.org/u/Jini)\
**Post date:** [May 26, 2020, 9:35am UTC](https://discourse.slicer.org/t/route-calculation-between-two-points/11590/17 "2020-05-26T09:35:04Z")

</div>

I think S is z-Achse and A is y-Achse and R is x-Achse ?

---

<div class="post-metadata">

**Author:** ![Jini](https://avatars.discourse-cdn.com/v4/letter/j/5daacb/32.png) [@Jini](https://discourse.slicer.org/u/Jini)\
**Post date:** [May 26, 2020, 1:00pm UTC](https://discourse.slicer.org/t/route-calculation-between-two-points/11590/18 "2020-05-26T13:00:49Z")

</div>

![02.PNG](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/1/6/16ba559e43b0abfa73614e75d152581549f21e41.jpeg)  
Why I can not do by markups  
List: with create new markupsfiducial as ?

---

<div class="post-metadata">

**Author:** ![Jini](https://avatars.discourse-cdn.com/v4/letter/j/5daacb/32.png) [@Jini](https://discourse.slicer.org/u/Jini)\
**Post date:** [May 27, 2020, 9:36am UTC](https://discourse.slicer.org/t/route-calculation-between-two-points/11590/19 "2020-05-27T09:36:13Z")

</div>

![Markups 4.10 and 4.11](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/9/d/9d94dbcb9a17ae33c6da6338c9cf83a8d635959b.png)  
Hello Lassoan, in the new version from Slicer we have no List for markups (see please picture).  
I segment all with new Version 4.11. and i can not do markups with old Version.

We I can create markups for two model in new Version 4.11. ?

Thank you for your help.

Best regards

---

<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:** [June 8, 2020, 3:04am UTC](https://discourse.slicer.org/t/route-calculation-between-two-points/11590/20 "2020-06-08T03:04:33Z")

</div>

> [@Jini](#):
>
> What is R, A ans S in this Markups?

These are patient coordinate system axes. R=right, A=anterior, S=superior.

> [@Jini](#):
>
> Hello Lassoan, in the new version from Slicer we have no List for markups

I would recommend to use a recent Slicer Preview Release. You can rename a markups node by double-clicking on its name (or right-click on it and choose Rename).
