Scissors segment editor effects from a script

You can print all Segment Editor effect parameter names by typing this into the Python console:

print(slicer.mrmlScene.GetFirstNodeByClass("vtkMRMLSegmentEditorNode"))

You should get something like this:

vtkMRMLSegmentEditorNode (000001867E52D360)
  ID: vtkMRMLSegmentEditorNodeSegmentEditor
  ClassName: vtkMRMLSegmentEditorNode
  Name: SegmentEditor
  Debug: false
  MTime: 1527281
  Description: (none)
  SingletonTag: SegmentEditor
  HideFromEditors: true
  Selectable: true
  Selected: false
  UndoEnabled: false
  Attributes:
    BrushAbsoluteDiameter:25
    BrushAbsoluteMaximumDiameter:128
    BrushAbsoluteMinimumDiameter:0.5
    BrushDiameterIsRelative:1
    BrushMaximumAbsoluteDiameter:100
    BrushMinimumAbsoluteDiameter:0.01
    BrushPixelMode:0
    BrushRelativeDiameter:3
    BrushSphere:0
    EditIn3DViews:0
    Erase.ColorSmudge:0
    Erase.EraseAllSegments:0
    Fill between slices.AutoUpdate:1
    Grow from seeds.AutoUpdate:1
    Hollow.ShellMode:INSIDE_SURFACE
    Hollow.ShellThicknessMm:3
    Islands.MinimumSize:1000
    Islands.Operation:KEEP_LARGEST_ISLAND
    Logical operators.BypassMasking:1
    Logical operators.Operation:COPY
    Margin.MarginSizeMm:3
    Paint.ColorSmudge:0
    Paint.EraseAllSegments:0
    Scissors.Operation:EraseInside
    Scissors.Shape:FreeForm
    Scissors.SliceCutDepthMm:0
    Scissors.SliceCutMode:Unlimited
    Smoothing.GaussianStandardDeviationMm:3
    Smoothing.JointTaubinSmoothingFactor:0.5
    Smoothing.KernelSizeMm:3
    Smoothing.SmoothingMethod:MEDIAN
    Threshold.AutoThresholdMethod:OTSU
    Threshold.AutoThresholdMode:SET_LOWER_MAX
    Threshold.MaximumThreshold:279
    Threshold.MinimumThreshold:69.75
  Node references:
    masterVolumeRef: vtkMRMLScalarVolumeNode5
    segmentationRef: vtkMRMLSegmentationNode1
  SelectedSegmentID: Segment_1
  ActiveEffectName: 
  MaskMode: PaintAllowedEverywhere
  MaskSegmentID: 
  OverwriteMode: OverwriteAllSegments
  MasterVolumeIntensityMask: false
  MasterVolumeIntensityMaskRange: 0 0

You can find valid parameter values by looking at the source code of the effects (e.g., search for the parameter name in entire Slicer core or SegmentEditorExtraEffects extension source code).

3 Likes