Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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
30class QDropEvent;
31class qMRMLSliceViewPrivate;
32class vtkCollection;
34class vtkMRMLScene;
37
42class QMRML_WIDGETS_EXPORT qMRMLSliceView
43 : public ctkVTKSliceView
44{
45 Q_OBJECT
46public:
48 typedef ctkVTKSliceView Superclass;
49
51 explicit qMRMLSliceView(QWidget* parent = nullptr);
52 ~qMRMLSliceView() override;
53
55 void setInteractor(vtkRenderWindowInteractor* interactor) override;
56
59
70 Q_INVOKABLE void addDisplayableManager(const QString& displayableManager);
73 Q_INVOKABLE void getDisplayableManagers(vtkCollection *displayableManagers);
74
77
79 Q_INVOKABLE vtkMRMLSliceNode* mrmlSliceNode()const;
80
84
89 Q_INVOKABLE QList<double> convertDeviceToXYZ(const QList<int>&xy)const;
90
94 Q_INVOKABLE QList<double> convertRASToXYZ(const QList<double>& ras)const;
95
100 Q_INVOKABLE QList<double> convertXYZToRAS(const QList<double> &xyz)const;
101
103 Q_INVOKABLE void setViewCursor(const QCursor &);
105 Q_INVOKABLE void unsetViewCursor();
107 Q_INVOKABLE void setDefaultViewCursor(const QCursor &cursor);
108
109 void dragEnterEvent(QDragEnterEvent* event) override;
110 void dropEvent(QDropEvent* event) override;
111
112public slots:
113
117 void setMRMLScene(vtkMRMLScene* newScene);
118
121
122private:
123 Q_DECLARE_PRIVATE(qMRMLSliceView);
124 Q_DISABLE_COPY(qMRMLSliceView);
125};
126
127#endif
~qMRMLSliceView() override
Q_INVOKABLE void getDisplayableManagers(vtkCollection *displayableManagers)
Q_INVOKABLE QList< double > convertXYZToRAS(const QList< double > &xyz) const
void setMRMLSliceNode(vtkMRMLSliceNode *newSliceNode)
Set the current viewNode to observe.
Q_INVOKABLE vtkMRMLSliceViewInteractorStyle * sliceViewInteractorStyle() const
qMRMLSliceView(QWidget *parent=nullptr)
Constructors.
Q_INVOKABLE void setViewCursor(const QCursor &)
Set cursor in the view area.
Q_INVOKABLE vtkMRMLAbstractDisplayableManager * displayableManagerByClassName(const char *className)
Return a DisplayableManager given its class name.
Q_INVOKABLE void unsetViewCursor()
Restore default cursor in the view area.
void dropEvent(QDropEvent *event) override
Q_INVOKABLE void addDisplayableManager(const QString &displayableManager)
ctkVTKSliceView Superclass
Superclass typedef.
void setInteractor(vtkRenderWindowInteractor *interactor) override
Sets the interactor of the view.
void dragEnterEvent(QDragEnterEvent *event) override
Q_INVOKABLE QList< double > convertDeviceToXYZ(const QList< int > &xy) const
void setMRMLScene(vtkMRMLScene *newScene)
Q_INVOKABLE QList< double > convertRASToXYZ(const QList< double > &ras) const
Q_INVOKABLE vtkMRMLSliceNode * mrmlSliceNode() const
Get the 3D View node observed by view.
Q_INVOKABLE vtkMRMLSliceViewInteractorStyle * interactorObserver() const
Returns the interactor observer of the view.
Q_INVOKABLE void setDefaultViewCursor(const QCursor &cursor)
Set default cursor in the view area.
Superclass for displayable manager classes.
A set of MRML Nodes that supports serialization and undo/redo.
MRML node for storing a slice through RAS space.
Provides customizable interaction routines.