Slicer  4.10
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qSlicerMarkupsPlaceWidget.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 __qSlicerMarkupsPlaceWidget_h
22 #define __qSlicerMarkupsPlaceWidget_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_qSlicerMarkupsPlaceWidget.h"
32 
33 
34 class qSlicerMarkupsPlaceWidgetPrivate;
37 
39 class Q_SLICER_MODULE_MARKUPS_WIDGETS_EXPORT
41 {
42  Q_OBJECT
44  Q_PROPERTY(bool buttonsVisible READ buttonsVisible WRITE setButtonsVisible)
45  Q_PROPERTY(bool deleteAllMarkupsOptionVisible READ deleteAllMarkupsOptionVisible WRITE setDeleteAllMarkupsOptionVisible)
46  Q_PROPERTY(PlaceMultipleMarkupsType placeMultipleMarkups READ placeMultipleMarkups WRITE setPlaceMultipleMarkups)
47  Q_PROPERTY(QColor nodeColor READ nodeColor WRITE setNodeColor)
48  Q_PROPERTY(QColor defaultNodeColor READ defaultNodeColor WRITE setDefaultNodeColor)
49  Q_PROPERTY(bool currentNodeActive READ currentNodeActive WRITE setCurrentNodeActive)
50  Q_PROPERTY(bool placeModeEnabled READ placeModeEnabled WRITE setPlaceModeEnabled)
51  Q_PROPERTY(bool placeModePersistency READ placeModePersistency WRITE setPlaceModePersistency)
52 
53 
54 public:
56  qSlicerMarkupsPlaceWidget(QWidget *parent=0);
57  virtual ~qSlicerMarkupsPlaceWidget();
58 
60  {
61  ShowPlaceMultipleMarkupsOption, // show a menu on the place button to place multiple fiducials
62  HidePlaceMultipleMarkupsOption, // don't allow to change persistency of place mode, just use current
63  ForcePlaceSingleMarkup, // always disable persistency when enabling place mode
64  ForcePlaceMultipleMarkups // always enable persistency when enabling place mode
65  };
66 
68  Q_INVOKABLE vtkMRMLNode* currentNode() const;
69 
70  Q_INVOKABLE vtkMRMLMarkupsFiducialNode* currentMarkupsFiducialNode() const;
71 
74  Q_INVOKABLE vtkMRMLInteractionNode* interactionNode()const;
75 
77  bool currentNodeActive() const;
78 
80  bool placeModeEnabled() const;
81 
83  bool placeModePersistency() const;
84 
86  PlaceMultipleMarkupsType placeMultipleMarkups() const;
87 
89  bool buttonsVisible() const;
90 
92  bool deleteAllMarkupsOptionVisible() const;
93 
95  QColor nodeColor() const;
96 
98  QColor defaultNodeColor() const;
99 
100  Q_INVOKABLE QToolButton* placeButton() const;
101 
102  Q_INVOKABLE QToolButton* deleteButton() const;
103 
104 public slots:
105 
106  void setMRMLScene(vtkMRMLScene* scene);
107 
109  void setCurrentNode(vtkMRMLNode* currentNode);
110 
112  void setCurrentNodeActive(bool active);
113 
116  void setInteractionNode(vtkMRMLInteractionNode* interactionNode);
117 
118  void setDefaultNodeColor(QColor color);
119 
120  void setNodeColor(QColor color);
121 
123  void setPlaceModeEnabled(bool enable);
124 
126  void setPlaceMultipleMarkups(PlaceMultipleMarkupsType option);
127 
129  void setButtonsVisible(bool visible);
130 
132  void setDeleteAllMarkupsOptionVisible(bool visible);
133 
135  void setPlaceModePersistency(bool);
136 
138  void deleteLastMarkup();
139 
141  void deleteAllMarkups();
142 
143 protected slots:
144 
146  void updateWidget();
147 
149  void onColorButtonChanged(QColor);
151  void onVisibilityButtonClicked();
153  void onLockedButtonClicked();
154 
155  void onPlacePersistent(bool enable);
156 
157 signals:
158 
162  void activeMarkupsFiducialPlaceModeChanged(bool enabled);
163 
164 protected:
165  QScopedPointer<qSlicerMarkupsPlaceWidgetPrivate> d_ptr;
166 
167  virtual void setup();
168 
169 private:
170  Q_DECLARE_PRIVATE(qSlicerMarkupsPlaceWidget);
171  Q_DISABLE_COPY(qSlicerMarkupsPlaceWidget);
172 
173 };
174 
175 #endif
QScopedPointer< qSlicerMarkupsPlaceWidgetPrivate > d_ptr
virtual void setMRMLScene(vtkMRMLScene *scene)
MRML node to represent a fiducial markup Fiducial Markups nodes contain a list of fiducial points...
A set of MRML Nodes that supports serialization and undo/redo.
Definition: vtkMRMLScene.h:54
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:138