VTK
vtkImageWriter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImageWriter.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
26 #ifndef vtkImageWriter_h
27 #define vtkImageWriter_h
28 
29 #include "vtkIOImageModule.h" // For export macro
30 #include "vtkImageAlgorithm.h"
31 
32 class VTKIOIMAGE_EXPORT vtkImageWriter : public vtkImageAlgorithm
33 {
34 public:
35  static vtkImageWriter *New();
37  void PrintSelf(ostream& os, vtkIndent indent);
38 
40 
45  vtkSetStringMacro(FileName);
46  vtkGetStringMacro(FileName);
48 
50 
55  vtkSetStringMacro(FilePrefix);
56  vtkGetStringMacro(FilePrefix);
58 
60 
63  vtkSetStringMacro(FilePattern);
64  vtkGetStringMacro(FilePattern);
66 
68 
73  vtkSetMacro(FileDimensionality, int);
74  vtkGetMacro(FileDimensionality, int);
76 
81 
85  virtual void Write();
86 
87  void DeleteFiles();
88 
89 protected:
91  ~vtkImageWriter();
92 
94  char *FilePrefix;
95  char *FilePattern;
96  char *FileName;
100 
101  virtual void RecursiveWrite(int dim,
102  vtkImageData *region,
103  vtkInformation*inInfo,
104  ofstream *file);
105  virtual void RecursiveWrite(int dim,
106  vtkImageData *cache,
108  vtkInformation* inInfo,
109  ofstream *file);
110  virtual void WriteFile(ofstream *file, vtkImageData *data,
111  int extent[6], int wExtent[6]);
112  virtual void WriteFileHeader(ofstream *, vtkImageData *, int [6]) {}
113  virtual void WriteFileTrailer(ofstream *, vtkImageData *) {}
114 
115  // This is called by the superclass.
116  // This is the method you should override.
117  virtual int RequestData(vtkInformation *request,
118  vtkInformationVector** inputVector,
119  vtkInformationVector* outputVector);
120 
124 
125 private:
126  vtkImageWriter(const vtkImageWriter&) VTK_DELETE_FUNCTION;
127  void operator=(const vtkImageWriter&) VTK_DELETE_FUNCTION;
128 };
129 
130 #endif
virtual void WriteFileTrailer(ofstream *, vtkImageData *)
Store vtkAlgorithm input/output information.
vtkDataObject * GetInput()
Get a data object for one of the input port connections.
a simple class to control print indentation
Definition: vtkIndent.h:39
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
Writes images to files.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
Generic algorithm superclass for image algs.
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called in response to a REQUEST_DATA request from the executive.
char * InternalFileName
virtual void WriteFileHeader(ofstream *, vtkImageData *, int[6])