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
qSlicerSegmentEditorScriptedPaintEffect.h
Go to the documentation of this file.
1/*==============================================================================
2
3 Program: 3D Slicer
4
5 Copyright (c) Laboratory for Percutaneous Surgery (PerkLab)
6 Queen's University, Kingston, ON, Canada. All Rights Reserved.
7
8 See COPYRIGHT.txt
9 or http://www.slicer.org/copyright/copyright.txt for details.
10
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16
17 This file was originally developed by Csaba Pinter, PerkLab, Queen's University
18 and was supported through the Applied Cancer Research Unit program of Cancer Care
19 Ontario with funds provided by the Ontario Ministry of Health and Long-Term Care
20
21==============================================================================*/
22
23#ifndef __qSlicerSegmentEditorScriptedPaintEffect_h
24#define __qSlicerSegmentEditorScriptedPaintEffect_h
25
26// Segmentations Editor Effects includes
28
29#include "qSlicerSegmentationsEditorEffectsExport.h"
30
31// Forward Declare PyObject*
32#ifndef PyObject_HEAD
33struct _object;
34typedef _object PyObject;
35#endif
36class qSlicerSegmentEditorScriptedPaintEffectPrivate;
37
48class Q_SLICER_SEGMENTATIONS_EFFECTS_EXPORT qSlicerSegmentEditorScriptedPaintEffect
50{
51 Q_OBJECT
52
53public:
55 qSlicerSegmentEditorScriptedPaintEffect(QObject* parent = nullptr);
57
58 Q_INVOKABLE QString pythonSource()const;
59
62 Q_INVOKABLE bool setPythonSource(const QString filePath);
63
65 Q_INVOKABLE PyObject* self() const;
66
69 void setName(QString name) override;
70
71// API: Methods that are to be reimplemented in the effect subclasses
72public:
74 QIcon icon() override;
75
77 const QString helpText()const override;
78
81
83 void activate() override;
84
86 void deactivate() override;
87
89 void setupOptionsFrame() override;
90
92 QCursor createCursor(qMRMLWidget* viewWidget) override;
93
95 void paintApply(qMRMLWidget* viewWidget) override;
96
98 void setMRMLDefaults() override;
99
103 void sourceVolumeNodeChanged() override;
105 void masterVolumeNodeChanged() override;
107 void layoutChanged() override;
108
109public slots:
111 void updateGUIFromMRML() override;
112
114 void updateMRMLFromGUI() override;
115
116protected:
117 QScopedPointer<qSlicerSegmentEditorScriptedPaintEffectPrivate> d_ptr;
118
119private:
122};
123
124#endif
Base class for any widget that requires a MRML Scene.
Definition qMRMLWidget.h:36
qSlicerSegmentEditorAbstractEffect(QObject *parent=nullptr)
qSlicerSegmentEditorPaintEffect(QObject *parent=nullptr)
Q_INVOKABLE PyObject * self() const
Convenience method allowing to retrieve the associated scripted instance.
void setupOptionsFrame() override
Create options frame widgets, make connections, and add them to the main options frame using.
Q_INVOKABLE bool setPythonSource(const QString filePath)
QIcon icon() override
Get icon for effect to be displayed in segment editor.
void sourceVolumeNodeChanged() override
Simple mechanism to let the effects know that source volume has changed.
void paintApply(qMRMLWidget *viewWidget) override
Paint labelmap.
Q_INVOKABLE QString pythonSource() const
void layoutChanged() override
Simple mechanism to let the effects know that the layout has changed.
void updateGUIFromMRML() override
Update user interface from parameter set node.
void setMRMLDefaults() override
Set default parameters in the parameter MRML node.
qSlicerSegmentEditorAbstractEffect * clone() override
Clone editor effect. Override to return a new instance of the effect sub-class.
void masterVolumeNodeChanged() override
Deprecated. Use sourceVolumeNodeChanged() method instead.
qSlicerSegmentEditorScriptedPaintEffect(QObject *parent=nullptr)
void referenceGeometryChanged() override
Simple mechanism to let the effects know that reference geometry change has changed.
void updateMRMLFromGUI() override
Update parameter set node from user interface.
void setName(QString name) override
const QString helpText() const override
Get help text for effect to be displayed in the help box.
QCursor createCursor(qMRMLWidget *viewWidget) override
Create a cursor customized for the given effect, potentially for each view.
void activate() override
Perform actions to activate the effect (show options frame, etc.)
QScopedPointer< qSlicerSegmentEditorScriptedPaintEffectPrivate > d_ptr
void deactivate() override
Perform actions to deactivate the effect (hide options frame, destroy actors, etc....
_object PyObject