# Problem with VMTK extract centerline module

**URL:** https://discourse.slicer.org/t/problem-with-vmtk-extract-centerline-module/42748
**Category:** Support
**Created:** [April 30, 2025, 12:53pm UTC](https://discourse.slicer.org/t/problem-with-vmtk-extract-centerline-module/42748 "2025-04-30T12:53:02Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![francesca\_flore](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/francesca_flore/32/15307_2.png) [@francesca\_flore](https://discourse.slicer.org/u/francesca_flore)
#### Post date: [April 30, 2025, 12:53pm UTC](https://discourse.slicer.org/t/problem-with-vmtk-extract-centerline-module/42748/1 "2025-04-30T12:53:02Z")

</div>

It seems that the generated centerline does not start and end from the endpoints I give it, but it is as if it is cut before. Any idea?

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

---

<div class="post-metadata">

### Author: ![Deep\_Learning](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/deep_learning/32/15345_2.png) [@Deep\_Learning](https://discourse.slicer.org/u/Deep_Learning)
#### Post date: [April 30, 2025, 2:13pm UTC](https://discourse.slicer.org/t/problem-with-vmtk-extract-centerline-module/42748/2 "2025-04-30T14:13:58Z")

</div>

That is expected behavior.

---

<div class="post-metadata">

### Author: ![francesca\_flore](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/francesca_flore/32/15307_2.png) [@francesca\_flore](https://discourse.slicer.org/u/francesca_flore)
#### Post date: [April 30, 2025, 2:20pm UTC](https://discourse.slicer.org/t/problem-with-vmtk-extract-centerline-module/42748/3 "2025-04-30T14:20:26Z")

</div>

but I need the centerline from the two assigned points. I am missing a part because it is not totally attached to the assigned points.

---

<div class="post-metadata">

### Author: ![mikebind](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@mikebind](https://discourse.slicer.org/u/mikebind)
#### Post date: [May 1, 2025, 5:09pm UTC](https://discourse.slicer.org/t/problem-with-vmtk-extract-centerline-module/42748/4 "2025-05-01T17:09:26Z")

</div>

The problem is that the endpoints you provided are not on the “centerline” of the object you provided. The centerline returned by VMTK runs along the voronoi medial surface of the object. The endpoints you chose are not on this surface. I assume the physical object you are interested in extends beyond the two flat faces that you put the endpoints on, but those are the boundaries of your image. You could try adding two cylindrical extensions to those faces (one for each face) with your endpoints at the center of the cylinder face against the object, and then run centerline extraction on the augmented object. The extensions should ensure that your endpoints then lie on the voronoi medial surface, and you can see if the extracted centerline will work for you as desired.

---

<div class="post-metadata">

### Author: ![francesca\_flore](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/francesca_flore/32/15307_2.png) [@francesca\_flore](https://discourse.slicer.org/u/francesca_flore)
#### Post date: [May 5, 2025, 7:44am UTC](https://discourse.slicer.org/t/problem-with-vmtk-extract-centerline-module/42748/5 "2025-05-05T07:44:33Z")

</div>

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/9/7988d703ca13a3115e795a0b802d87f9684ef290.png)

I think the problem is better understood here. I have a valve model and I would like the centerline along its entire section, but the centerline generated is shorter than it should be.

---

<div class="post-metadata">

### Author: ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)
#### Post date: [May 5, 2025, 8:39am UTC](https://discourse.slicer.org/t/problem-with-vmtk-extract-centerline-module/42748/6 "2025-05-05T08:39:11Z")

</div>

Since you model is very harmonious, you may try this:

- use `Edit centerline` module to generate a tube
- fit the tube to the ends of your model
- use the spline of the tube as centerline
- or create a new centerline in the module.

---

<div class="post-metadata">

### Author: ![francesca\_flore](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/francesca_flore/32/15307_2.png) [@francesca\_flore](https://discourse.slicer.org/u/francesca_flore)
#### Post date: [May 6, 2025, 7:46am UTC](https://discourse.slicer.org/t/problem-with-vmtk-extract-centerline-module/42748/7 "2025-05-06T07:46:59Z")

</div>

Finally for the valve model I solved it by generating the centerline.vtk myself. But how is it possible that for the vessel segments the centerline seems to be wrong? As in the attached photo, the centerline seems to go to one side and is not centered and does not reach the endpoints.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/f/5/f554ef995641b0a7b69fde288726232f2ec2714f.jpeg)
