18 #ifndef itkMGHImageIO_h
19 #define itkMGHImageIO_h
26 #include "MGHIOExport.h"
61 bool CanReadFile(
const char *FileNameToRead)
override;
64 void ReadImageInformation()
override;
67 void Read(
void *buffer)
override;
76 bool CanWriteFile(
const char *FileNameToWrite)
override;
79 void WriteImageInformation()
override;
83 void Write(
const void *buffer)
override;
88 void PrintSelf(std::ostream& os,
Indent indent)
const 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 override;
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.
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.