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 void PrintSelf(ostream& os, vtkIndent indent)
override;
98 int CanReadFile(
const char* filename)
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 vtkImageData * AllocateOutputData(vtkDataObject *out, vtkInformation* outInfo)
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 void ExecuteInformation()
override;
267 void ExecuteDataWithInformation(vtkDataObject *output, vtkInformation* outInfo)
override;
269 int tenSpaceDirectionReduce(Nrrd *nout,
const Nrrd *nin,
double SD[9]);
const char * GetFileExtensions() override
Valid extentsions
vtkSmartPointer< vtkMatrix4x4 > NRRDWorldToRasMatrix
vtkSmartPointer< vtkMatrix4x4 > MeasurementFrameMatrix
std::string CurrentFileName
void AllocateOutputData(vtkImageData *out, vtkInformation *outInfo, int *uExtent) override
std::map< std::string, std::string > HeaderKeyValue
std::map< unsigned int, std::string > AxisLabels
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
const char * GetDescriptiveName() override
A descriptive name for this format