Slicer  5.1
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
AbstractScriptedSegmentEditorLabelEffect.py
Go to the documentation of this file.
1 from .AbstractScriptedSegmentEditorEffect import *
2 
3 __all__ = ['AbstractScriptedSegmentEditorLabelEffect']
4 
5 
6 #
7 # Abstract class of python scripted segment editor label effects
8 #
9 # Label effects are a subtype of general effects that edit the currently selected
10 # segment (i.e. for things like paint or draw, but not for things like threshold)
11 #
12 
14  """ Abstract scripted segment editor label effects for effects implemented in python
15 
16  USAGE:
17  1. Instantiation and registration
18  Instantiate segment editor label effect adaptor class from
19  module (e.g. from setup function), and set python source:
20  > import qSlicerSegmentationsEditorEffectsPythonQt as effects
21  > scriptedEffect = effects.qSlicerSegmentEditorScriptedLabelEffect(None)
22  > scriptedEffect.setPythonSource(MyLabelEffect.filePath)
23  Registration is automatic
24 
25  2. Call host C++ implementation using
26  > self.scriptedEffect.functionName()
27 
28  2.a. Most frequently used such methods are:
29  Parameter get/set: parameter, integerParameter, doubleParameter, setParameter
30  Add options widget: addOptionsWidget
31  Coordinate transforms: rasToXy, xyzToRas, xyToRas, xyzToIjk, xyToIjk
32  Convenience getters: renderWindow, renderer, viewNode
33  Geometry getters: imageToWorldMatrix (for volume node and for oriented image data with segmentation)
34 
35  2.b. Always call API functions (the ones that are defined in the adaptor
36  class qSlicerSegmentEditorScriptedLabelEffect) using the adaptor accessor:
37  > self.scriptedEffect.updateGUIFromMRML()
38 
39  An example for a generic effect is the DrawEffect
40 
41  """
42 
43  def __init__(self, scriptedEffect):
44  AbstractScriptedSegmentEditorEffect.__init__(self, scriptedEffect)