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
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
46 Q_PROPERTY(QColor nodeColor READ nodeColor WRITE setNodeColor)
48 Q_PROPERTY(int viewGroup READ viewGroup WRITE setViewGroup)
49
50public:
52 qSlicerSimpleMarkupsWidget(QWidget *parent=nullptr);
54
56 Q_INVOKABLE vtkMRMLNode* currentNode() const;
57
60
64
66 Q_INVOKABLE QTableWidget* tableWidget() const;
67
70
73
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
106
108 void setNodeBaseName(const QString& newNodeBaseName);
109
113
116
119
122
125
127 void setNodeColor(QColor color);
128
130 void setDefaultNodeColor(QColor color);
131
134
137
139 void activate();
140
142 void placeActive(bool place);
143
144protected slots:
145
151 void onMarkupsControlPointsTableContextMenu(const QPoint& position);
152
154 void onMarkupsControlPointEdited(int row, int column);
155
157 void onMarkupsControlPointSelected(int row, int column);
158
161
164
165signals:
166
169
172
176
179
184
187
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.
void setNodeColor(QColor color)
Set the selected color of the currently selected markups node.
void activate()
Set the currently selected markups node to be the active markups node in the Slicer scene.
Q_INVOKABLE vtkMRMLNode * currentNode() const
Get the currently selected markups node.
void updateWidget()
Update the GUI to reflect the currently selected markups node.
void setEnterPlaceModeOnNodeChange(bool)
Accessors to control place mode behavior.
void onMarkupsNodeAdded(vtkMRMLNode *)
Setup a newly created markups node - add display node, set color.
void setCurrentNode(vtkMRMLNode *currentNode)
Set the currently selected markups node.
void markupsNodeChanged()
The signal is emitted when a different markup node is selected.
QScopedPointer< qSlicerSimpleMarkupsWidgetPrivate > d_ptr
void setNodeBaseName(const QString &newNodeBaseName)
Set the default name of the markups node created in the combo box.
void currentMarkupsFiducialSelectionChanged(int markupIndex)
void setOptionsVisible(bool)
Show/hide options (place, activate, color, etc buttons).
void highlightNthFiducial(int n)
void onMarkupsControlPointEdited(int row, int column)
Edit the name or position of the currently selected markups node.
void placeActive(bool place)
Set the currently selected markups node to be the active markups node in the Slicer scene....
void onPointAdded()
Update the GUI to reflect the currently selected markups node.
void onMarkupsControlPointsTableContextMenu(const QPoint &position)
Create context menu for the table displaying the currently selected markups node.
Q_INVOKABLE vtkMRMLInteractionNode * interactionNode() const
void setDefaultNodeColor(QColor color)
Set the default color that is assigned to newly created markups nodes in the combo box.
void highlightNthControlPoint(int n)
Scrolls to and selects the Nth control point in the table of control points.
void setJumpToSliceEnabled(bool)
If enabled then the control point will be shown in all slice views when a control point is selected.
Q_INVOKABLE QTableWidget * tableWidget() const
Get the markups table widget.
void setMRMLScene(vtkMRMLScene *scene) override
void setNodeSelectorVisible(bool)
Show/hide the markup node selector widget.
void currentMarkupsControlPointSelectionChanged(int markupIndex)
Q_INVOKABLE vtkMRMLNode * getCurrentNode()
void activeMarkupsFiducialPlaceModeChanged(bool enabled)
qSlicerSimpleMarkupsWidget(QWidget *parent=nullptr)
Q_INVOKABLE qSlicerMarkupsPlaceWidget * markupsPlaceWidget() const
Get the markups placement widget (containing place and delete button)
void onMarkupsNodeChanged()
Update the widget when a different markups node is selected by the combo box.
Q_INVOKABLE qMRMLNodeComboBox * markupsSelectorComboBox() const
Get the markup node selector combo box.
void setViewGroup(int newViewGroup)
void activeMarkupsPlaceModeChanged(bool enabled)
void setInteractionNode(vtkMRMLInteractionNode *interactionNode)
void onMarkupsControlPointSelected(int row, int column)
Clicked on a control point or used keyboard to move between control points in the table.
qSlicerWidget(QWidget *parent=nullptr, Qt::WindowFlags f=Qt::WindowFlags())
Abstract Superclass for all specific types of MRML nodes.
A set of MRML Nodes that supports serialization and undo/redo.