Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
AbstractScriptedSegmentEditorLabelEffect.py
Go to the documentation of this file.
1from .AbstractScriptedSegmentEditorEffect import *
2
3__all__ = ["AbstractScriptedSegmentEditorLabelEffect"]
4
5
7 """Abstract scripted segment editor label effects for effects implemented in python.
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 An example of label effect is ``DrawEffect``.
13
14 To use the effect, follow these steps:
15
16 1. Instantiation and registration
17
18 Instantiate segment editor label effect adaptor class from
19 module (e.g. from setup function), and set python source::
20
21 import qSlicerSegmentationsEditorEffectsPythonQt as effects
22 scriptedEffect = effects.qSlicerSegmentEditorScriptedLabelEffect(None)
23 scriptedEffect.setPythonSource(MyLabelEffect.filePath)
24
25 Registration is automatic
26
27 2. Call host C++ implementation using::
28
29 self.scriptedEffect.functionName()
30
31 2.a. Most frequently used such methods are:
32
33 * Parameter get/set: ``parameter``, ``integerParameter``, ``doubleParameter``, ``setParameter``
34 * Add options widget: ``addOptionsWidget``
35 * Coordinate transforms: ``rasToXy``, ``xyzToRas``, ``xyToRas``, ``xyzToIjk``, ``xyToIjk``
36 * Convenience getters: ``renderWindow``, ``renderer``, ``viewNode``
37 * Geometry getters: ``imageToWorldMatrix`` (for volume node and for oriented image data with segmentation)
38
39 2.b. Always call API functions (the ones that are defined in the adaptor \
40 class ``qSlicerSegmentEditorScriptedLabelEffect``) using the adaptor accessor ``self.scriptedEffect``.
41
42 For example::
43
44 self.scriptedEffect.updateGUIFromMRML()
45 """
46
47 def __init__(self, scriptedEffect):
48 AbstractScriptedSegmentEditorEffect.__init__(self, scriptedEffect)