33 #ifndef CXDATAREADERWRITER_H_ 34 #define CXDATAREADERWRITER_H_ 36 #include "cxResourceExport.h" 47 #include "boost/scoped_ptr.hpp" 70 virtual bool canLoad(
const QString& type,
const QString& filename) = 0;
71 virtual DataPtr load(
const QString& uid,
const QString& filename) = 0;
74 virtual QString canLoadDataType()
const =0;
75 virtual bool readInto(
DataPtr data, QString path) = 0;
89 virtual bool canLoad(
const QString& type,
const QString& filename)
91 QString fileType = QFileInfo(filename).suffix();
92 return (fileType.compare(
"mhd", Qt::CaseInsensitive) == 0 || fileType.compare(
"mha", Qt::CaseInsensitive) == 0);
95 virtual bool readInto(
DataPtr data, QString filename);
96 bool readInto(
ImagePtr image, QString path);
97 virtual DataPtr load(
const QString& uid,
const QString& filename);
99 void saveImage(
ImagePtr image,
const QString& filename);
112 virtual bool canLoad(
const QString& type,
const QString& filename)
114 QString fileType = QFileInfo(filename).suffix();
115 return (fileType.compare(
"nii", Qt::CaseInsensitive) == 0);
117 virtual bool readInto(
DataPtr data, QString path);
118 bool readInto(
ImagePtr image, QString filename);
120 virtual DataPtr load(
const QString& uid,
const QString& filename);
134 virtual bool canLoad(
const QString& type,
const QString& filename)
136 QString fileType = QFileInfo(filename).suffix();
137 return (fileType.compare(
"png", Qt::CaseInsensitive) == 0);
139 virtual bool readInto(
DataPtr data, QString path);
140 bool readInto(
ImagePtr image, QString filename);
142 virtual DataPtr load(
const QString& uid,
const QString& filename);
156 virtual bool canLoad(
const QString& type,
const QString& filename)
158 QString fileType = QFileInfo(filename).suffix();
159 return ( fileType.compare(
"vtk", Qt::CaseInsensitive) == 0);
161 virtual bool readInto(
DataPtr data, QString path);
162 bool readInto(
MeshPtr mesh, QString filename);
166 virtual DataPtr load(
const QString& uid,
const QString& filename);
178 virtual bool canLoad(
const QString& type,
const QString& filename)
180 QString fileType = QFileInfo(filename).suffix();
181 return ( fileType.compare(
"vtp", Qt::CaseInsensitive) == 0);
183 virtual bool readInto(
DataPtr data, QString path);
184 bool readInto(
MeshPtr mesh, QString filename);
188 virtual DataPtr load(
const QString& uid,
const QString& filename);
200 virtual bool canLoad(
const QString& type,
const QString& filename)
202 QString fileType = QFileInfo(filename).suffix();
203 return (fileType.compare(
"stl", Qt::CaseInsensitive) == 0);
205 virtual bool readInto(
DataPtr data, QString path);
206 bool readInto(
MeshPtr mesh, QString filename);
209 virtual DataPtr load(
const QString& uid,
const QString& filename);
223 QString findDataTypeFromFile(QString filename);
224 void readInto(
DataPtr data, QString path);
227 DataReaderPtr findReader(
const QString& path,
const QString& type=
"unknown");
228 typedef std::set<DataReaderPtr> DataReadersType;
229 DataReadersType mDataReaders;
239 #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.