Skip to content

Commit

Permalink
BUG: Fix ExtractCenterline with VTK9
Browse files Browse the repository at this point in the history
  • Loading branch information
chir-set authored and lassoan committed Jul 12, 2021
1 parent 46785f4 commit 995027f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ExtractCenterline/ExtractCenterline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 995027f

Please sign in to comment.