Slicer  5.2
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qSlicerSegmentEditorScriptedLabelEffect.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 __qSlicerSegmentEditorScriptedLabelEffect_h
24 #define __qSlicerSegmentEditorScriptedLabelEffect_h
25 
26 // Segmentations Editor Effects includes
28 
29 #include "qSlicerSegmentationsEditorEffectsExport.h"
30 
31 // Forward Declare PyObject*
32 #ifndef PyObject_HEAD
33 struct _object;
34 typedef _object PyObject;
35 #endif
36 class qSlicerSegmentEditorScriptedLabelEffectPrivate;
37 
48 class Q_SLICER_SEGMENTATIONS_EFFECTS_EXPORT qSlicerSegmentEditorScriptedLabelEffect
50 {
51  Q_OBJECT
52 
53 public:
55  qSlicerSegmentEditorScriptedLabelEffect(QObject* parent = nullptr);
57 
58  Q_INVOKABLE QString pythonSource()const;
59 
62  Q_INVOKABLE bool setPythonSource(const QString newPythonSource);
63 
65  Q_INVOKABLE PyObject* self() const;
66 
69  void setName(QString name) override;
70 
72  void setPerSegment(bool perSegment) override;
73 
74 // API: Methods that are to be reimplemented in the effect subclasses
75 public:
77  QIcon icon() override;
78 
80  const QString helpText()const override;
81 
84 
86  void activate() override;
87 
89  void deactivate() override;
90 
92  void setupOptionsFrame() override;
93 
95  QCursor createCursor(qMRMLWidget* viewWidget) override;
96 
101  bool processInteractionEvents(vtkRenderWindowInteractor* callerInteractor, unsigned long eid, qMRMLWidget* viewWidget) override;
102 
107  void processViewNodeEvents(vtkMRMLAbstractViewNode* callerViewNode, unsigned long eid, qMRMLWidget* viewWidget) override;
108 
110  void setMRMLDefaults() override;
111 
113  void referenceGeometryChanged() override;
115  void sourceVolumeNodeChanged() override;
117  void masterVolumeNodeChanged() override;
119  void layoutChanged() override;
121  void interactionNodeModified(vtkMRMLInteractionNode* interactionNode) override;
122 
123 public slots:
125  void updateGUIFromMRML() override;
126 
128  void updateMRMLFromGUI() override;
129 
130 protected:
131  QScopedPointer<qSlicerSegmentEditorScriptedLabelEffectPrivate> d_ptr;
132 
133 private:
134  Q_DECLARE_PRIVATE(qSlicerSegmentEditorScriptedLabelEffect);
136 };
137 
138 #endif
qSlicerSegmentEditorAbstractEffect * clone() override=0
virtual void interactionNodeModified(vtkMRMLInteractionNode *interactionNode)
virtual bool processInteractionEvents(vtkRenderWindowInteractor *callerInteractor, unsigned long eid, qMRMLWidget *viewWidget)
virtual Q_INVOKABLE const QString helpText() const
Get help text for effect to be displayed in the help box.
Abstract class for segment editor effects.
virtual void masterVolumeNodeChanged()
Deprecated. Override sourceVolumeNodeChanged() method instead.
void updateMRMLFromGUI() override
Update parameter set node from user interface.
void referenceGeometryChanged() override
Perform actions needed on reference geometry change.
virtual Q_INVOKABLE void deactivate()
Abstract MRML node to represent a view. The class holds the properties common to any view type (3D...
virtual QCursor createCursor(qMRMLWidget *viewWidget)
Create a cursor customized for the given effect, potentially for each view.
Base class for any widget that requires a MRML Scene.
Definition: qMRMLWidget.h:35
void sourceVolumeNodeChanged() override
Perform actions needed on source volume change.
Scripted abstract effect for implementing label effects in python.
QScopedPointer< qSlicerSegmentEditorScriptedLabelEffectPrivate > d_ptr
virtual void setPerSegment(bool perSegment)
void setupOptionsFrame() override
Create options frame widgets, make connections, and add them to the main options frame using...
virtual void processViewNodeEvents(vtkMRMLAbstractViewNode *callerViewNode, unsigned long eid, qMRMLWidget *viewWidget)
void setMRMLDefaults() override
Set default parameters in the parameter MRML node.
virtual QIcon icon()
Get icon for effect to be displayed in segment editor.
virtual void setName(QString name)
virtual void layoutChanged()
Simple mechanism to let the effects know that the layout has changed.
_object PyObject
virtual Q_INVOKABLE void activate()
void updateGUIFromMRML() override
Update user interface from parameter set node.