Slicer  4.11
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 // Slicer includes
23 
24 #include "qSlicerMarkupsModuleExport.h"
25 
26 class QItemSelection;
27 class QMenu;
28 class QModelIndex;
29 class QTableWidgetItem;
30 class QShortcut;
31 class qSlicerMarkupsModuleWidgetPrivate;
32 class vtkMRMLMarkupsNode;
33 class vtkMRMLNode;
35 
37 class Q_SLICER_QTMODULES_MARKUPS_EXPORT qSlicerMarkupsModuleWidget :
39 {
40  Q_OBJECT
41 
42 public:
43 
45  qSlicerMarkupsModuleWidget(QWidget *parent=nullptr);
46  ~qSlicerMarkupsModuleWidget() override;
47 
50  void enter() override;
52  void exit() override;
53 
55  vtkSlicerMarkupsLogic *markupsLogic();
56 
60  void updateWidgetFromMRML();
64  void updateWidgetFromDisplayNode();
70  void updateMaximumScaleFromVolumes();
73  void updateRow(int m);
74 
77  void setMRMLMarkupsNode(vtkMRMLMarkupsNode* markupsNode);
78 
80  void updateLogicFromSettings();
81 
84  bool sliceIntersectionsVisible();
85 
86  bool setEditedNode(vtkMRMLNode* node, QString role = QString(), QString context = QString()) override;
87  double nodeEditable(vtkMRMLNode* node) override;
88 
89 public slots:
90 
93  void onNodeAddedEvent(vtkObject* scene, vtkObject* node);
97  void onNodeRemovedEvent(vtkObject* scene, vtkObject* node);
99  void onMRMLSceneEndImportEvent();
101  void onMRMLSceneEndRestoreEvent();
104  void onMRMLSceneEndBatchProcessEvent();
106  void onMRMLSceneEndCloseEvent();
108  void onPKeyActivated();
109 
113  void checkForAnnotationFiducialConversion();
116  void convertAnnotationFiducialsToMarkups();
117 
119  void onResetToDefaultDisplayPropertiesPushButtonClicked();
120  void onSaveToDefaultDisplayPropertiesPushButtonClicked();
121 
123  void onApplyCurveResamplingPushButtonClicked();
124 
126  void onAngleMeasurementModeChanged();
128  void onRotationAxisChanged();
129 
131  void onVisibilityOnAllMarkupsInListPushButtonClicked();
132  void onVisibilityOffAllMarkupsInListPushButtonClicked();
133  void onVisibilityAllMarkupsInListToggled();
134  void onLockAllMarkupsInListPushButtonClicked();
135  void onUnlockAllMarkupsInListPushButtonClicked();
136  void onLockAllMarkupsInListToggled();
137  void onSelectAllMarkupsInListPushButtonClicked();
138  void onDeselectAllMarkupsInListPushButtonClicked();
139  void onSelectedAllMarkupsInListToggled();
140  void onAddMarkupPushButtonClicked();
141  void onMoveMarkupUpPushButtonClicked();
142  void onMoveMarkupDownPushButtonClicked();
143  void onDeleteMarkupPushButtonClicked(bool confirm=true);
144  void onDeleteAllMarkupsInListPushButtonClicked();
145 
147  void onActiveMarkupItemChanged(vtkIdType);
148  void onActiveMarkupMRMLNodeChanged(vtkMRMLNode *markupsNode);
150  void onSelectionNodeActivePlaceNodeIDChanged();
151 
154  void onActiveMarkupMRMLNodeAdded(vtkMRMLNode *markupsNode);
155 
156  void onCreateMarkupsFiducial();
157  void onCreateMarkupsLine();
158  void onCreateMarkupsAngle();
159  void onCreateMarkupsOpenCurve();
160  void onCreateMarkupsClosedCurve();
161  void onCreateMarkupsPlane();
162  void onCreateMarkupsROI();
163 
165  void onListVisibileInvisiblePushButtonClicked();
166 
168  void onListLockedUnlockedPushButtonClicked();
169 
171  void onNameFormatLineEditTextEdited(const QString text);
172 
174  void onResetNameFormatToDefaultPushButtonClicked();
175 
179  void onRenameAllWithCurrentNameFormatPushButtonClicked();
180 
182  void onActiveMarkupTableCellChanged(int row, int column);
184  void onActiveMarkupTableCellClicked(QTableWidgetItem* item);
186  void onActiveMarkupTableCurrentCellChanged(int currentRow, int currentColumn,
187  int previousRow, int previousColumn);
189  void onRightClickActiveMarkupTableWidget(QPoint pos);
191  void addSelectedCoordinatesToMenu(QMenu *menu);
193  void onJumpSlicesActionTriggered();
195  void onRefocusCamerasActionTriggered();
196 
200  QStringList getOtherMarkupNames(vtkMRMLNode *thisMarkup);
201 
202  void cutSelectedToClipboard();
203  void copySelectedToClipboard();
204  void pasteSelectedFromClipboard();
205 
207  void onActiveMarkupsNodeModifiedEvent();
209  void onActiveMarkupsNodePointModifiedEvent(vtkObject *caller, void *callData);
211  void onActiveMarkupsNodePointAddedEvent();
213  void onActiveMarkupsNodePointRemovedEvent(vtkObject *caller, void *callData);
215  void onActiveMarkupsNodeDisplayModifiedEvent();
217  void onActiveMarkupsNodeTransformModifiedEvent();
218 
221  void onNewMarkupWithCurrentDisplayPropertiesTriggered();
222 
226  void onSliceIntersectionsVisibilityToggled(bool checked);
227 
229  void onHideCoordinateColumnsToggled(bool checked);
230 
232  void onTransformedCoordinatesToggled(bool checked);
233 
235  void onCurveTypeParameterChanged();
236 
238  void onROITypeParameterChanged();
239 
241  void observeMeasurementsInCurrentMarkupsNode();
243  void updateMeasurementsDescriptionLabel();
245  void populateMeasurementSettingsTable();
247  void onMeasurementsCollectionModified();
249  void onMeasurementModified(vtkObject* caller);
251  void onMeasurementEnabledCheckboxToggled(bool on);
252 
253 protected:
254  QScopedPointer<qSlicerMarkupsModuleWidgetPrivate> d_ptr;
255 
256  void setup() override;
257 
262 
263 private:
264  Q_DECLARE_PRIVATE(qSlicerMarkupsModuleWidget);
265  Q_DISABLE_COPY(qSlicerMarkupsModuleWidget);
266 };
267 
268 #endif
Q_INVOKABLE bool setEditedNode(vtkMRMLNode *node, QString role=QString(), QString context=QString()) override
Node editing.
QScopedPointer< qSlicerMarkupsModuleWidgetPrivate > d_ptr
qSlicerAbstractModuleWidget Superclass
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
Q_INVOKABLE double nodeEditable(vtkMRMLNode *node) override
virtual Q_INVOKABLE void enter()
virtual Q_INVOKABLE void exit()