Slicer
5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
Modules
Loadable
Segmentations
EditorEffects
Python
SegmentEditorEffects
AbstractScriptedSegmentEditorLabelEffect.py
Go to the documentation of this file.
1
from
.AbstractScriptedSegmentEditorEffect
import
*
2
3
__all__ = [
"AbstractScriptedSegmentEditorLabelEffect"
]
4
5
6
class
AbstractScriptedSegmentEditorLabelEffect
(
AbstractScriptedSegmentEditorEffect
):
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)
SegmentEditorEffects.AbstractScriptedSegmentEditorEffect.AbstractScriptedSegmentEditorEffect
Definition
AbstractScriptedSegmentEditorEffect.py:6
SegmentEditorEffects.AbstractScriptedSegmentEditorLabelEffect.AbstractScriptedSegmentEditorLabelEffect
Definition
AbstractScriptedSegmentEditorLabelEffect.py:6
SegmentEditorEffects.AbstractScriptedSegmentEditorLabelEffect.AbstractScriptedSegmentEditorLabelEffect.__init__
__init__(self, scriptedEffect)
Definition
AbstractScriptedSegmentEditorLabelEffect.py:47
Generated on Wed Sep 3 2025 23:51:42 for Slicer by
1.13.0