Slicer  4.13
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
List of all members | Public Member Functions | Public Attributes
AbstractScriptedSegmentEditorEffect.AbstractScriptedSegmentEditorEffect Class Reference
Inheritance diagram for AbstractScriptedSegmentEditorEffect.AbstractScriptedSegmentEditorEffect:
Inheritance graph
Collaboration diagram for AbstractScriptedSegmentEditorEffect.AbstractScriptedSegmentEditorEffect:
Collaboration graph

Public Member Functions

def __init__ (self, scriptedEffect)
def rasToXy (self, ras, viewWidget)
def register (self)
def setWidgetMinMaxStepFromImageSpacing (self, spinbox, imageData)
def xyToIjk (self, xy, viewWidget, image, parentTransformNode=None)
def xyToRas (self, xy, viewWidget)
def xyzToIjk (self, xyz, viewWidget, image, parentTransformNode=None)
def xyzToRas (self, xyz, viewWidget)

Public Attributes


Detailed Description

Abstract scripted segment editor effects for effects implemented in python

    1. Instantiation and registration
      Instantiate segment editor effect adaptor class from
      module (e.g. from setup function), and set python source:
      > import qSlicerSegmentationsEditorEffectsPythonQt as effects
      > scriptedEffect = effects.qSlicerSegmentEditorScriptedEffect(None)
      > scriptedEffect.setPythonSource(MyEffect.filePath)
      > scriptedEffect.self().register()
      If effect name is added to slicer.modules.segmenteditorscriptedeffectnames
      list then the above instantiation and registration steps are not necessary,
      as the SegmentEditor module do all these.

    2. Call host C++ implementation using
      > self.scriptedEffect.functionName()

    2.a. Most frequently used such methods are:
      Parameter get/set: parameter, integerParameter, doubleParameter, setParameter
      Add options widget: addOptionsWidget
      Coordinate transforms: rasToXy, xyzToRas, xyToRas, xyzToIjk, xyToIjk
      Convenience getters: renderWindow, renderer, viewNode

    2.b. Always call API functions (the ones that are defined in the adaptor
      class qSlicerSegmentEditorScriptedEffect) using the adaptor accessor:
      > self.scriptedEffect.updateGUIFromMRML()

    3. To prevent deactivation of an effect by clicking place fiducial toolbar button,
       override interactionNodeModified(self, interactionNode)

    An example for a generic effect is the ThresholdEffect

Definition at line 8 of file

Constructor & Destructor Documentation

◆ __init__()

def AbstractScriptedSegmentEditorEffect.AbstractScriptedSegmentEditorEffect.__init__ (   self,

Definition at line 43 of file

Member Function Documentation

◆ rasToXy()

def AbstractScriptedSegmentEditorEffect.AbstractScriptedSegmentEditorEffect.rasToXy (   self,

Definition at line 56 of file

◆ register()

def AbstractScriptedSegmentEditorEffect.AbstractScriptedSegmentEditorEffect.register (   self)

Definition at line 46 of file

◆ setWidgetMinMaxStepFromImageSpacing()

def AbstractScriptedSegmentEditorEffect.AbstractScriptedSegmentEditorEffect.setWidgetMinMaxStepFromImageSpacing (   self,

Definition at line 83 of file

◆ xyToIjk()

def AbstractScriptedSegmentEditorEffect.AbstractScriptedSegmentEditorEffect.xyToIjk (   self,
  parentTransformNode = None 

Definition at line 77 of file

◆ xyToRas()

def AbstractScriptedSegmentEditorEffect.AbstractScriptedSegmentEditorEffect.xyToRas (   self,

Definition at line 66 of file

◆ xyzToIjk()

def AbstractScriptedSegmentEditorEffect.AbstractScriptedSegmentEditorEffect.xyzToIjk (   self,
  parentTransformNode = None 

Definition at line 71 of file

◆ xyzToRas()

def AbstractScriptedSegmentEditorEffect.AbstractScriptedSegmentEditorEffect.xyzToRas (   self,

Definition at line 61 of file

Member Data Documentation

◆ scriptedEffect


Definition at line 44 of file

The documentation for this class was generated from the following file: