Skip to content

Commit 995027f

Browse files
chir-setlassoan
authored andcommitted
BUG: Fix ExtractCenterline with VTK9
Voronoi smoothing must be disabled for now. #34 https://discourse.slicer.org/t/vmtk-extract-centerline-fails-with-vmtk-using-vtk9/ Co-authored-by: SET <[email protected]>
1 parent 46785f4 commit 995027f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ExtractCenterline/ExtractCenterline.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,13 @@ def extractCenterline(self, surfacePolyData, endPointsMarkupsNode, curveSampling
702702
centerlineFilter.SetCostFunction('1/R') # this makes path search prefer go through points with large radius
703703
centerlineFilter.SetFlipNormals(False)
704704
centerlineFilter.SetAppendEndPointsToCenterlines(0)
705-
centerlineFilter.SetSimplifyVoronoi(1) # this slightly improves connectivity
705+
706+
# Voronoi smoothing slightly improves connectivity
707+
# Unfortunately, Voronoi smoothing is broken if VMTK is used with VTK9, therefore
708+
# disable this feature for now (https://github.com/vmtk/SlicerExtension-VMTK/issues/34)
709+
enableVoronoiSmoothing = (slicer.app.majorVersion * 100 + slicer.app.minorVersion < 413)
710+
centerlineFilter.SetSimplifyVoronoi(enableVoronoiSmoothing)
711+
706712
centerlineFilter.SetCenterlineResampling(0)
707713
centerlineFilter.SetResamplingStepLength(curveSamplingDistance)
708714
centerlineFilter.Update()

0 commit comments

Comments
 (0)