00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkMetaImageIO_h
00018 #define __itkMetaImageIO_h
00019
00020 #ifdef _MSC_VER
00021 #pragma warning ( disable : 4786 )
00022 #endif
00023
00024 #include <fstream>
00025 #include "itkImageIOBase.h"
00026 #include "metaObject.h"
00027 #include "metaImage.h"
00028
00029 namespace itk
00030 {
00031
00038 class ITK_EXPORT MetaImageIO : public ImageIOBase
00039 {
00040 public:
00042 typedef MetaImageIO Self;
00043 typedef ImageIOBase Superclass;
00044 typedef SmartPointer<Self> Pointer;
00045
00047 itkNewMacro(Self);
00048
00050 itkTypeMacro(MetaImageIO, Superclass);
00051
00057 virtual bool SupportsDimension(unsigned long )
00058 {
00059 return true;
00060 }
00061
00062
00063
00066 virtual bool CanReadFile(const char*);
00067
00069 virtual void ReadImageInformation();
00070
00072 virtual void Read(void* buffer);
00073
00074 MetaImage * GetMetaImagePointer(void);
00075
00076
00077
00080 virtual bool CanWriteFile(const char*);
00081
00083 virtual void WriteImageInformation();
00084
00087 virtual void Write(const void* buffer);
00088
00092 virtual void SetDataFileName( const char * filename );
00093
00096 virtual void SetDoublePrecision(unsigned int precision)
00097 {
00098 m_MetaImage.SetDoublePrecision(precision);
00099 }
00100
00105 virtual ImageIORegion
00106 GenerateStreamableReadRegionFromRequestedRegion( const ImageIORegion & requested ) const;
00107
00110 virtual bool CanStreamRead()
00111 {
00112 return true;
00113 }
00114
00117 virtual bool CanStreamWrite()
00118 {
00119 return false;
00120 }
00121
00125 itkSetMacro(SubSamplingFactor,unsigned int);
00126 itkGetMacro(SubSamplingFactor,unsigned int);
00128
00129 protected:
00130 MetaImageIO();
00131 ~MetaImageIO();
00132 void PrintSelf(std::ostream& os, Indent indent) const;
00133
00134 private:
00135
00136 MetaImage m_MetaImage;
00137
00138 MetaImageIO(const Self&);
00139 void operator=(const Self&);
00140
00141 unsigned int m_SubSamplingFactor;
00142
00143 };
00144
00145 }
00146
00147 #endif // __itkMetaImageIO_h
00148