Go to the documentation of this file.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
00108
00109 virtual unsigned int
00110 GetActualNumberOfSplitsForWriting(unsigned int numberOfRequestedSplits,
00111 const ImageIORegion &pasteRegion,
00112 const ImageIORegion &largestPossibleRegion);
00113
00114 virtual ImageIORegion
00115 GetSplitRegionForWriting(unsigned int ithPiece,
00116 unsigned int numberOfActualSplits,
00117 const ImageIORegion &pasteRegion,
00118 const ImageIORegion &largestPossibleRegion);
00119
00123 virtual bool CanStreamRead()
00124 {
00125 if( m_MetaImage.CompressedData() )
00126 {
00127 return false;
00128 }
00129 return true;
00130 }
00132
00138 virtual bool CanStreamWrite()
00139 {
00140 if( this->GetUseCompression() )
00141 {
00142 return false;
00143 }
00144 return true;
00145 }
00147
00151 itkSetMacro(SubSamplingFactor,unsigned int);
00152 itkGetConstMacro(SubSamplingFactor,unsigned int);
00154
00155 protected:
00156 MetaImageIO();
00157 ~MetaImageIO();
00158 void PrintSelf(std::ostream& os, Indent indent) const;
00159
00160 private:
00161
00162 MetaImage m_MetaImage;
00163
00164 MetaImageIO(const Self&);
00165 void operator=(const Self&);
00166
00167 unsigned int m_SubSamplingFactor;
00168
00169 };
00170
00171 }
00172
00173 #endif // __itkMetaImageIO_h
00174