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 =========================================================================*/
29 #ifndef vtkImageWriter_h
30 #define vtkImageWriter_h
31 
32 #include "vtkIOImageModule.h" // For export macro
33 #include "vtkImageAlgorithm.h"
34 
35 class VTKIOIMAGE_EXPORT vtkImageWriter : public vtkImageAlgorithm
36 {
37 public:
38  static vtkImageWriter *New();
40  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
41 
43 
48  vtkSetStringMacro(FileName);
49  vtkGetStringMacro(FileName);
51 
53 
58  vtkSetStringMacro(FilePrefix);
59  vtkGetStringMacro(FilePrefix);
61 
63 
66  vtkSetStringMacro(FilePattern);
67  vtkGetStringMacro(FilePattern);
69 
71 
76  vtkSetMacro(FileDimensionality, int);
77  vtkGetMacro(FileDimensionality, int);
79 
84 
88  virtual void Write();
89 
90  void DeleteFiles();
91 
92 protected:
94  ~vtkImageWriter() VTK_OVERRIDE;
95 
96  int FileDimensionality;
97  char *FilePrefix;
98  char *FilePattern;
99  char *FileName;
100  int FileNumber;
101  int FileLowerLeft;
102  char *InternalFileName;
103  // Required for subclasses that need to prevent the writer
104  // from touching the file system. The getter/setter are only
105  // available in these subclasses.
106  unsigned int WriteToMemory;
107 
108  virtual void RecursiveWrite(int dim,
109  vtkImageData *region,
110  vtkInformation*inInfo,
111  ofstream *file);
112  virtual void RecursiveWrite(int dim,
113  vtkImageData *cache,
115  vtkInformation* inInfo,
116  ofstream *file);
117  virtual void WriteFile(ofstream *file, vtkImageData *data,
118  int extent[6], int wExtent[6]);
119  virtual void WriteFileHeader(ofstream *, vtkImageData *, int [6]) {}
120  virtual void WriteFileTrailer(ofstream *, vtkImageData *) {}
121 
122  // This is called by the superclass.
123  // This is the method you should override.
124  int RequestData(vtkInformation *request,
125  vtkInformationVector** inputVector,
126  vtkInformationVector* outputVector) VTK_OVERRIDE;
127 
131 
132 private:
133  vtkImageWriter(const vtkImageWriter&) VTK_DELETE_FUNCTION;
134  void operator=(const vtkImageWriter&) VTK_DELETE_FUNCTION;
135 };
136 
137 #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.