Slicer 5.4
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
qSlicerSimpleMarkupsWidget.h
Go to the documentation of this file.
1/*==============================================================================
2
3 Copyright (c) Laboratory for Percutaneous Surgery (PerkLab)
4 Queen's University, Kingston, ON, Canada. All Rights Reserved.
5
6 See COPYRIGHT.txt
7 or http://www.slicer.org/copyright/copyright.txt for details.
8
9 Unless required by applicable law or agreed to in writing, software
10 distributed under the License is distributed on an "AS IS" BASIS,
11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 See the License for the specific language governing permissions and
13 limitations under the License.
14
15 This file was originally developed by Matthew Holden, PerkLab, Queen's University
16 and was supported through the Applied Cancer Research Unit program of Cancer Care
17 Ontario with funds provided by the Ontario Ministry of Health and Long-Term Care
18
19==============================================================================*/
20
21#ifndef __qSlicerSimpleMarkupsWidget_h
22#define __qSlicerSimpleMarkupsWidget_h
23
24// Qt includes
25#include "qSlicerWidget.h"
26
27#include "qMRMLUtils.h"
28
29// Markups Widgets includes
30#include "qSlicerMarkupsModuleWidgetsExport.h"
31
32class qSlicerSimpleMarkupsWidgetPrivate;
34class QTableWidget;
37
39class Q_SLICER_MODULE_MARKUPS_WIDGETS_EXPORT
41{
42 Q_OBJECT
43 Q_PROPERTY(bool enterPlaceModeOnNodeChange READ enterPlaceModeOnNodeChange WRITE setEnterPlaceModeOnNodeChange)
44 Q_PROPERTY(bool jumpToSliceEnabled READ jumpToSliceEnabled WRITE setJumpToSliceEnabled)
45 Q_PROPERTY(bool nodeSelectorVisible READ nodeSelectorVisible WRITE setNodeSelectorVisible)
46 Q_PROPERTY(bool optionsVisible READ optionsVisible WRITE setOptionsVisible)
47 Q_PROPERTY(QColor nodeColor READ nodeColor WRITE setNodeColor)
48 Q_PROPERTY(QColor defaultNodeColor READ defaultNodeColor WRITE setDefaultNodeColor)
49 Q_PROPERTY(int viewGroup READ viewGroup WRITE setViewGroup)
50
51public:
53 qSlicerSimpleMarkupsWidget(QWidget *parent=nullptr);
55
57 Q_INVOKABLE vtkMRMLNode* currentNode() const;
58
60 Q_INVOKABLE vtkMRMLNode* getCurrentNode();
61
64 Q_INVOKABLE vtkMRMLInteractionNode* interactionNode()const;
65
67 Q_INVOKABLE QTableWidget* tableWidget() const;
68
70 Q_INVOKABLE qSlicerMarkupsPlaceWidget* markupsPlaceWidget() const;
71
73 Q_INVOKABLE qMRMLNodeComboBox* markupsSelectorComboBox() const;
74
76 bool enterPlaceModeOnNodeChange() const;
77
80 bool jumpToSliceEnabled() const;
81
83 bool nodeSelectorVisible() const;
84
86 bool optionsVisible() const;
87
89 QColor nodeColor() const;
90
92 QColor defaultNodeColor() const;
93
96 void setViewGroup(int newViewGroup);
97
99 int viewGroup()const;
100
101public slots:
102
103 void setMRMLScene(vtkMRMLScene* scene) override;
104
106 void setCurrentNode(vtkMRMLNode* currentNode);
107
109 void setNodeBaseName(const QString& newNodeBaseName);
110
113 void setInteractionNode(vtkMRMLInteractionNode* interactionNode);
114
116 void setEnterPlaceModeOnNodeChange(bool);
117
119 void setJumpToSliceEnabled(bool);
120
122 void setNodeSelectorVisible(bool);
123
125 void setOptionsVisible(bool);
126
128 void setNodeColor(QColor color);
129
131 void setDefaultNodeColor(QColor color);
132
134 void highlightNthControlPoint(int n);
135
137 void highlightNthFiducial(int n);
138
140 void activate();
141
143 void placeActive(bool place);
144
145protected slots:
146
148 void onMarkupsNodeChanged();
150 void onMarkupsNodeAdded(vtkMRMLNode*);
152 void onMarkupsControlPointsTableContextMenu(const QPoint& position);
153
155 void onMarkupsControlPointEdited(int row, int column);
156
158 void onMarkupsControlPointSelected(int row, int column);
159
161 void updateWidget();
162
164 void onPointAdded();
165
166signals:
167
169 void markupsNodeChanged();
170
172 void markupsFiducialNodeChanged();
173
176 void currentMarkupsControlPointSelectionChanged(int markupIndex);
177
179 void currentMarkupsFiducialSelectionChanged(int markupIndex);
180
184 void activeMarkupsPlaceModeChanged(bool enabled);
185
187 void activeMarkupsFiducialPlaceModeChanged(bool enabled);
188
191 void updateFinished();
192
193protected:
194 QScopedPointer<qSlicerSimpleMarkupsWidgetPrivate> d_ptr;
195
196 virtual void setup();
197
198private:
199 Q_DECLARE_PRIVATE(qSlicerSimpleMarkupsWidget);
200 Q_DISABLE_COPY(qSlicerSimpleMarkupsWidget);
201
202};
203
204#endif
Combobox that automatically displays all the nodes of the scene that match filtering criteria.
Abstract Superclass for all specific types of MRML nodes.
A set of MRML Nodes that supports serialization and undo/redo.