2 import vtk, qt, ctk, slicer
4 from SegmentEditorEffects
import *
7 """ AutoCompleteEffect is an effect that can create a full segmentation 8 from a partial segmentation (not all slices are segmented or only 9 part of the target structures are painted). 13 AbstractScriptedSegmentEditorAutoCompleteEffect.__init__(self, scriptedEffect)
14 scriptedEffect.name =
'Fill between slices' 17 import qSlicerSegmentationsEditorEffectsPythonQt
as effects
18 clonedEffect = effects.qSlicerSegmentEditorScriptedEffect(
None)
19 clonedEffect.setPythonSource(__file__.replace(
'\\',
'/'))
23 iconPath = os.path.join(os.path.dirname(__file__),
'Resources/Icons/FillBetweenSlices.png')
24 if os.path.exists(iconPath):
25 return qt.QIcon(iconPath)
29 return """<html>Interpolate segmentation between slices<br>. Instructions: 31 <li>Create complete segmentation on selected slices using any editor effect. 32 Segmentation will only expanded if a slice is segmented but none of the direct neighbors are segmented, therefore 33 do not use sphere brush with Paint effect and always leave at least one empty slice between segmented slices.</li> 34 <li>All visible segments will be interpolated, not just the selected segment.</li> 35 <li>The complete segmentation will be created by interpolating segmentations in empty slices.</li> 37 Masking settings are ignored. If segments overlap, segment higher in the segments table will have priority. 38 The effect uses <a href="http://insight-journal.org/browse/publication/977">morphological contour interpolation method</a>. 43 interpolator = vtkITK.vtkITKMorphologicalContourInterpolator()
44 interpolator.SetInputData(mergedImage)
46 outputLabelmap.DeepCopy(interpolator.GetOutput())
def computePreviewLabelmap(self, mergedImage, outputLabelmap)
def __init__(self, scriptedEffect)