Slicer 5.11
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;
35class QTableWidgetItem;
38
39class Q_SLICER_MODULE_MARKUPS_WIDGETS_EXPORT qSlicerSimpleMarkupsWidget : public qSlicerWidget
40{
41 Q_OBJECT
46 Q_PROPERTY(QColor nodeColor READ nodeColor WRITE setNodeColor)
48 Q_PROPERTY(int viewGroup READ viewGroup WRITE setViewGroup)
50
51public:
53 qSlicerSimpleMarkupsWidget(QWidget* parent = nullptr);
55
57 Q_INVOKABLE vtkMRMLNode* currentNode() const;
58
61
65
67 Q_INVOKABLE QTableWidget* tableWidget() const;
68
71
74
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
103
104public slots:
105
106 void setMRMLScene(vtkMRMLScene* scene) override;
107
110
112 void setNodeBaseName(const QString& newNodeBaseName);
113
117
120
123
126
129
131 void setNodeColor(QColor color);
132
134 void setDefaultNodeColor(QColor color);
135
138
141
144
146 void activate();
147
149 void placeActive(bool place);
150
151protected slots:
152
158 void onMarkupsControlPointsTableContextMenu(const QPoint& position);
159
161 void onMarkupsControlPointEdited(int row, int column);
162
164 void onMarkupsControlPointSelected(int row, int column);
165
167 void onMarkupsControlPointClicked(QTableWidgetItem* item);
168
171
174
175signals:
176
179
182
186
189
194
197
201
202protected:
203 QScopedPointer<qSlicerSimpleMarkupsWidgetPrivate> d_ptr;
204
205 virtual void setup();
206
207private:
208 Q_DECLARE_PRIVATE(qSlicerSimpleMarkupsWidget);
209 Q_DISABLE_COPY(qSlicerSimpleMarkupsWidget);
210};
211
212#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.
void onMarkupsControlPointClicked(QTableWidgetItem *item)
Clicked on a control point cell (used for toggling position state).
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 setPositionStatusColumnVisible(bool)
Show/hide position status column in the table.
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.