Slicer  4.8
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;
36 
38 class Q_SLICER_MODULE_MARKUPS_WIDGETS_EXPORT
40 {
41  Q_OBJECT
43  Q_PROPERTY(bool buttonsVisible READ buttonsVisible WRITE setButtonsVisible)
44  Q_PROPERTY(bool deleteAllMarkupsOptionVisible READ deleteAllMarkupsOptionVisible WRITE setDeleteAllMarkupsOptionVisible)
45  Q_PROPERTY(PlaceMultipleMarkupsType placeMultipleMarkups READ placeMultipleMarkups WRITE setPlaceMultipleMarkups)
46  Q_PROPERTY(QColor nodeColor READ nodeColor WRITE setNodeColor)
47  Q_PROPERTY(QColor defaultNodeColor READ defaultNodeColor WRITE setDefaultNodeColor)
48  Q_PROPERTY(bool currentNodeActive READ currentNodeActive WRITE setCurrentNodeActive)
49  Q_PROPERTY(bool placeModeEnabled READ placeModeEnabled WRITE setPlaceModeEnabled)
50  Q_PROPERTY(bool placeModePersistency READ placeModePersistency WRITE setPlaceModePersistency)
51 
52 
53 public:
55  qSlicerMarkupsPlaceWidget(QWidget *parent=0);
56  virtual ~qSlicerMarkupsPlaceWidget();
57 
59  {
60  ShowPlaceMultipleMarkupsOption, // show a menu on the place button to place multiple fiducials
61  HidePlaceMultipleMarkupsOption, // don't allow to change persistency of place mode, just use current
62  ForcePlaceSingleMarkup, // always disable persistency when enabling place mode
63  ForcePlaceMultipleMarkups // always enable persistency when enabling place mode
64  };
65 
67  Q_INVOKABLE vtkMRMLNode* currentNode() const;
68 
69  Q_INVOKABLE vtkMRMLMarkupsFiducialNode* currentMarkupsFiducialNode() const;
70 
72  bool currentNodeActive() const;
73 
75  bool placeModeEnabled() const;
76 
78  bool placeModePersistency() const;
79 
81  PlaceMultipleMarkupsType placeMultipleMarkups() const;
82 
84  bool buttonsVisible() const;
85 
87  bool deleteAllMarkupsOptionVisible() const;
88 
90  QColor nodeColor() const;
91 
93  QColor defaultNodeColor() const;
94 
95  Q_INVOKABLE QToolButton* placeButton() const;
96 
97  Q_INVOKABLE QToolButton* deleteButton() const;
98 
99 public slots:
100 
101  void setMRMLScene(vtkMRMLScene* scene);
102 
104  void setCurrentNode(vtkMRMLNode* currentNode);
105 
107  void setCurrentNodeActive(bool active);
108 
109  void setDefaultNodeColor(QColor color);
110 
111  void setNodeColor(QColor color);
112 
114  void setPlaceModeEnabled(bool enable);
115 
117  void setPlaceMultipleMarkups(PlaceMultipleMarkupsType option);
118 
120  void setButtonsVisible(bool visible);
121 
123  void setDeleteAllMarkupsOptionVisible(bool visible);
124 
126  void setPlaceModePersistency(bool);
127 
129  void deleteLastMarkup();
130 
132  void deleteAllMarkups();
133 
134 protected slots:
135 
137  void updateWidget();
138 
140  void onColorButtonChanged(QColor);
142  void onVisibilityButtonClicked();
144  void onLockedButtonClicked();
145 
146  void onPlacePersistent(bool enable);
147 
148 signals:
149 
153  void activeMarkupsFiducialPlaceModeChanged(bool enabled);
154 
155 protected:
156  QScopedPointer<qSlicerMarkupsPlaceWidgetPrivate> d_ptr;
157 
158  virtual void setup();
159 
160 private:
161  Q_DECLARE_PRIVATE(qSlicerMarkupsPlaceWidget);
162  Q_DISABLE_COPY(qSlicerMarkupsPlaceWidget);
163 
164 };
165 
166 #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:135