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 __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
00059
00060
00061 virtual bool CanStreamWrite( void );
00062
00063
00064
00065
00066 virtual bool CanStreamRead( void );
00067
00068
00069
00070
00071
00072 virtual ImageIORegion GenerateStreamableReadRegionFromRequestedRegion( const ImageIORegion & requested ) const;
00073
00074
00075
00076
00077
00078 virtual unsigned int GetActualNumberOfSplitsForWriting( unsigned int numberOfRequestedSplits,
00079 const ImageIORegion &pasteRegion,
00080 const ImageIORegion &largestPossibleRegion );
00081
00082 protected:
00083 StreamingImageIOBase();
00084
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&);
00174 void operator=(const Self&);
00175
00176
00177 };
00178
00179 }
00180
00181
00182 #endif
00183