12 #ifndef CXDATAREADERWRITER_H_ 13 #define CXDATAREADERWRITER_H_ 15 #include "cxResourceExport.h" 26 #include "boost/scoped_ptr.hpp" 49 virtual bool canLoad(
const QString& type,
const QString& filename) = 0;
50 virtual DataPtr load(
const QString& uid,
const QString& filename) = 0;
53 virtual QString canLoadDataType()
const =0;
54 virtual bool readInto(
DataPtr data, QString path) = 0;
68 virtual bool canLoad(
const QString& type,
const QString& filename)
70 QString fileType = QFileInfo(filename).suffix();
71 return (fileType.compare(
"mhd", Qt::CaseInsensitive) == 0 || fileType.compare(
"mha", Qt::CaseInsensitive) == 0);
74 virtual bool readInto(
DataPtr data, QString filename);
75 bool readInto(
ImagePtr image, QString path);
76 virtual DataPtr load(
const QString& uid,
const QString& filename);
78 void saveImage(
ImagePtr image,
const QString& filename);
91 virtual bool canLoad(
const QString& type,
const QString& filename)
93 QString fileType = QFileInfo(filename).suffix();
94 return (fileType.compare(
"nii", Qt::CaseInsensitive) == 0);
96 virtual bool readInto(
DataPtr data, QString path);
97 bool readInto(
ImagePtr image, QString filename);
99 virtual DataPtr load(
const QString& uid,
const QString& filename);
113 virtual bool canLoad(
const QString& type,
const QString& filename)
115 QString fileType = QFileInfo(filename).suffix();
116 return (fileType.compare(
"png", Qt::CaseInsensitive) == 0);
118 virtual bool readInto(
DataPtr data, QString path);
119 bool readInto(
ImagePtr image, QString filename);
121 virtual DataPtr load(
const QString& uid,
const QString& filename);
135 virtual bool canLoad(
const QString& type,
const QString& filename)
137 QString fileType = QFileInfo(filename).suffix();
138 return ( fileType.compare(
"vtk", Qt::CaseInsensitive) == 0);
140 virtual bool readInto(
DataPtr data, QString path);
141 bool readInto(
MeshPtr mesh, QString filename);
145 virtual DataPtr load(
const QString& uid,
const QString& filename);
157 virtual bool canLoad(
const QString& type,
const QString& filename)
159 QString fileType = QFileInfo(filename).suffix();
160 return ( fileType.compare(
"vtp", Qt::CaseInsensitive) == 0);
162 virtual bool readInto(
DataPtr data, QString path);
163 bool readInto(
MeshPtr mesh, QString filename);
167 virtual DataPtr load(
const QString& uid,
const QString& filename);
179 virtual bool canLoad(
const QString& type,
const QString& filename)
181 QString fileType = QFileInfo(filename).suffix();
182 return (fileType.compare(
"stl", Qt::CaseInsensitive) == 0);
184 virtual bool readInto(
DataPtr data, QString path);
185 bool readInto(
MeshPtr mesh, QString filename);
188 virtual DataPtr load(
const QString& uid,
const QString& filename);
202 QString findDataTypeFromFile(QString filename);
203 void readInto(
DataPtr data, QString path);
206 DataReaderPtr findReader(
const QString& path,
const QString& type=
"unknown");
207 typedef std::set<DataReaderPtr> DataReadersType;
208 DataReadersType mDataReaders;
218 #endif // CXDATAREADERWRITER_H_ boost::shared_ptr< class SpaceProvider > SpaceProviderPtr
vtkSmartPointer< class vtkMatrix4x4 > vtkMatrix4x4Ptr
virtual QString canLoadDataType() const
virtual bool canLoad(const QString &type, const QString &filename)
boost::shared_ptr< class Image > ImagePtr
virtual bool canLoad(const QString &type, const QString &filename)
boost::shared_ptr< DataReader > DataReaderPtr
virtual bool canLoad(const QString &type, const QString &filename)
virtual QString canLoadDataType() const
virtual vtkImageDataPtr loadVtkImageData(QString filename)
boost::shared_ptr< class Data > DataPtr
virtual QString canLoadDataType() const
virtual ~PNGImageReader()
virtual vtkPolyDataPtr loadVtkPolyData(QString filename)
Read or write vtk or ssc data objects from/to file.
vtkSmartPointer< vtkPolyData > vtkPolyDataPtr
virtual ~XMLPolyDataMeshReader()
virtual QString canLoadDataType() const
virtual ~PolyDataMeshReader()
virtual bool canLoad(const QString &type, const QString &filename)
Reader for portable network graphics .png files.
virtual bool canLoad(const QString &type, const QString &filename)
boost::shared_ptr< class Mesh > MeshPtr
Interface for Data file readers.
virtual QString canLoadDataType() const
Namespace for all CustusX production code.