# Extract centeline Auto-detect tree mode

**URL:** https://discourse.slicer.org/t/extract-centeline-auto-detect-tree-mode/26576
**Category:** Support
**Created:** [December 5, 2022, 11:50am UTC](https://discourse.slicer.org/t/extract-centeline-auto-detect-tree-mode/26576 "2022-12-05T11:50:48Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![bserrano](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/bserrano/32/17034_2.png) [@bserrano](https://discourse.slicer.org/u/bserrano)
#### Post date: [December 5, 2022, 11:50am UTC](https://discourse.slicer.org/t/extract-centeline-auto-detect-tree-mode/26576/1 "2022-12-05T11:50:48Z")

</div>

Hello,

I am using the Extact Centerline module with Endpoints Autodetect to generate the centerlines over all the vessels of a coronary tree. For this I use the tree option.  
After a couple of attempts and smoothing the geometry I have obtained something like this:

 ![imagen](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/4/1/411d3e0d141bb72bd75d33c12c0f10a05a453927.png)

However, I am trying with other patients and I am not able to get all the curves. The program gives me the model but only 1 centreline.

 ![imagen](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/a/5/a5d222d20178670de6c52d0f2f00dfc2d1d14f55.jpeg)

How can i get all centrelines?  
The module is very unstable and causes the application to close suddenly on numerous occasions.  
I’m using Slicer 5.0.3.

---

<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: [December 6, 2022, 5:04pm UTC](https://discourse.slicer.org/t/extract-centeline-auto-detect-tree-mode/26576/2 "2022-12-06T17:04:57Z")

</div>

The automatic centerline endpoint detection results are editable. Feel free to move the points to more appropriate locations (for example, move the first point to the center of the aorta, remove the seemingly spurious endpoint slightly above the valve, …). Also make sure the aorta endpoint is marked as inflow (unselected - cyan by default), while others are outflow (selected - red by default).

If all the endpoints are set correctly and the centerline model looks good, but you only get a single curve then it means that topological analysis of the centerline tree failed.

You may try to increase “Target point count” to 10-20k and/or reduce “Decimation aggressiveness” in Advanced section.

No failure should lead to crashing of the application. We haven’t received any reports of VMTK crashing while detecting the centerline, so we are confident that it is robust, but of course there can be always some special cases that may triggered by some unexpected input data. If you can reproduce a crash with the latest stable version (Slicer-5.2) then please upload the input segmentation data somewhere (dropbox, onedrive, etc.) and post the link here so that we can investigate.

---

<div class="post-metadata">

### Author: ![bserrano](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/bserrano/32/17034_2.png) [@bserrano](https://discourse.slicer.org/u/bserrano)
#### Post date: [December 7, 2022, 4:32pm UTC](https://discourse.slicer.org/t/extract-centeline-auto-detect-tree-mode/26576/3 "2022-12-07T16:32:23Z")

</div>

Hello,

I have downloaded the new version of slicer (5.2.1) and the problem persists. For example, for this segmentation with parameters “Target point count” 10k and “Decimation aggressiveness” 3, the program quits unexpectedly.

I don’t know where to change the inflow and outflow parameters for the endpoints. I’ll check if I can upload the example.

![imagen](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/d/5/d5760d2555a4214ceaedd3f8a8f4164f46469be0.jpeg)

Thanks,

---

<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: [December 8, 2022, 3:26am UTC](https://discourse.slicer.org/t/extract-centeline-auto-detect-tree-mode/26576/4 "2022-12-08T03:26:13Z")

</div>

Yes, please upload the segmentation and I can have a look.

---

<div class="post-metadata">

### Author: ![bserrano](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/bserrano/32/17034_2.png) [@bserrano](https://discourse.slicer.org/u/bserrano)
#### Post date: [January 2, 2023, 3:19pm UTC](https://discourse.slicer.org/t/extract-centeline-auto-detect-tree-mode/26576/5 "2023-01-02T15:19:42Z")

</div>

Hi,

Unfortunately I can’t upload the geometry at the moment. However, I have noticed that in order to avoid unexpected behaviour it is advisable to smooth the geometry and place the endpoints a bit before the end of the vessels.

I have not yet found where to change the endpoint type (inflow/outflow).

Thanks a lot 🙂

---

<div class="post-metadata">

### Author: ![bserrano](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/bserrano/32/17034_2.png) [@bserrano](https://discourse.slicer.org/u/bserrano)
#### Post date: [March 17, 2023, 7:56am UTC](https://discourse.slicer.org/t/extract-centeline-auto-detect-tree-mode/26576/6 "2023-03-17T07:56:14Z")

</div>

Hi, I experimented the same problem with an aorta in this case.  
The geometry is extremely smooth, but Extract Centerline module continues to crash every time, closing Slicer.

What I want is a centerline between the endpoints as shown below  
 ![imagen](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/b/d/bd026b48ba885dedabe728b60f6ca8da78394829.png)

You can find the stl here: [Sign in to your account](https://nubeusc-my.sharepoint.com/:u:/g/personal/belen_serrano_anton_rai_usc_es/Eee9otPKvzZCnX-RdCxCBU0BL1B4uq6TNofL46nn8f6igg?e=jEENhn)

---

<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 18, 2023, 4:17am UTC](https://discourse.slicer.org/t/extract-centeline-auto-detect-tree-mode/26576/7 "2023-03-18T04:17:24Z")

</div>

The crash was due to a bug in VTK that I’ve fixed a couple of months ago, but that fix was not yet backported into Slicer’s VTK. I’ve now [backported it](https://github.com/Slicer/Slicer/commit/396c8e5d0ac6bcacf413103c3cb358211a9d5d8c), so centerline extraction will work robustly in Slicer Preview Release that you download on 2023-03-19 or later.

---

<div class="post-metadata">

### Author: ![bserrano](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/bserrano/32/17034_2.png) [@bserrano](https://discourse.slicer.org/u/bserrano)
#### Post date: [March 20, 2023, 9:28am UTC](https://discourse.slicer.org/t/extract-centeline-auto-detect-tree-mode/26576/8 "2023-03-20T09:28:41Z")

</div>

Many thanks, so it is not yet available on Windows, right?

---

<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 20, 2023, 12:06pm UTC](https://discourse.slicer.org/t/extract-centeline-auto-detect-tree-mode/26576/9 "2023-03-20T12:06:16Z")

</div>

The fix is already available in the latest Slicer Preview Releases on all operating systems.

---

<div class="post-metadata">

### Author: ![bserrano](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/bserrano/32/17034_2.png) [@bserrano](https://discourse.slicer.org/u/bserrano)
#### Post date: [March 20, 2023, 12:12pm UTC](https://discourse.slicer.org/t/extract-centeline-auto-detect-tree-mode/26576/10 "2023-03-20T12:12:29Z")

</div>

But the last preview release for Windows is from 2023-03-16

 ![imagen](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/f/5f239a761d366b4b27d0c5bf8d632de5727f6ed4.png)

---

<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 20, 2023, 1:19pm UTC](https://discourse.slicer.org/t/extract-centeline-auto-detect-tree-mode/26576/11 "2023-03-20T13:19:07Z")

</div>

There has been an error in the Windows builds. We’ll investigate.

@jcfr could you have a look at this [build error on Windows due to generate\_pyi.py](https://slicer.cdash.org/viewBuildError.php?onlydeltap&buildid=2973787)?
