Slicer 5.8
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
38class Q_SLICER_MODULE_MARKUPS_WIDGETS_EXPORT
40{
41 Q_OBJECT
42 Q_PROPERTY(bool enterPlaceModeOnNodeChange READ enterPlaceModeOnNodeChange WRITE setEnterPlaceModeOnNodeChange)
43 Q_PROPERTY(bool jumpToSliceEnabled READ jumpToSliceEnabled WRITE setJumpToSliceEnabled)
44 Q_PROPERTY(bool nodeSelectorVisible READ nodeSelectorVisible WRITE setNodeSelectorVisible)
45 Q_PROPERTY(bool optionsVisible READ optionsVisible WRITE setOptionsVisible)
46 Q_PROPERTY(QColor nodeColor READ nodeColor WRITE setNodeColor)
47 Q_PROPERTY(QColor defaultNodeColor READ defaultNodeColor WRITE setDefaultNodeColor)
48 Q_PROPERTY(int viewGroup READ viewGroup WRITE setViewGroup)
49
50public:
52 qSlicerSimpleMarkupsWidget(QWidget *parent=nullptr);
54
56 Q_INVOKABLE vtkMRMLNode* currentNode() const;
57
59 Q_INVOKABLE vtkMRMLNode* getCurrentNode();
60
63 Q_INVOKABLE vtkMRMLInteractionNode* interactionNode()const;
64
66 Q_INVOKABLE QTableWidget* tableWidget() const;
67
69 Q_INVOKABLE qSlicerMarkupsPlaceWidget* markupsPlaceWidget() const;
70
72 Q_INVOKABLE qMRMLNodeComboBox* markupsSelectorComboBox() const;
73
75 bool enterPlaceModeOnNodeChange() const;
76
79 bool jumpToSliceEnabled() const;
80
82 bool nodeSelectorVisible() const;
83
85 bool optionsVisible() const;
86
88 QColor nodeColor() const;
89
91 QColor defaultNodeColor() const;
92
95 void setViewGroup(int newViewGroup);
96
98 int viewGroup()const;
99
100public slots:
101
102 void setMRMLScene(vtkMRMLScene* scene) override;
103
105 void setCurrentNode(vtkMRMLNode* currentNode);
106
108 void setNodeBaseName(const QString& newNodeBaseName);
109
112 void setInteractionNode(vtkMRMLInteractionNode* interactionNode);
113
115 void setEnterPlaceModeOnNodeChange(bool);
116
118 void setJumpToSliceEnabled(bool);
119
121 void setNodeSelectorVisible(bool);
122
124 void setOptionsVisible(bool);
125
127 void setNodeColor(QColor color);
128
130 void setDefaultNodeColor(QColor color);
131
133 void highlightNthControlPoint(int n);
134
136 void highlightNthFiducial(int n);
137
139 void activate();
140
142 void placeActive(bool place);
143
144protected slots:
145
147 void onMarkupsNodeChanged();
149 void onMarkupsNodeAdded(vtkMRMLNode*);
151 void onMarkupsControlPointsTableContextMenu(const QPoint& position);
152
154 void onMarkupsControlPointEdited(int row, int column);
155
157 void onMarkupsControlPointSelected(int row, int column);
158
160 void updateWidget();
161
163 void onPointAdded();
164
165signals:
166
168 void markupsNodeChanged();
169
171 void markupsFiducialNodeChanged();
172
175 void currentMarkupsControlPointSelectionChanged(int markupIndex);
176
178 void currentMarkupsFiducialSelectionChanged(int markupIndex);
179
183 void activeMarkupsPlaceModeChanged(bool enabled);
184
186 void activeMarkupsFiducialPlaceModeChanged(bool enabled);
187
190 void updateFinished();
191
192protected:
193 QScopedPointer<qSlicerSimpleMarkupsWidgetPrivate> d_ptr;
194
195 virtual void setup();
196
197private:
198 Q_DECLARE_PRIVATE(qSlicerSimpleMarkupsWidget);
199 Q_DISABLE_COPY(qSlicerSimpleMarkupsWidget);
200
201};
202
203#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.