Slicer 5.9
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 qSlicerSimpleMarkupsWidget : public qSlicerWidget
39{
40 Q_OBJECT
45 Q_PROPERTY(QColor nodeColor READ nodeColor WRITE setNodeColor)
47 Q_PROPERTY(int viewGroup READ viewGroup WRITE setViewGroup)
48
49public:
51 qSlicerSimpleMarkupsWidget(QWidget* parent = nullptr);
53
55 Q_INVOKABLE vtkMRMLNode* currentNode() const;
56
59
63
65 Q_INVOKABLE QTableWidget* tableWidget() const;
66
69
72
75
78 bool jumpToSliceEnabled() const;
79
81 bool nodeSelectorVisible() const;
82
84 bool optionsVisible() const;
85
87 QColor nodeColor() const;
88
90 QColor defaultNodeColor() const;
91
94 void setViewGroup(int newViewGroup);
95
97 int viewGroup() const;
98
99public slots:
100
101 void setMRMLScene(vtkMRMLScene* scene) override;
102
105
107 void setNodeBaseName(const QString& newNodeBaseName);
108
112
115
118
121
124
126 void setNodeColor(QColor color);
127
129 void setDefaultNodeColor(QColor color);
130
133
136
138 void activate();
139
141 void placeActive(bool place);
142
143protected slots:
144
150 void onMarkupsControlPointsTableContextMenu(const QPoint& position);
151
153 void onMarkupsControlPointEdited(int row, int column);
154
156 void onMarkupsControlPointSelected(int row, int column);
157
160
163
164signals:
165
168
171
175
178
183
186
190
191protected:
192 QScopedPointer<qSlicerSimpleMarkupsWidgetPrivate> d_ptr;
193
194 virtual void setup();
195
196private:
197 Q_DECLARE_PRIVATE(qSlicerSimpleMarkupsWidget);
198 Q_DISABLE_COPY(qSlicerSimpleMarkupsWidget);
199};
200
201#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.