00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkGiplImageIO_h
00018 #define __itkGiplImageIO_h
00019
00020 #include <fstream>
00021 #include "itkImageIOBase.h"
00022 #include <stdio.h>
00023
00024 namespace itk
00025 {
00026
00032 class ITK_EXPORT GiplImageIO : public ImageIOBase
00033 {
00034 public:
00036 typedef GiplImageIO Self;
00037 typedef ImageIOBase Superclass;
00038 typedef SmartPointer<Self> Pointer;
00039
00041 itkNewMacro(Self);
00042
00044 itkTypeMacro(GiplImageIO, Superclass);
00045
00046
00047
00050 virtual bool CanReadFile(const char*) ;
00051
00053 virtual void ReadImageInformation();
00054
00056 virtual const std::type_info& GetPixelType() const;
00057
00059 virtual void Read(void* buffer);
00060
00064 virtual unsigned int GetComponentSize() const;
00065
00066
00067
00070 virtual bool CanWriteFile(const char*);
00071
00073 virtual void WriteImageInformation();
00074
00077 virtual void Write(const void* buffer);
00078
00079
00080 GiplImageIO();
00081 ~GiplImageIO();
00082 void PrintSelf(std::ostream& os, Indent indent) const;
00083
00084 private:
00085 GiplImageIO(const Self&);
00086 void operator=(const Self&);
00087
00088 void SwapBytesIfNecessary(void* buffer, unsigned long numberOfPixels);
00089
00090 std::ifstream m_Ifstream;
00091 std::ofstream m_Ofstream;
00092
00093 };
00094
00095 }
00096
00097 #endif // __itkGiplImageIO_h