Slicer  4.8
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
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 #include "ui_qSlicerSimpleMarkupsWidget.h"
32 
33 
34 class qSlicerSimpleMarkupsWidgetPrivate;
35 
37 class Q_SLICER_MODULE_MARKUPS_WIDGETS_EXPORT
39 {
40  Q_OBJECT
41  Q_PROPERTY(bool enterPlaceModeOnNodeChange READ enterPlaceModeOnNodeChange WRITE setEnterPlaceModeOnNodeChange)
42  Q_PROPERTY(bool jumpToSliceEnabled READ jumpToSliceEnabled WRITE setJumpToSliceEnabled)
43  Q_PROPERTY(bool nodeSelectorVisible READ nodeSelectorVisible WRITE setNodeSelectorVisible)
44  Q_PROPERTY(bool optionsVisible READ optionsVisible WRITE setOptionsVisible)
45  Q_PROPERTY(QColor nodeColor READ nodeColor WRITE setNodeColor)
46  Q_PROPERTY(QColor defaultNodeColor READ defaultNodeColor WRITE setDefaultNodeColor)
47  Q_PROPERTY(int viewGroup READ viewGroup WRITE setViewGroup)
48 
49 public:
51  qSlicerSimpleMarkupsWidget(QWidget *parent=0);
52  virtual ~qSlicerSimpleMarkupsWidget();
53 
55  Q_INVOKABLE vtkMRMLNode* currentNode() const;
56 
58  Q_INVOKABLE vtkMRMLNode* getCurrentNode();
59 
61  Q_INVOKABLE QTableWidget* tableWidget() const;
62 
64  Q_INVOKABLE qSlicerMarkupsPlaceWidget* markupsPlaceWidget() const;
65 
67  Q_INVOKABLE qMRMLNodeComboBox* markupsSelectorComboBox() const;
68 
70  bool enterPlaceModeOnNodeChange() const;
71 
74  bool jumpToSliceEnabled() const;
75 
77  bool nodeSelectorVisible() const;
78 
80  bool optionsVisible() const;
81 
83  QColor nodeColor() const;
84 
86  QColor defaultNodeColor() const;
87 
90  void setViewGroup(int newViewGroup);
91 
93  int viewGroup()const;
94 
95 public slots:
96 
97  void setMRMLScene(vtkMRMLScene* scene);
98 
100  void setCurrentNode(vtkMRMLNode* currentNode);
101 
103  void setNodeBaseName(QString newNodeBaseName);
104 
106  void setEnterPlaceModeOnNodeChange(bool);
107 
109  void setJumpToSliceEnabled(bool);
110 
112  void setNodeSelectorVisible(bool);
113 
115  void setOptionsVisible(bool);
116 
118  void setNodeColor(QColor color);
119 
121  void setDefaultNodeColor(QColor color);
122 
124  void highlightNthFiducial(int n);
125 
127  void activate();
128 
130  void placeActive(bool place);
131 
132 protected slots:
133 
135  void onMarkupsFiducialNodeChanged();
137  void onMarkupsFiducialNodeAdded(vtkMRMLNode*);
139  void onMarkupsFiducialTableContextMenu(const QPoint& position);
140 
142  void onMarkupsFiducialEdited(int row, int column);
143 
145  void onMarkupsFiducialSelected(int row, int column);
146 
148  void updateWidget();
149 
150 signals:
151 
153  void markupsFiducialNodeChanged();
154 
157  void currentMarkupsFiducialSelectionChanged(int markupIndex);
158 
162  void activeMarkupsFiducialPlaceModeChanged(bool enabled);
163 
166  void updateFinished();
167 
168 protected:
169  QScopedPointer<qSlicerSimpleMarkupsWidgetPrivate> d_ptr;
170 
171  virtual void setup();
172 
173 private:
174  Q_DECLARE_PRIVATE(qSlicerSimpleMarkupsWidget);
175  Q_DISABLE_COPY(qSlicerSimpleMarkupsWidget);
176 
177 };
178 
179 #endif
A set of MRML Nodes that supports serialization and undo/redo.
Definition: vtkMRMLScene.h:54
Combobox that automatically displays all the nodes of the scene that match filtering criteria...
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:135