Slicer  5.3
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qSlicerReformatModuleWidget.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Program: 3D Slicer
4 
5  Copyright (c) Kitware Inc.
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  This file was originally developed by Michael Jeulin-Lagarrigue, Kitware Inc.
17  and was partially funded by NIH grant 3P41RR013218-12S1
18 
19 ==============================================================================*/
20 
21 #ifndef __qSlicerReformatModuleWidget_h
22 #define __qSlicerReformatModuleWidget_h
23 
24 // Slicer includes
26 
27 #include "qSlicerReformatModuleExport.h"
28 
29 class qSlicerReformatModuleWidgetPrivate;
30 class vtkMRMLNode;
31 
33 class Q_SLICER_QTMODULES_REFORMAT_EXPORT
35 {
36  Q_OBJECT
37 
38 public:
40  qSlicerReformatModuleWidget(QWidget *parent=nullptr);
41  ~qSlicerReformatModuleWidget() override;
42 
43  enum OriginReferenceType {ONPLANE, INVOLUME};
44  enum AxesReferenceType {axisX=0, axisY, axisZ};
45 
47  void setSliceNormal(double x, double y, double z);
48 
49  bool setEditedNode(vtkMRMLNode* node, QString role = QString(), QString context = QString()) override;
50 
51 protected:
52  void setup() override;
53 
54 public slots:
57  void setWorldPosition(double* newWorldPosition);
58 
61  void setSliceOffsetValue(double offset);
62 
64  void centerSliceNode();
65 
70  void setSliceNormal(double* normal);
71 
73  void setNormalToCamera();
74 
76  void setNormalToAxisX();
77 
79  void setNormalToAxisY();
80 
82  void setNormalToAxisZ();
83 
84 protected slots:
86  void onMRMLSliceNodeModified(vtkObject* caller);
87 
89  void onTrackSliceOffsetValueChanged(double offset);
90 
91  void onNodeSelected(vtkMRMLNode* node);
92  void onSliceVisibilityChanged(bool visible);
93  void onReformatWidgetVisibilityChanged(bool visible);
94  void onLockReformatWidgetToCamera(bool lock);
95 
96  void onOriginCoordinateReferenceButtonPressed(int reference);
97 
98  void onSliceNormalToAxisChanged(AxesReferenceType axis);
99  void onSliceOrientationChanged(const QString& orientation);
100  void onSliderRotationChanged(double rotationX);
101 
102 protected:
103  QScopedPointer<qSlicerReformatModuleWidgetPrivate> d_ptr;
104 
105 private:
106  Q_DECLARE_PRIVATE(qSlicerReformatModuleWidget);
107  Q_DISABLE_COPY(qSlicerReformatModuleWidget);
108 };
109 
110 #endif
Q_INVOKABLE bool setEditedNode(vtkMRMLNode *node, QString role=QString(), QString context=QString()) override
Node editing.
qSlicerAbstractModuleWidget Superclass
QScopedPointer< qSlicerReformatModuleWidgetPrivate > d_ptr
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167