Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkMetaImageIO.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkMetaImageIO.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-06-14 12:30:13 $
00007   Version:   $Revision: 1.38 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
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   /*-------- This part of the interfaces deals with reading data. ----- */
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   /*-------- This part of the interfaces deals with writing data. ----- */
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&); //purposely not implemented
00165   void operator=(const Self&); //purposely not implemented
00166 
00167   unsigned int m_SubSamplingFactor;
00168   
00169 };
00170 
00171 } // end namespace itk
00172 
00173 #endif // __itkMetaImageIO_h
00174 

Generated at Tue Sep 15 03:57:49 2009 for ITK by doxygen 1.5.8 written by Dimitri van Heesch, © 1997-2000