# vmtkcenterlines not working with this geometry

**URL:** <https://discourse.slicer.org/t/vmtkcenterlines-not-working-with-this-geometry/28514>\
**Category:** VMTK\
**Created:** [March 22, 2023, 3:01am UTC](https://discourse.slicer.org/t/vmtkcenterlines-not-working-with-this-geometry/28514 "2023-03-22T03:01:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![amscosta](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/amscosta/32/80975_2.png) [@amscosta](https://discourse.slicer.org/u/amscosta)\
**Post date:** [March 22, 2023, 3:01am UTC](https://discourse.slicer.org/t/vmtkcenterlines-not-working-with-this-geometry/28514/1 "2023-03-22T03:01:58Z")

</div>

Hello All,  
My question is very simple. When I try :  
vmtkcenterlines -ifile manifold\_shell.stl -ofile manifold\_centerlines.vtp  
After selecting source and target points graphically, The vmtk enters in a crash loop.  
Any clue how to extract the centerlines is very welcome.  
Here it follows the manifold\_shell.stl (renamed to .mp4 for uploading purposes).

[https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/a/4/a4eeacfec93ccf2aa3a24b7f25bef554c975c953.mp4](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/a/4/a4eeacfec93ccf2aa3a24b7f25bef554c975c953.mp4)

---

<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:** [March 22, 2023, 3:04am UTC](https://discourse.slicer.org/t/vmtkcenterlines-not-working-with-this-geometry/28514/2 "2023-03-22T03:04:28Z")

</div>

This was due to a VTK bug that has been fixed in VTK about 8 months ago, which might not have made it into your VMTK distribution yet. The was backported to Slicer’s VTK a few days ago (in Slicer revision 31684).

---

<div class="post-metadata">

**Author:** ![amscosta](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/amscosta/32/80975_2.png) [@amscosta](https://discourse.slicer.org/u/amscosta)\
**Post date:** [March 23, 2023, 2:35pm UTC](https://discourse.slicer.org/t/vmtkcenterlines-not-working-with-this-geometry/28514/3 "2023-03-23T14:35:01Z")

</div>

Hi Andreas,  
I just followed the steps in your youtube video. Please see the attached video. However de centerlines curves are not so “smooth” as expected for this manifold.  
Any guidance about how to improve the centerlines are very welcome.

(Attachment manifold\_3d\_slicer\_centerline\_extract.mp4 is missing)

---

<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:** [March 23, 2023, 2:36pm UTC](https://discourse.slicer.org/t/vmtkcenterlines-not-working-with-this-geometry/28514/4 "2023-03-23T14:36:54Z")

</div>

The video is missing. Please try uploading it again (use the Slicer Forum web interface, email attachments probably don’t get posted).

---

<div class="post-metadata">

**Author:** ![amscosta](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/amscosta/32/80975_2.png) [@amscosta](https://discourse.slicer.org/u/amscosta)\
**Post date:** [March 23, 2023, 6:06pm UTC](https://discourse.slicer.org/t/vmtkcenterlines-not-working-with-this-geometry/28514/5 "2023-03-23T18:06:54Z")

</div>

> **[manifold\_3d\_slicer\_centerline\_extract.mp4](https://drive.google.com/file/d/11m_0siqv_wa6NQVgIORft06fvdvP72lp/view?usp=share_link)**
>
> Google Drive file.

---

<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:** [March 24, 2023, 4:22am UTC](https://discourse.slicer.org/t/vmtkcenterlines-not-working-with-this-geometry/28514/6 "2023-03-24T04:22:46Z")

</div>

To me the result shown on the video is very good. I’m not sure what kind of smoothness you are looking for. Maybe you could grab one frame of the video and just draw the curve shape that you would expect.

“Network” method extract centerline purely based on the geometry of the input surface. It will be just as smooth as the input shape dictates. Resolution of the input mesh migh affect the result (if the elements are large or their sizes are highly varying). Could you show the input model with edges displayed (models module → Display → 3D Display → Representation → Surface with edges)? You can try if uniform resampling in Surface toolbox module makes any difference in the output.

“Tree” method creates more realistic, directional flow pattern.
