18 #ifndef itkMGHImageIO_h
19 #define itkMGHImageIO_h
26 #include "MGHIOExport.h"
61 virtual bool CanReadFile(
const char *FileNameToRead) ITK_OVERRIDE;
64 virtual void ReadImageInformation() ITK_OVERRIDE;
67 virtual
void Read(
void *buffer) ITK_OVERRIDE;
76 virtual
bool CanWriteFile(const
char *FileNameToWrite) ITK_OVERRIDE;
79 virtual
void WriteImageInformation() ITK_OVERRIDE;
83 virtual
void Write(const
void *buffer) ITK_OVERRIDE;
88 void PrintSelf(std::ostream& os,
Indent indent) const ITK_OVERRIDE;
90 void ReadVolumeHeader();
93 static const
int MRI_UCHAR = 0;
94 static const
int MRI_INT = 1;
95 static const
int MRI_FLOAT = 3;
96 static const
int MRI_SHORT = 4;
97 static const
int MRI_TENSOR = 6;
98 static const
unsigned int FS_DIMENSION_HEADER_SIZE = sizeof(
int) * 7;
99 static const
unsigned int FS_RAS_HEADER_SIZE = (sizeof(
float) * 15) + sizeof(
short);
100 static const
unsigned int FS_UNUSED_HEADER_SIZE = 256 - FS_RAS_HEADER_SIZE;
101 static const
unsigned int FS_WHOLE_HEADER_SIZE =
102 FS_RAS_HEADER_SIZE + FS_DIMENSION_HEADER_SIZE + FS_UNUSED_HEADER_SIZE;
105 bool IsCompressedFilename(const std::
string fname);
107 void SwapBytesIfNecessary(
void * const buffer, const
unsigned long numberOfPixels);
115 void WriteData(const
void* buffer);
117 void PermuteFrameValues(const
void* buffer,
char* tempmemory);
119 unsigned int GetComponentSize() const ITK_OVERRIDE;
121 std::
string GetOrientation( itk::
Matrix<
double> directions );
125 std::ofstream m_Output;
129 template <typename TInType, typename TDiskType>
int TWrite(const TInType inValue);
130 template <typename TDiskType, typename TOutType>
int TRead(TOutType &outValue);
132 int TWrite(const
char *buf,const
unsigned long count);
138 #endif // itkMGHImageIO_h
A templated class holding a M x N size Matrix.
Light weight base class for most itk classes.
Abstract superclass defines image IO interface.
SmartPointer< Self > Pointer
Class that defines how to read MGH file format. Originally developed as part of the Slicer software p...
Control indentation during Print() invocation.
Base class for most ITK classes.