Slicer  4.10
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 
62  Q_INVOKABLE vtkMRMLInteractionNode* interactionNode()const;
63 
65  Q_INVOKABLE QTableWidget* tableWidget() const;
66 
68  Q_INVOKABLE qSlicerMarkupsPlaceWidget* markupsPlaceWidget() const;
69 
71  Q_INVOKABLE qMRMLNodeComboBox* markupsSelectorComboBox() const;
72 
74  bool enterPlaceModeOnNodeChange() const;
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 
99 public slots:
100 
101  void setMRMLScene(vtkMRMLScene* scene);
102 
104  void setCurrentNode(vtkMRMLNode* currentNode);
105 
107  void setNodeBaseName(QString newNodeBaseName);
108 
111  void setInteractionNode(vtkMRMLInteractionNode* interactionNode);
112 
114  void setEnterPlaceModeOnNodeChange(bool);
115 
117  void setJumpToSliceEnabled(bool);
118 
120  void setNodeSelectorVisible(bool);
121 
123  void setOptionsVisible(bool);
124 
126  void setNodeColor(QColor color);
127 
129  void setDefaultNodeColor(QColor color);
130 
132  void highlightNthFiducial(int n);
133 
135  void activate();
136 
138  void placeActive(bool place);
139 
140 protected slots:
141 
143  void onMarkupsFiducialNodeChanged();
145  void onMarkupsFiducialNodeAdded(vtkMRMLNode*);
147  void onMarkupsFiducialTableContextMenu(const QPoint& position);
148 
150  void onMarkupsFiducialEdited(int row, int column);
151 
153  void onMarkupsFiducialSelected(int row, int column);
154 
156  void updateWidget();
157 
158 signals:
159 
161  void markupsFiducialNodeChanged();
162 
165  void currentMarkupsFiducialSelectionChanged(int markupIndex);
166 
170  void activeMarkupsFiducialPlaceModeChanged(bool enabled);
171 
174  void updateFinished();
175 
176 protected:
177  QScopedPointer<qSlicerSimpleMarkupsWidgetPrivate> d_ptr;
178 
179  virtual void setup();
180 
181 private:
182  Q_DECLARE_PRIVATE(qSlicerSimpleMarkupsWidget);
183  Q_DISABLE_COPY(qSlicerSimpleMarkupsWidget);
184 
185 };
186 
187 #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:138