29 #ifndef __vtkTeemNRRDReader_h 30 #define __vtkTeemNRRDReader_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 const std::vector<std::string> GetHeaderKeysVector();
83 const std::map<std::string, std::string> GetHeaderKeysMap();
87 const char* GetHeaderValue(
const char *key);
90 const char* GetAxisLabel(
unsigned int axis);
93 const char* GetAxisUnit(
unsigned int axis);
95 virtual void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
98 virtual int CanReadFile(
const char* filename) VTK_OVERRIDE;
104 return ".nhdr .nrrd";
111 return "NRRD - Nearly Raw Raster Data";
118 vtkGetMacro(ReadStatus,
int);
122 vtkSetMacro(PointDataType,
int);
123 vtkGetMacro(PointDataType,
int);
127 vtkSetMacro(DataType,
int);
128 vtkGetMacro(DataType,
int);
132 vtkSetMacro(NumberOfComponents,
int);
133 vtkGetMacro(NumberOfComponents,
int);
140 UseNativeOrigin =
true;
147 UseNativeOrigin =
false;
152 switch( nrrdPixelType )
155 case nrrdTypeDefault:
162 return VTK_UNSIGNED_CHAR;
168 return VTK_UNSIGNED_SHORT;
180 return VTK_UNSIGNED_INT;
196 switch( vtkPixelType )
200 return nrrdTypeDefault;
205 case VTK_UNSIGNED_CHAR:
206 return nrrdTypeUChar;
209 return nrrdTypeShort;
211 case VTK_UNSIGNED_SHORT:
212 return nrrdTypeUShort;
223 case VTK_UNSIGNED_INT:
227 return nrrdTypeFloat;
230 return nrrdTypeDouble;
234 virtual vtkImageData * AllocateOutputData(vtkDataObject *out, vtkInformation* outInfo) VTK_OVERRIDE;
235 virtual void AllocateOutputData(vtkImageData *out, vtkInformation* outInfo,
int *uExtent) VTK_OVERRIDE
236 { Superclass::AllocateOutputData(out, outInfo, uExtent); }
237 void AllocatePointData(vtkImageData *out, vtkInformation* outInfo);
243 static bool GetPointType(Nrrd* nrrdTemp,
int& pointDataType,
int &numOfComponents);
266 virtual void ExecuteInformation() VTK_OVERRIDE;
267 virtual
void ExecuteDataWithInformation(vtkDataObject *output, vtkInformation* outInfo) VTK_OVERRIDE;
269 int tenSpaceDirectionReduce(Nrrd *nout, const Nrrd *nin,
double SD[9]);
vtkSmartPointer< vtkMatrix4x4 > NRRDWorldToRasMatrix
virtual const char * GetFileExtensions() VTK_OVERRIDE
Valid extentsions
virtual const char * GetDescriptiveName() VTK_OVERRIDE
A descriptive name for this format
vtkSmartPointer< vtkMatrix4x4 > MeasurementFrameMatrix
std::string CurrentFileName
std::map< std::string, std::string > HeaderKeyValue
std::map< unsigned int, std::string > AxisLabels
virtual void AllocateOutputData(vtkImageData *out, vtkInformation *outInfo, int *uExtent) VTK_OVERRIDE
int NrrdToVTKScalarType(const int nrrdPixelType) const
std::map< unsigned int, std::string > AxisUnits
vtkSmartPointer< vtkMatrix4x4 > RasToIjkMatrix
Reads Nearly Raw Raster Data files.
void SetUseNativeOriginOff()
Use image center as origin
void SetUseNativeOriginOn()
Use image origin from the file
int VTKToNrrdPixelType(const int vtkPixelType) const