VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/dox/IO/Image/vtkImageWriter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkImageWriter.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00025 #ifndef vtkImageWriter_h
00026 #define vtkImageWriter_h
00027 
00028 #include "vtkIOImageModule.h" // For export macro
00029 #include "vtkImageAlgorithm.h"
00030 
00031 class VTKIOIMAGE_EXPORT vtkImageWriter : public vtkImageAlgorithm
00032 {
00033 public:
00034   static vtkImageWriter *New();
00035   vtkTypeMacro(vtkImageWriter,vtkImageAlgorithm);
00036   void PrintSelf(ostream& os, vtkIndent indent);
00037 
00039 
00042   vtkSetStringMacro(FileName);
00043   vtkGetStringMacro(FileName);
00045 
00047 
00050   vtkSetStringMacro(FilePrefix);
00051   vtkGetStringMacro(FilePrefix);
00053 
00055 
00056   vtkSetStringMacro(FilePattern);
00057   vtkGetStringMacro(FilePattern);
00059 
00061 
00064   vtkSetMacro(FileDimensionality, int);
00065   vtkGetMacro(FileDimensionality, int);
00067 
00068 //BTX
00070 
00071   vtkImageData *GetInput();
00072 //ETX
00074 
00076   virtual void Write();
00077 
00078   void DeleteFiles();
00079 
00080 protected:
00081   vtkImageWriter();
00082   ~vtkImageWriter();
00083 
00084   int FileDimensionality;
00085   char *FilePrefix;
00086   char *FilePattern;
00087   char *FileName;
00088   int FileNumber;
00089   int FileLowerLeft;
00090   char *InternalFileName;
00091 
00092   virtual void RecursiveWrite(int dim,
00093                               vtkImageData *region,
00094                               vtkInformation*inInfo,
00095                               ofstream *file);
00096   virtual void RecursiveWrite(int dim,
00097                               vtkImageData *cache,
00098                               vtkImageData *data,
00099                               vtkInformation* inInfo,
00100                               ofstream *file);
00101   virtual void WriteFile(ofstream *file, vtkImageData *data,
00102                          int extent[6], int wExtent[6]);
00103   virtual void WriteFileHeader(ofstream *, vtkImageData *, int [6]) {}
00104   virtual void WriteFileTrailer(ofstream *, vtkImageData *) {}
00105 
00106   // This is called by the superclass.
00107   // This is the method you should override.
00108   virtual int RequestData(vtkInformation *request,
00109                           vtkInformationVector** inputVector,
00110                           vtkInformationVector* outputVector);
00111 
00112   int MinimumFileNumber;
00113   int MaximumFileNumber;
00114   int FilesDeleted;
00115 
00116 private:
00117   vtkImageWriter(const vtkImageWriter&);  // Not implemented.
00118   void operator=(const vtkImageWriter&);  // Not implemented.
00119 };
00120 
00121 #endif