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

itkVTKImageIO.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkVTKImageIO.h,v $
00005   Language:  C++
00006   Date:      $Date: 2002/08/23 21:20:26 $
00007   Version:   $Revision: 1.10 $
00008 
00009   Copyright (c) 2002 Insight Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012   Portions of this code are covered under the VTK copyright.
00013   See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details.
00014 
00015      This software is distributed WITHOUT ANY WARRANTY; without even 
00016      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00017      PURPOSE.  See the above copyright notices for more information.
00018 
00019 =========================================================================*/
00020 #ifndef __itkVTKImageIO_h
00021 #define __itkVTKImageIO_h
00022 
00023 #include <fstream>
00024 #include "itkImageIOBase.h"
00025 
00026 
00027 namespace itk
00028 {
00029 
00030 class ITK_EXPORT VTKImageIO : public ImageIOBase
00031 {
00032 public:
00034   typedef VTKImageIO            Self;
00035   typedef ImageIOBase  Superclass;
00036   typedef SmartPointer<Self>  Pointer;
00037   
00039   itkNewMacro(Self);
00040 
00042   itkTypeMacro(VTKImageIO, Superclass);
00043 
00044   /*-------- This part of the interface deals with reading data. ------ */
00045 
00048   virtual bool CanReadFile(const char*);
00049   
00051   virtual void ReadImageInformation();
00052   
00054   virtual void Read(void* buffer);
00055 
00056   /*-------- This part of the interfaces deals with writing data. ----- */
00057 
00060   virtual bool CanWriteFile(const char*);
00061 
00064   virtual void WriteImageInformation() {};
00065   
00068   virtual void Write(const void* buffer);
00069 
00070 protected:
00071   VTKImageIO();
00072   ~VTKImageIO();
00073   void PrintSelf(std::ostream& os, Indent indent) const;
00074 
00075   bool OpenVTKFileForReading(std::ifstream& os, const char* filename);
00076   bool OpenVTKFileForWriting(std::ofstream& os, const char* filename);
00077   void InternalReadImageInformation(std::ifstream& file);
00078 
00079 private:
00080   VTKImageIO(const Self&); //purposely not implemented
00081   void operator=(const Self&); //purposely not implemented
00082 };
00083 
00084 } // end namespace itk
00085 
00086 #endif // __itkVTKImageIO_h

Generated at Wed Mar 12 01:13:13 2003 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000