1 #ifndef NKITKXDRIMAGEIO_H
2 #define NKITKXDRIMAGEIO_H
5 * @file nkitkXDRImageIO.h
6 * @author Simon Rit <simon.rit@gmail.com>
7 * @date Sun Jun 1 22:07:45 2008
15 #include "itkImageIOBase.h"
19 //====================================================================
20 // Class for reading XDR Image file format
21 class XDRImageIO: public itk::ImageIOBase
24 /** Standard class typedefs. */
25 typedef XDRImageIO Self;
26 typedef itk::ImageIOBase Superclass;
27 typedef itk::SmartPointer<Self> Pointer;
28 typedef signed short int PixelType;
29 typedef enum {UNIFORM,RECTILINEAR,IRREGULAR} AVSType;
31 XDRImageIO():Superclass() {
35 /** Method for creation through the object factory. */
38 /** Run-time type information (and related methods). */
39 itkTypeMacro(XDRImageIO, ImageIOBase);
41 /*-------- This part of the interface deals with reading data. ------ */
42 virtual int ReadImageInformationWithError();
43 virtual int ReadWithError(void * buffer);
44 virtual void ReadImageInformation();
45 virtual void Read(void * buffer);
46 virtual bool CanReadFile( const char* FileNameToRead );
48 /*-------- This part of the interfaces deals with writing data. ----- */
49 virtual void WriteImageInformation(bool keepOfStream) {
52 virtual void WriteImageInformation() {
53 WriteImageInformation(false);
55 virtual bool CanWriteFile(const char* filename) {
58 virtual void Write(const void* buffer) {
63 void ITKError(std::string funcName, int msgID);
67 }; // end class XDRImageIO
71 // explicit template instantiation
72 template class itk::CreateObjectFunction<nkitk::XDRImageIO>;
74 #endif /* end #define NKITKXDRIMAGEIO_H */