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
qSlicerMarkupsPlaceWidget.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 __qSlicerMarkupsPlaceWidget_h
22#define __qSlicerMarkupsPlaceWidget_h
23
24// Qt includes
25#include "qSlicerWidget.h"
26
27#include "qMRMLUtils.h"
28
29// Markups Widgets includes
30#include "qSlicerMarkupsModuleWidgetsExport.h"
31
36class qSlicerMarkupsPlaceWidgetPrivate;
37class QToolButton;
38
39class Q_SLICER_MODULE_MARKUPS_WIDGETS_EXPORT
41{
42 Q_OBJECT
49 Q_PROPERTY(QColor nodeColor READ nodeColor WRITE setNodeColor)
54
57
58public:
60 qSlicerMarkupsPlaceWidget(QWidget *parent=nullptr);
62
64 {
65 ShowPlaceMultipleMarkupsOption, // show a menu on the place button to place multiple markup points
66 HidePlaceMultipleMarkupsOption, // don't allow to change persistency of place mode, just use current
67 ForcePlaceSingleMarkup, // always disable persistency when enabling place mode
68 ForcePlaceMultipleMarkups // always enable persistency when enabling place mode
69 };
70
72 Q_INVOKABLE vtkMRMLNode* currentNode() const;
75
80
82 bool currentNodeActive() const;
83
85 bool placeModeEnabled() const;
86
89
92
94 bool buttonsVisible() const;
95
98
101
104
106 QColor nodeColor() const;
107
109 QColor defaultNodeColor() const;
110
111 // Returns true if additional points are allowed in the current markup node, false when point number is fixed
113
114 Q_INVOKABLE QToolButton* placeButton() const;
115
116 // Button to delete control point(s) or unset their position
117 Q_INVOKABLE QToolButton* deleteButton() const;
118
119 //-----------------------------------------------------------
120 // All public methods below are deprecated
121 //
122 // These methods are deprecated because they use old terms (markup instead of control point),
123
126 {
127 qWarning("qSlicerMarkupsPlaceWidget::deleteAllMarkupsOptionVisible method is deprecated, please use deleteAllControlPointsOptionVisible instead");
129 };
130
131
132public slots:
133
134 void setMRMLScene(vtkMRMLScene* scene) override;
135
138
140 void setCurrentNodeActive(bool active);
141
146
147 void setDefaultNodeColor(QColor color);
148
149 void setNodeColor(QColor color);
150
152 void setPlaceModeEnabled(bool enable);
153
156
158 void setButtonsVisible(bool visible);
159
162
165
168
171
176
179
182
185
188
189 //-----------------------------------------------------------
190 // All public methods below are deprecated
191 //
192 // These methods are deprecated because they use old terms (markup instead of control point),
193
196 {
197 qWarning("qSlicerMarkupsPlaceWidget::deleteLastMarkup method is deprecated, please use deleteLastPoint instead");
198 this->deleteLastPoint();
199 };
200
202 {
203 qWarning("qSlicerMarkupsPlaceWidget::deleteAllMarkups method is deprecated, please use deleteAllPoints instead");
204 this->deleteAllPoints();
205 };
206
208 {
209 qWarning("qSlicerMarkupsPlaceWidget::setDeleteAllMarkupsOptionVisible method is deprecated, please use setDeleteAllControlPointsOptionVisible instead");
211 };
212
213protected slots:
214
217
220
229
230 void onPlacePersistentPoint(bool enable);
231
232signals:
233
238
241
242protected:
243 QScopedPointer<qSlicerMarkupsPlaceWidgetPrivate> d_ptr;
244
245 virtual void setup();
246
247private:
248 Q_DECLARE_PRIVATE(qSlicerMarkupsPlaceWidget);
249 Q_DISABLE_COPY(qSlicerMarkupsPlaceWidget);
250
251};
252
253#endif
void activeMarkupsFiducialPlaceModeChanged(bool enabled)
bool deleteAllControlPointsOptionVisible() const
Returns true if the Delete all option on the Delete button is visible.
void setUnsetAllControlPointsOptionVisible(bool visible)
Set visibility of Unset all control point option.
void onLockedButtonClicked()
Toggle whether the current markups node is locked.
void unsetLastDefinedPoint()
Unset the position status of the last placed markup point.
void setDeleteAllMarkupsOptionVisible(bool visible)
Q_INVOKABLE vtkMRMLNode * currentNode() const
Get the currently selected markups node.
void onColorButtonChanged(QColor)
Update the currently selected markups node to have its selected color changed.
void onVisibilityButtonClicked()
Toggle the visibility of the markups in the viewers.
Q_INVOKABLE vtkMRMLSelectionNode * selectionNode() const
void updateDeleteButton()
Update the Delete Button to reflect the currently visible delete button options.
Q_INVOKABLE vtkMRMLInteractionNode * interactionNode() const
Q_INVOKABLE QToolButton * deleteButton() const
Q_INVOKABLE vtkMRMLMarkupsNode * currentMarkupsNode() const
QColor defaultNodeColor() const
Get the default node color that is shown when no node is selected.
void setPlaceMultipleMarkups(PlaceMultipleMarkupsType option)
Configures multiplicity of markups placement.
void setButtonsVisible(bool visible)
Show/hide all buttons. Useful for showing/hiding all buttons except specific ones.
bool unsetAllControlPointsOptionVisible() const
Returns true if the Unset all control points option on the Delete button is visible.
void deleteLastPoint()
Delete last placed markup point.
void onPlacePersistentPoint(bool enable)
void setDefaultNodeColor(QColor color)
bool unsetLastControlPointOptionVisible() const
Returns true if the Unset last control point option on the Delete button is visible.
void setPlaceModePersistency(bool)
Set place mode to persistent (remains active until deactivated). Does not enable or disable placement...
void setUnsetLastControlPointOptionVisible(bool visible)
Set visibility of Unset last control point option.
QScopedPointer< qSlicerMarkupsPlaceWidgetPrivate > d_ptr
Q_INVOKABLE vtkMRMLMarkupsFiducialNode * currentMarkupsFiducialNode() const
void activeMarkupsPlaceModeChanged(bool enabled)
bool currentNodeActive() const
Returns true if the current markups node is the active markups node in the scene.
void setInteractionNode(vtkMRMLInteractionNode *interactionNode)
void setMRMLScene(vtkMRMLScene *scene) override
Q_INVOKABLE QToolButton * placeButton() const
PlaceMultipleMarkupsType placeMultipleMarkups
bool placeModePersistency() const
Returns true if placement mode is persistent, regardless if place mode is enabled or not.
void setCurrentNodeActive(bool active)
Set the currently selected markups node to be the active markups node in the Slicer scene....
void setCurrentNode(vtkMRMLNode *currentNode)
Set the currently selected markups node.
void updateWidget()
Update the GUI to reflect the currently selected markups node.
void setNodeColor(QColor color)
qSlicerMarkupsPlaceWidget(QWidget *parent=nullptr)
QColor nodeColor() const
Get the selected color of the currently selected markups node.
void setPlaceModeEnabled(bool enable)
Enable/disable place mode. If place mode is enabled then current markups node is set active,...
bool placeModeEnabled() const
Returns true if place mode enabled and current node is active.
void deleteAllPoints()
Delete all points from the markups node.
PlaceMultipleMarkupsType placeMultipleMarkups() const
Returns markup placement multiplicity option.
void setDeleteAllControlPointsOptionVisible(bool visible)
Set visibility of Delete all markups option.
void onFixedNumberOfControlPointsButtonClicked()
Toggle whether the number of points in the current markups node is locked.
void setSelectionNode(vtkMRMLSelectionNode *selectionNode)
bool buttonsVisible() const
Returns true if all buttons are visible.
void unsetAllPoints()
Unset the position of all points from the markups node.
qSlicerWidget(QWidget *parent=nullptr, Qt::WindowFlags f=Qt::WindowFlags())
MRML node to represent a fiducial markup Fiducial Markups nodes contain a list of control points....
Abstract Superclass for all specific types of MRML nodes.
A set of MRML Nodes that supports serialization and undo/redo.
MRML node for storing information about the active nodes in the scene.