Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
AbstractScriptedSegmentEditorPaintEffect.py
Go to the documentation of this file.
1from .AbstractScriptedSegmentEditorEffect import *
2
3__all__ = ["AbstractScriptedSegmentEditorPaintEffect"]
4
5
7 """Abstract scripted segment editor Paint effects for effects implemented in python
8
9 Paint effects are a subtype of general effects that operate on a subregion of the segment
10 defined by brush strokes.
11
12 An example of paint effect is ``SmoothingEffect``.
13
14 To use the effect, follow these steps:
15
16 1. Instantiation and registration
17
18 Instantiate segment editor paint effect adaptor class from
19 module (e.g. from setup function), and set python source::
20
21 import qSlicerSegmentationsEditorEffectsPythonQt as effects
22 scriptedEffect = effects.qSlicerSegmentEditorScriptedPaintEffect(None)
23 scriptedEffect.setPythonSource(MyPaintEffect.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 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 ``qSlicerSegmentEditorScriptedPaintEffect``) 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)