29 #ifndef __vtkNRRDReader_h 30 #define __vtkNRRDReader_h 36 #include "vtkTeemConfigure.h" 37 #include "vtkMedicalImageReader2.h" 42 #include <vtkMatrix4x4.h> 43 #include <vtkPointData.h> 44 #include <vtkSmartPointer.h> 45 #include <vtkVersion.h> 47 #include "teem/nrrd.h" 63 vtkMatrix4x4* GetRasToIjkMatrix();
67 vtkMatrix4x4* GetMeasurementFrameMatrix();
73 const char* GetHeaderKeys();
78 std::vector<std::string> GetHeaderKeysVector();
82 const char* GetHeaderValue(
const char *key);
85 const char* GetAxisLabel(
unsigned int axis);
88 const char* GetAxisUnit(
unsigned int axis);
90 virtual void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
93 virtual int CanReadFile(
const char* filename) VTK_OVERRIDE;
106 return "NRRD - Nearly Raw Raster Data";
113 vtkGetMacro(ReadStatus,
int);
117 vtkSetMacro(PointDataType,
int);
118 vtkGetMacro(PointDataType,
int);
122 vtkSetMacro(DataType,
int);
123 vtkGetMacro(DataType,
int);
127 vtkSetMacro(NumberOfComponents,
int);
128 vtkGetMacro(NumberOfComponents,
int);
135 UseNativeOrigin =
true;
142 UseNativeOrigin =
false;
147 switch( nrrdPixelType )
150 case nrrdTypeDefault:
157 return VTK_UNSIGNED_CHAR;
163 return VTK_UNSIGNED_SHORT;
175 return VTK_UNSIGNED_INT;
191 switch( vtkPixelType )
195 return nrrdTypeDefault;
200 case VTK_UNSIGNED_CHAR:
201 return nrrdTypeUChar;
204 return nrrdTypeShort;
206 case VTK_UNSIGNED_SHORT:
207 return nrrdTypeUShort;
218 case VTK_UNSIGNED_INT:
222 return nrrdTypeFloat;
225 return nrrdTypeDouble;
229 virtual vtkImageData * AllocateOutputData(vtkDataObject *out, vtkInformation* outInfo) VTK_OVERRIDE;
230 virtual void AllocateOutputData(vtkImageData *out, vtkInformation* outInfo,
int *uExtent) VTK_OVERRIDE
231 { Superclass::AllocateOutputData(out, outInfo, uExtent); }
232 void AllocatePointData(vtkImageData *out, vtkInformation* outInfo);
238 static bool GetPointType(Nrrd* nrrdTemp,
int& pointDataType,
int &numOfComponents);
261 virtual void ExecuteInformation() VTK_OVERRIDE;
262 virtual
void ExecuteDataWithInformation(vtkDataObject *output, vtkInformation* outInfo) VTK_OVERRIDE;
264 int tenSpaceDirectionReduce(Nrrd *nout, const Nrrd *nin,
double SD[9]);
268 void operator=(const vtkNRRDReader&);
Reads Nearly Raw Raster Data files.
std::map< std::string, std::string > HeaderKeyValue
void SetUseNativeOriginOff()
Use image center as origin.
int NrrdToVTKScalarType(const int nrrdPixelType) const
std::map< unsigned int, std::string > AxisLabels
std::map< unsigned int, std::string > AxisUnits
std::string CurrentFileName
virtual void AllocateOutputData(vtkImageData *out, vtkInformation *outInfo, int *uExtent) VTK_OVERRIDE
vtkSmartPointer< vtkMatrix4x4 > NRRDWorldToRasMatrix
vtkSmartPointer< vtkMatrix4x4 > MeasurementFrameMatrix
int VTKToNrrdPixelType(const int vtkPixelType) const
void SetUseNativeOriginOn()
Use image origin from the file.
virtual const char * GetFileExtensions() VTK_OVERRIDE
Valid extentsions.
virtual const char * GetDescriptiveName() VTK_OVERRIDE
A descriptive name for this format.
vtkSmartPointer< vtkMatrix4x4 > RasToIjkMatrix