18 #ifndef __itkMRCImageIO_h
19 #define __itkMRCImageIO_h
80 virtual bool CanReadFile(
const char *);
83 virtual void ReadImageInformation();
86 virtual void Read(
void *buffer);
96 virtual bool CanWriteFile(
const char *);
99 virtual void Write(
const void *buffer);
109 void PrintSelf(std::ostream & os,
Indent indent)
const;
116 virtual SizeType GetHeaderSize(
void)
const;
121 void operator=(
const Self &);
125 template<
typename TPixelType >
126 void UpdateHeaderWithMinMaxMean(
const TPixelType *bufferBegin)
128 typedef const TPixelType *ConstPixelPointer;
130 ConstPixelPointer bufferEnd = bufferBegin + m_IORegion.GetNumberOfPixels();
134 std::pair< ConstPixelPointer, ConstPixelPointer > mm =
137 double mean = std::accumulate( bufferBegin, bufferEnd,
double(0.0) )
138 / std::distance(bufferBegin, bufferEnd);
140 m_MRCHeader->m_Header.amin = float(*mm.first);
141 m_MRCHeader->m_Header.amax = float(*mm.second);
142 m_MRCHeader->m_Header.amean = float(mean);
145 void UpdateHeaderWithMinMaxMean(
const void *bufferBegin);
149 void UpdateHeaderFromImageIO(
void);
152 void InternalReadImageInformation(std::ifstream & is);
154 virtual void WriteImageInformation(
const void *bufferBegin);