]> Creatis software - clitk.git/blob - vv/nkitkXDRImageIO.h
Synergy projections file format
[clitk.git] / vv / nkitkXDRImageIO.h
1 #ifndef NKITKXDRIMAGEIO_H
2 #define NKITKXDRIMAGEIO_H
3
4 /**
5  * @file   nkitkXDRImageIO.h
6  * @author Simon Rit <simon.rit@gmail.com>
7  * @date   Sun Jun  1 22:07:45 2008
8  *
9  * @brief
10  *
11  *
12  */
13
14 // itk include
15 #include "itkImageIOBase.h"
16
17 namespace nkitk {
18
19 //====================================================================
20 // Class for reading XDR Image file format
21 class XDRImageIO: public itk::ImageIOBase
22 {
23 public:
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;
30
31     XDRImageIO():Superclass() {
32         forcenoswap = 0;
33     }
34
35     /** Method for creation through the object factory. */
36     itkNewMacro(Self);
37
38     /** Run-time type information (and related methods). */
39     itkTypeMacro(XDRImageIO, ImageIOBase);
40
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 );
47
48     /*-------- This part of the interfaces deals with writing data. ----- */
49     virtual void WriteImageInformation(bool keepOfStream) {
50         ;
51     }
52     virtual void WriteImageInformation() {
53         WriteImageInformation(false);
54     }
55     virtual bool CanWriteFile(const char* filename) {
56         return false;
57     }
58     virtual void Write(const void* buffer) {
59         ;
60     }
61
62 protected:
63     void ITKError(std::string funcName, int msgID);
64
65     int m_HeaderSize;
66     int forcenoswap;
67 }; // end class XDRImageIO
68
69 } // end namespace
70
71 // explicit template instantiation
72 template class itk::CreateObjectFunction<nkitk::XDRImageIO>;
73
74 #endif /* end #define NKITKXDRIMAGEIO_H */
75