# VMTK Centerline Display by CenterlineId

**URL:** <https://discourse.slicer.org/t/vmtk-centerline-display-by-centerlineid/12418>\
**Category:** Support\
**Created:** [July 7, 2020, 2:48pm UTC](https://discourse.slicer.org/t/vmtk-centerline-display-by-centerlineid/12418 "2020-07-07T14:48:06Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![szhang](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@szhang](https://discourse.slicer.org/u/szhang)\
**Post date:** [July 7, 2020, 2:48pm UTC](https://discourse.slicer.org/t/vmtk-centerline-display-by-centerlineid/12418/1 "2020-07-07T14:48:06Z")

</div>

Hello  
I have been using the 4.11.0-2020-06-30 version of the Slicer, and would like to know how to display the centerline by the attribute CenterlineId, e.g. the picture below should display 8 centerlines for the user to pick and choose

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/8/2/82e235d8862b12f22aa2e036fd83efad304e482d.png)

---

<div class="post-metadata">

**Author:** ![szhang](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@szhang](https://discourse.slicer.org/u/szhang)\
**Post date:** [July 7, 2020, 9:33pm UTC](https://discourse.slicer.org/t/vmtk-centerline-display-by-centerlineid/12418/2 "2020-07-07T21:33:31Z")

</div>

Hi Andras, @lassoan  
Could you kindly provide some insights? So far I see the curves are broken into segments based on the vtkPolydata cell numbers, but would prefer to have the ability to select a whole path from the top to an endpoint. Thank you!

---

<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:** [July 8, 2020, 12:22pm UTC](https://discourse.slicer.org/t/vmtk-centerline-display-by-centerlineid/12418/3 "2020-07-08T12:22:38Z")

</div>

If you don’t want to extract a whole tree then just specify a start point and end point, as shown in this video:

[![](https://img.youtube.com/vi/yi07mjr3JeU/maxresdefault.jpg "New vessel branch extraction module for 3D Slicer") ](https://www.youtube.com/watch?v=yi07mjr3JeU)

---

<div class="post-metadata">

**Author:** ![szhang](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@szhang](https://discourse.slicer.org/u/szhang)\
**Post date:** [July 8, 2020, 2:01pm UTC](https://discourse.slicer.org/t/vmtk-centerline-display-by-centerlineid/12418/4 "2020-07-08T14:01:26Z")

</div>

Thanks, @lassoan  
So far my experience at 4.11.0-2020-06-30 version is that with two endpoints manually clicked (I made sure they are within the segmentation, as otherwise they can be clicked anywhere in the space), the result shows the whole tree (see below) broken up by 15 segments

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/b/b/bb6d219277f855cd603bbeafd0b4ccadcc50b02f.png)  
However, back to my original question, I would love to have the whole tree extracted, but visualize them labeled by the attribute “CenterlineId”, i.e. each curves composed of points from the beginning point to each corresponding end point, hence, eight(8) centerlines in this example.  
Would really appreciate your advice!

---

<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:** [July 8, 2020, 2:33pm UTC](https://discourse.slicer.org/t/vmtk-centerline-display-by-centerlineid/12418/5 "2020-07-08T14:33:11Z")

</div>

Choose “Centerline curve” and not “Network curve” to extract centerline between selected endpoints.

If you extract all the branches then you can use markups curves to find path between two arbitrary points: go to Markups module, drop two points of a curve on the tree, open Curve Settings section, choose Curve type → “Shortest distance on surface” and Model node → the tree model. See this video:

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

---

<div class="post-metadata">

**Author:** ![szhang](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@szhang](https://discourse.slicer.org/u/szhang)\
**Post date:** [July 8, 2020, 5:17pm UTC](https://discourse.slicer.org/t/vmtk-centerline-display-by-centerlineid/12418/6 "2020-07-08T17:17:26Z")

</div>

Thanks a lot for the tutorial video, @lassoan  
I don’t quite follow this step, could you please elaborate more?

> drop two points of a curve on the tree

---

<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:** [July 8, 2020, 5:35pm UTC](https://discourse.slicer.org/t/vmtk-centerline-display-by-centerlineid/12418/7 "2020-07-08T17:35:42Z")

</div>

I mean place two markup curve points close to the centerline/network model. If you enable “Shortest distance on surface” option then the curve will be constrained to connect these two points via lines of the chosen model node.

---

<div class="post-metadata">

**Author:** ![szhang](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@szhang](https://discourse.slicer.org/u/szhang)\
**Post date:** [July 8, 2020, 9:18pm UTC](https://discourse.slicer.org/t/vmtk-centerline-display-by-centerlineid/12418/8 "2020-07-08T21:18:55Z")

</div>

Got it, thank you, @lassoan, it is quite a convenient way to visualize the centerline!
