Slicer 5.4
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
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
64 Q_INVOKABLE void addDisplayableManager(const QString& displayableManager);
67 Q_INVOKABLE void getDisplayableManagers(vtkCollection *displayableManagers);
68
71
73 Q_INVOKABLE vtkMRMLSliceNode* mrmlSliceNode()const;
74
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
105public slots:
106
110 void setMRMLScene(vtkMRMLScene* newScene);
111
114
115protected:
116 QScopedPointer<qMRMLSliceViewPrivate> d_ptr;
117
118private:
119 Q_DECLARE_PRIVATE(qMRMLSliceView);
120 Q_DISABLE_COPY(qMRMLSliceView);
121};
122
123#endif
2D view for slice nodes. For performance reasons, the view block refreshes when the scene is in batch...
~qMRMLSliceView() override
Q_INVOKABLE void getDisplayableManagers(vtkCollection *displayableManagers)
QScopedPointer< qMRMLSliceViewPrivate > d_ptr
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
Returns the interactor style of the view.
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 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 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.