Slicer  5.0
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qMRMLSliceView.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 Julien Finet, Kitware Inc.
17  and was partially funded by NIH grant 3P41RR013218-12S1
18 
19 ==============================================================================*/
20 
21 #ifndef __qMRMLSliceView_h
22 #define __qMRMLSliceView_h
23 
24 // CTK includes
25 #include <ctkVTKSliceView.h>
26 
27 // MRML includes
28 #include "qMRMLWidgetsExport.h"
29 
30 class QDropEvent;
31 class qMRMLSliceViewPrivate;
32 class vtkCollection;
34 class vtkMRMLScene;
35 class vtkMRMLSliceNode;
37 
42 class QMRML_WIDGETS_EXPORT qMRMLSliceView
43  : public ctkVTKSliceView
44 {
45  Q_OBJECT
46 public:
48  typedef ctkVTKSliceView Superclass;
49 
51  explicit qMRMLSliceView(QWidget* parent = nullptr);
52  ~qMRMLSliceView() override;
53 
64  Q_INVOKABLE void addDisplayableManager(const QString& displayableManager);
67  Q_INVOKABLE void getDisplayableManagers(vtkCollection *displayableManagers);
68 
70  Q_INVOKABLE vtkMRMLAbstractDisplayableManager* displayableManagerByClassName(const char* className);
71 
73  Q_INVOKABLE vtkMRMLSliceNode* mrmlSliceNode()const;
74 
76  Q_INVOKABLE vtkMRMLSliceViewInteractorStyle* sliceViewInteractorStyle()const;
77 
82  Q_INVOKABLE QList<double> convertDeviceToXYZ(const QList<int>&xy)const;
83 
87  Q_INVOKABLE QList<double> convertRASToXYZ(const QList<double>& ras)const;
88 
93  Q_INVOKABLE QList<double> convertXYZToRAS(const QList<double> &xyz)const;
94 
96  Q_INVOKABLE void setViewCursor(const QCursor &);
98  Q_INVOKABLE void unsetViewCursor();
100  Q_INVOKABLE void setDefaultViewCursor(const QCursor &cursor);
101 
102  void dragEnterEvent(QDragEnterEvent* event) override;
103  void dropEvent(QDropEvent* event) override;
104 
105 public slots:
106 
110  void setMRMLScene(vtkMRMLScene* newScene);
111 
113  void setMRMLSliceNode(vtkMRMLSliceNode* newSliceNode);
114 
115 protected:
116  QScopedPointer<qMRMLSliceViewPrivate> d_ptr;
117 
118 private:
119  Q_DECLARE_PRIVATE(qMRMLSliceView);
120  Q_DISABLE_COPY(qMRMLSliceView);
121 };
122 
123 #endif
Superclass for displayable manager classes.
MRML node for storing a slice through RAS space.
2D view for slice nodes. For performance reasons, the view block refreshs when the scene is in batch ...
A set of MRML Nodes that supports serialization and undo/redo.
Definition: vtkMRMLScene.h:57
QScopedPointer< qMRMLSliceViewPrivate > d_ptr
Provides customizable interaction routines.
ctkVTKSliceView Superclass
Superclass typedef.