Slicer  4.10
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qSlicerMarkupsModuleWidget.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Program: 3D Slicer
4 
5  Portions (c) Copyright Brigham and Women's Hospital (BWH) All Rights Reserved.
6 
7  See COPYRIGHT.txt
8  or http://www.slicer.org/copyright/copyright.txt for details.
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 
16 ==============================================================================*/
17 
18 #ifndef __qSlicerMarkupsModuleWidget_h
19 #define __qSlicerMarkupsModuleWidget_h
20 
21 // SlicerQt includes
23 
24 #include "qSlicerMarkupsModuleExport.h"
25 
26 class QMenu;
27 class QModelIndex;
28 class QTableWidgetItem;
29 class QShortcut;
30 class qSlicerMarkupsModuleWidgetPrivate;
31 class vtkMRMLMarkupsNode;
32 class vtkMRMLNode;
34 
36 class Q_SLICER_QTMODULES_MARKUPS_EXPORT qSlicerMarkupsModuleWidget :
38 {
39  Q_OBJECT
40 
41 public:
42 
44  qSlicerMarkupsModuleWidget(QWidget *parent=0);
45  virtual ~qSlicerMarkupsModuleWidget();
46 
49  virtual void enter();
51  virtual void exit();
52 
54  void installShortcuts();
55  void removeShortcuts();
56 
58  vtkSlicerMarkupsLogic *markupsLogic();
59 
63  void updateWidgetFromMRML();
67  void updateWidgetFromDisplayNode();
73  void updateMaximumScaleFromVolumes();
76  void updateRow(int m);
77 
80  void observeMarkupsNode(vtkMRMLNode *markupsNode);
81 
83  void clearGUI();
84 
86  void updateLogicFromSettings();
87 
90  bool sliceIntersectionsVisible();
91 
92  virtual bool setEditedNode(vtkMRMLNode* node, QString role = QString(), QString context = QString());
93  virtual double nodeEditable(vtkMRMLNode* node);
94 
95 public slots:
96 
99  void onNodeAddedEvent(vtkObject* scene, vtkObject* node);
103  void onNodeRemovedEvent(vtkObject* scene, vtkObject* node);
105  void onMRMLSceneEndImportEvent();
107  void onMRMLSceneEndRestoreEvent();
110  void onMRMLSceneEndBatchProcessEvent();
112  void onMRMLSceneEndCloseEvent();
114  void onPKeyActivated();
115 
119  void checkForAnnotationFiducialConversion();
122  void convertAnnotationFiducialsToMarkups();
123 
125  void onSelectedColorPickerButtonChanged(QColor qcolor);
126  void onUnselectedColorPickerButtonChanged(QColor qcolor);
127  void onGlyphTypeComboBoxChanged(QString value);
128  void onGlyphScaleSliderWidgetChanged(double value);
129  void onTextScaleSliderWidgetChanged(double value);
130  void onOpacitySliderWidgetChanged(double value);
131 
132  void onMarkupScaleSliderWidgetValueChanged(double value);
133 
135  void onResetToDefaultDisplayPropertiesPushButtonClicked();
136  void onSaveToDefaultDisplayPropertiesPushButtonClicked();
137 
139  void onVisibilityOnAllMarkupsInListPushButtonClicked();
140  void onVisibilityOffAllMarkupsInListPushButtonClicked();
141  void onVisibilityAllMarkupsInListToggled();
142  void onLockAllMarkupsInListPushButtonClicked();
143  void onUnlockAllMarkupsInListPushButtonClicked();
144  void onLockAllMarkupsInListToggled();
145  void onSelectAllMarkupsInListPushButtonClicked();
146  void onDeselectAllMarkupsInListPushButtonClicked();
147  void onSelectedAllMarkupsInListToggled();
148  void onAddMarkupPushButtonClicked();
149  void onMoveMarkupUpPushButtonClicked();
150  void onMoveMarkupDownPushButtonClicked();
151  void onDeleteMarkupPushButtonClicked(bool confirm=true);
152  void onDeleteAllMarkupsInListPushButtonClicked();
153 
155  void onActiveMarkupMRMLNodeChanged(vtkMRMLNode *markupsNode);
157  void onSelectionNodeActivePlaceNodeIDChanged();
158 
161  void onActiveMarkupMRMLNodeAdded(vtkMRMLNode *markupsNode);
162 
164  void onListVisibileInvisiblePushButtonClicked();
166  void updateListVisibileInvisiblePushButton(int visibleFlag);
167 
169  void onListLockedUnlockedPushButtonClicked();
170 
172  void onNameFormatLineEditTextEdited(const QString text);
173 
175  void onResetNameFormatToDefaultPushButtonClicked();
176 
180  void onRenameAllWithCurrentNameFormatPushButtonClicked();
181 
183  void onActiveMarkupTableCellChanged(int row, int column);
185  void onActiveMarkupTableCellClicked(QTableWidgetItem* item);
187  void onActiveMarkupTableCurrentCellChanged(int currentRow, int currentColumn,
188  int previousRow, int previousColumn);
190  void onRightClickActiveMarkupTableWidget(QPoint pos);
192  void addSelectedCoordinatesToMenu(QMenu *menu);
194  void onJumpSlicesActionTriggered();
196  void onRefocusCamerasActionTriggered();
197 
201  QStringList getOtherMarkupNames(vtkMRMLNode *thisMarkup);
202 
203  void cutSelectedToClipboard();
204  void copySelectedToClipboard();
205  void pasteSelectedFromClipboard();
206 
208  void onActiveMarkupsNodeLockModifiedEvent();
210  void onActiveMarkupsNodeLabelFormatModifiedEvent();
213  void onActiveMarkupsNodePointModifiedEvent(vtkObject *caller, vtkObject *callData);
215  void onActiveMarkupsNodeMarkupAddedEvent(vtkObject *caller, vtkObject *callData);
217  void onActiveMarkupsNodeMarkupRemovedEvent();//vtkMRMLNode *markupsNode);
219  void onActiveMarkupsNodeNthMarkupModifiedEvent(vtkObject *caller, vtkObject *callData);
221  void onActiveMarkupsNodeDisplayModifiedEvent();
223  void onActiveMarkupsNodeTransformModifiedEvent();
224 
227  void onNewMarkupWithCurrentDisplayPropertiesTriggered();
228 
232  void onSliceIntersectionsVisibilityToggled(bool checked);
233 
235  void onHideCoordinateColumnsToggled(bool checked);
236 
238  void onTransformedCoordinatesToggled(bool checked);
239 
240 protected:
241  QScopedPointer<qSlicerMarkupsModuleWidgetPrivate> d_ptr;
242 
243  virtual void setup();
244 
249 
250 private:
251  Q_DECLARE_PRIVATE(qSlicerMarkupsModuleWidget);
252  Q_DISABLE_COPY(qSlicerMarkupsModuleWidget);
253 
254  QShortcut *pToAddShortcut;
255 };
256 
257 #endif
virtual Q_INVOKABLE bool setEditedNode(vtkMRMLNode *node, QString role=QString(), QString context=QString())
Node editing.
QScopedPointer< qSlicerMarkupsModuleWidgetPrivate > d_ptr
virtual Q_INVOKABLE double nodeEditable(vtkMRMLNode *node)
MRML node to represent a list of markups Markups nodes contains a list of markups that each contain a...
qSlicerAbstractModuleWidget Superclass
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:138
virtual Q_INVOKABLE void enter()
virtual Q_INVOKABLE void exit()