# Extract Centerline fails when calculating the centerline with "Tree" window

**URL:** <https://discourse.slicer.org/t/extract-centerline-fails-when-calculating-the-centerline-with-tree-window/25546>\
**Category:** Support\
**Tags:** segmentation, vmtk, centerlines\
**Created:** [October 4, 2022, 3:56pm UTC](https://discourse.slicer.org/t/extract-centerline-fails-when-calculating-the-centerline-with-tree-window/25546 "2022-10-04T15:56:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dalbenzioG](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/dalbenziog/32/16834_2.png) [@dalbenzioG](https://discourse.slicer.org/u/dalbenzioG)\
**Post date:** [October 4, 2022, 3:56pm UTC](https://discourse.slicer.org/t/extract-centerline-fails-when-calculating-the-centerline-with-tree-window/25546/1 "2022-10-04T15:56:46Z")

</div>

Hello,

I am encountering the following error while computing the Centerline Model (from window tab _Tree_) from a segmentation node:  
**Warning: In /home/davagh/built/Slicer-build041022/VTK/Filters/Core/vtkDelaunay3D.cxx, line 518**  
**vtkDelaunay3D (0x55ecfe6ff650): 241 degenerate triangles encountered, mesh quality suspect**  
**Error while constructing cell map: Invalid cell size for polys.**

The following are few tests I made for trying to find a possible solution:

- If no smoothing is applied to the segmentation, I am able to generate the below Centerline Network using the _Auto-Detect_ option for detecting the end points:  

- If no smoothing is applied to the segmentation, I am able to generate the below Centerline Network using the 4 displayed control points:  

- If 0.3 smoothing is applied (from Segment Editor), I am able to generate the green Centerline Model (from window tab _Tree_) using the same 4 control points:  

It seems that smoothing the surface could work around this problem. However, there are few cases where a smoothing is not the preferred choice for surgeons (like in this case).  
I am wondering: which factor could define a _“good enough”_ smoothing, in order not to fail the extractCenterline method?

I appreciate if you could provide any feedback on this or even point out a vmtk link/documentation that could help me to better understand the problem. 😄

**OS: Ubuntu 22.04.1 LTS  
Graphics: NVIDIA [GeForce RTX 3090]**
