Slicer 5.13
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
qSlicerIO.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 __qSlicerIO_h
22#define __qSlicerIO_h
23
24// Qt includes
25#include <QMap>
26#include <QMetaType>
27#include <QObject>
28#include <QString>
29#include <QStringList>
30#include <QImage>
31#include <QVariant>
32
33// QtCore includes
34#include "qSlicerBaseQTCoreExport.h"
35#include "qSlicerObject.h"
36
38class qSlicerIOPrivate;
39class vtkImageData;
43
49class Q_SLICER_BASE_QTCORE_EXPORT qSlicerIO
50 : public QObject
51 , public qSlicerObject
52{
53 Q_OBJECT
54
55public:
56 typedef QObject Superclass;
57 explicit qSlicerIO(QObject* parent = nullptr);
58 ~qSlicerIO() override;
59
60 typedef QString IOFileType;
62
64 Q_INVOKABLE virtual QString description() const = 0;
65
67 Q_INVOKABLE virtual qSlicerIO::IOFileType fileType() const = 0;
68
73 Q_INVOKABLE virtual qSlicerIOOptions* options() const;
74
76 Q_INVOKABLE virtual vtkMRMLMessageCollection* userMessages() const;
77
81 Q_INVOKABLE virtual vtkMRMLFileIOHandler* ioHandler() const;
82
84 void setMRMLScene(vtkMRMLScene* scene) override;
85
91 static void toVTKProperties(const IOProperties& properties, vtkMRMLIOProperties* vtkProperties);
96
98 static bool qImageToVTKImageData(const QImage& image, vtkImageData* imageData);
100 static QImage vtkImageDataToQImage(vtkImageData* imageData);
101
102protected:
103 QScopedPointer<qSlicerIOPrivate> d_ptr;
104
105private:
106 Q_DECLARE_PRIVATE(qSlicerIO);
107 Q_DISABLE_COPY(qSlicerIO);
108};
109
112
113#endif
void setMRMLScene(vtkMRMLScene *scene) override
Set the scene of this object.
virtual Q_INVOKABLE vtkMRMLMessageCollection * userMessages() const
Additional warning or error messages occurred during IO operation.
QScopedPointer< qSlicerIOPrivate > d_ptr
Definition qSlicerIO.h:103
QString IOFileType
Definition qSlicerIO.h:60
static IOProperties fromVTKProperties(vtkMRMLIOProperties *vtkProperties)
virtual Q_INVOKABLE qSlicerIO::IOFileType fileType() const =0
Multiple readers can share the same file type.
QObject Superclass
Definition qSlicerIO.h:56
virtual Q_INVOKABLE vtkMRMLFileIOHandler * ioHandler() const
virtual Q_INVOKABLE qSlicerIOOptions * options() const
~qSlicerIO() override
QVariantMap IOProperties
Definition qSlicerIO.h:61
qSlicerIO(QObject *parent=nullptr)
static void toVTKProperties(const IOProperties &properties, vtkMRMLIOProperties *vtkProperties)
static bool qImageToVTKImageData(const QImage &image, vtkImageData *imageData)
Convert Qt image to VTK image (RGBA, unsigned char).
static QImage vtkImageDataToQImage(vtkImageData *imageData)
Convert VTK image (unsigned char, 1, 3, or 4 components) to Qt image.
virtual Q_INVOKABLE QString description() const =0
Unique name of the reader/writer.
A set of MRML Nodes that supports serialization and undo/redo.
Q_DECLARE_METATYPE(qSlicerExtensionsManagerModel::ServerAPI)
QMap< QString, QVariant > QVariantMap