From 995027f17f195d802134f799aab095ea31f3e6c5 Mon Sep 17 00:00:00 2001 From: SET Date: Mon, 12 Jul 2021 20:36:50 +0200 Subject: [PATCH] BUG: Fix ExtractCenterline with VTK9 Voronoi smoothing must be disabled for now. https://github.com/vmtk/SlicerExtension-VMTK/issues/34 https://discourse.slicer.org/t/vmtk-extract-centerline-fails-with-vmtk-using-vtk9/ Co-authored-by: SET --- ExtractCenterline/ExtractCenterline.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ExtractCenterline/ExtractCenterline.py b/ExtractCenterline/ExtractCenterline.py index 87314d1..6d688a6 100644 --- a/ExtractCenterline/ExtractCenterline.py +++ b/ExtractCenterline/ExtractCenterline.py @@ -702,7 +702,13 @@ def extractCenterline(self, surfacePolyData, endPointsMarkupsNode, curveSampling centerlineFilter.SetCostFunction('1/R') # this makes path search prefer go through points with large radius centerlineFilter.SetFlipNormals(False) centerlineFilter.SetAppendEndPointsToCenterlines(0) - centerlineFilter.SetSimplifyVoronoi(1) # this slightly improves connectivity + + # Voronoi smoothing slightly improves connectivity + # Unfortunately, Voronoi smoothing is broken if VMTK is used with VTK9, therefore + # disable this feature for now (https://github.com/vmtk/SlicerExtension-VMTK/issues/34) + enableVoronoiSmoothing = (slicer.app.majorVersion * 100 + slicer.app.minorVersion < 413) + centerlineFilter.SetSimplifyVoronoi(enableVoronoiSmoothing) + centerlineFilter.SetCenterlineResampling(0) centerlineFilter.SetResamplingStepLength(curveSamplingDistance) centerlineFilter.Update()