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

itkStreamingImageIOBase.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkStreamingImageIOBase.h,v $
00005   Language:  C++
00006   Date:      $Date: 2010-06-14 15:00:28 $
00007   Version:   $Revision: 1.3 $
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 __itkStreamingImageIOBase_h
00018 #define __itkStreamingImageIOBase_h
00019 
00020 #include "itkImageIOBase.h"
00021 
00022 #include <fstream>
00023 
00024 namespace itk
00025 {
00026 
00047 class ITK_EXPORT StreamingImageIOBase : public ImageIOBase
00048 {
00049 public:
00051   typedef StreamingImageIOBase Self;
00052   typedef ImageIOBase          Superclass;
00053   typedef SmartPointer<Self>   Pointer;
00054 
00056   itkTypeMacro(StreamingImageIOBase, ImageIOBase);
00057 
00058   // see super class for documentation
00059   // 
00060   // overidden to return true
00061   virtual bool CanStreamWrite( void );
00062 
00063   // see super class for documentation
00064   //
00065   // overidden to return true
00066   virtual bool CanStreamRead( void );
00067 
00068   // see super class for documentation
00069   //
00070   // If UseStreamedReading is true, then returned region is the
00071   // requested region parameter. 
00072   virtual ImageIORegion GenerateStreamableReadRegionFromRequestedRegion( const ImageIORegion & requested ) const;
00073 
00074   // see super class for documentation
00075   //
00076   // Verifies the set file name meets the pasting requirements, then calls
00077   // GetActualNumberOfSplitsForWritingCanStreamWrite 
00078   virtual unsigned int GetActualNumberOfSplitsForWriting( unsigned int numberOfRequestedSplits,
00079                                                           const ImageIORegion &pasteRegion,
00080                                                           const ImageIORegion &largestPossibleRegion );
00081     
00082 protected:
00083   StreamingImageIOBase();
00084   // virtual ~StreamingImageIOBase(); not needed
00085   virtual void PrintSelf(std::ostream& os, Indent indent) const;
00086 
00087   
00095   virtual bool RequestedToStream( void ) const;
00096   
00097 
00103   virtual bool ReadBufferAsBinary( std::istream& is, void *buffer, SizeType num );
00104 
00105   
00111   virtual bool WriteBufferAsBinary( std::ostream& is, const void *buffer, SizeType num );
00112 
00113   
00130   virtual bool StreamReadBufferAsBinary(std::istream& os, void *buffer);
00131   
00143   virtual bool StreamWriteBufferAsBinary(std::ostream& os, const void *buffer);
00144 
00145 
00147   virtual SizeType GetHeaderSize(void ) const = 0;
00148 
00153   virtual SizeType GetDataPosition( void ) const { return this->GetHeaderSize(); };
00154 
00155   
00161   virtual void OpenFileForReading(std::ifstream& os, const char* filename);
00162 
00170   virtual void OpenFileForWriting(std::ofstream& os, const char* filename, bool truncate);
00171 
00172 private:
00173   StreamingImageIOBase(const Self&); //purposely not implemented
00174   void operator=(const Self&); //purposely not implemented
00175 
00176 
00177 };
00178 
00179 } // namespace itk
00180 
00181 
00182 #endif
00183 

Generated at Mon Jul 12 2010 19:59:39 for ITK by doxygen 1.7.1 written by Dimitri van Heesch, © 1997-2000