Skip to content

Commit

Permalink
BUG: Fix fillValue in Split Volume effect
Browse files Browse the repository at this point in the history
  • Loading branch information
lassoan committed Aug 30, 2020
1 parent 4052fa3 commit daa70d7
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ def onApply(self):
volumesLogic = slicer.modules.volumes.logic()
scene = inputVolume.GetScene()
padExtent = [-self.padEdit.value, self.padEdit.value, -self.padEdit.value, self.padEdit.value, -self.padEdit.value, self.padEdit.value]
fillValue = self.fillValueEdit.value

# Create a new folder in subject hierarchy where all the generated volumes will be placed into
shNode = slicer.vtkMRMLSubjectHierarchyNode.GetSubjectHierarchyNode(slicer.mrmlScene)
Expand All @@ -152,7 +153,7 @@ def onApply(self):

# Crop segment
maskExtent = [0] * 6
SegmentEditorMaskVolumeLib.SegmentEditorEffect.maskVolumeWithSegment(segmentationNode, segmentID, "FILL_OUTSIDE", [0], inputVolume, outputVolume, maskExtent)
SegmentEditorMaskVolumeLib.SegmentEditorEffect.maskVolumeWithSegment(segmentationNode, segmentID, "FILL_OUTSIDE", [fillValue], inputVolume, outputVolume, maskExtent)

# Calculate padded extent of segment
extent = [0] * 6
Expand All @@ -168,7 +169,7 @@ def onApply(self):
# Pad and crop
padFilter = vtk.vtkImageConstantPad()
padFilter.SetInputData(outputVolume.GetImageData())
padFilter.SetConstant(self.fillValueEdit.value)
padFilter.SetConstant(fillValue)
padFilter.SetOutputWholeExtent(extent)
padFilter.Update()
paddedImg = padFilter.GetOutput()
Expand Down

0 comments on commit daa70d7

Please sign in to comment.