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: 2007/09/11 12:16:58 $
00007   Version:   $Revision: 1.34 $
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 
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&); //purposely not implemented
00139   void operator=(const Self&); //purposely not implemented
00140 
00141   unsigned int m_SubSamplingFactor;
00142   
00143 };
00144 
00145 } // end namespace itk
00146 
00147 #endif // __itkMetaImageIO_h
00148 

Generated at Wed Nov 5 22:52:10 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000