32 #ifndef __itkIPLCommonImageIO_h
33 #define __itkIPLCommonImageIO_h
57 typedef unsigned char U8;
58 typedef signed char S8;
59 typedef unsigned short U16;
60 typedef signed short S16;
61 typedef unsigned int U32;
62 typedef signed int S32;
82 virtual bool CanReadFile(
const char *FileNameToRead);
85 virtual void ReadImageInformation();
91 virtual void Read(
void *buffer);
96 virtual unsigned int GetComponentSize()
const;
106 virtual bool CanWriteFile(
const char *FileNameToWrite);
109 virtual void WriteImageInformation();
113 virtual void Write(
const void *buffer);
116 virtual void SortImageListByNameAscend();
119 virtual void SortImageListByNameDescend();
124 void PrintSelf(std::ostream & os,
Indent indent)
const;
126 int AddElementToList(
char const *
const filename,
127 const float sliceLocation,
136 void sortImageListAscend();
138 void sortImageListDescend();
140 int statTimeToAscii(
void *clock,
char *timeString,
int len);
142 virtual GEImageHeader * ReadHeader(
const char *FileNameToRead);
151 int GetStringAt(std::ifstream & f, std::streamoff
Offset,
char *buf,
152 size_t amount,
bool throw_exception =
true);
154 int GetIntAt(std::ifstream & f, std::streamoff
Offset,
int *ip,
155 bool throw_exception =
true);
157 int GetShortAt(std::ifstream & f, std::streamoff
Offset,
short *ip,
158 bool throw_exception =
true);
160 int GetFloatAt(std::ifstream & f, std::streamoff
Offset,
float *ip,
161 bool throw_exception =
true);
163 int GetDoubleAt(std::ifstream & f, std::streamoff
Offset,
double *ip,
164 bool throw_exception =
true);
166 short hdr2Short(
char *hdr);
168 int hdr2Int(
char *hdr);
170 float hdr2Float(
char *hdr);
172 double hdr2Double(
char *hdr);
176 void operator=(
const Self &);
179 #define RAISE_EXCEPTION() \
180 { ExceptionObject exception(__FILE__, __LINE__); \
181 exception.SetDescription("File cannot be read"); \
194 #endif // __itkAnalyzeImageIO_h