Skip to content

Commit

Permalink
ENH: Improve fill between slices
Browse files Browse the repository at this point in the history
Note: if image spacing is highly anisotropic then fill between slices is still not working optimally.
  • Loading branch information
lassoan committed May 9, 2024
1 parent 45ce268 commit 906a60d
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ def computePreviewLabelmap(self, mergedImage, outputLabelmap):

interpolator = vtkITK.vtkITKMorphologicalContourInterpolator()
interpolator.SetInputData(mergedImage)

# When interpolating between slices that are very far from each other,
# the boundary of the segments become rectangular. When using distance transform
# the intersections are more circular.
# https://discourse.slicer.org/t/question-on-fill-between-slices-algorithm/34536
interpolator.SetUseDistanceTransform(True)

interpolator.Update()
outputLabelmap.DeepCopy(interpolator.GetOutput())
imageToWorld = vtk.vtkMatrix4x4()
Expand Down

0 comments on commit 906a60d

Please sign in to comment.