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) VTK_OVERRIDE;
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() VTK_OVERRIDE;
92 
93  int FileDimensionality;
94  char *FilePrefix;
95  char *FilePattern;
96  char *FileName;
97  int FileNumber;
98  int FileLowerLeft;
99  char *InternalFileName;
100  // Required for subclasses that need to prevent the writer
101  // from touching the file system. The getter/setter are only
102  // available in these subclasses.
103  unsigned int WriteToMemory;
104 
105  virtual void RecursiveWrite(int dim,
106  vtkImageData *region,
107  vtkInformation*inInfo,
108  ofstream *file);
109  virtual void RecursiveWrite(int dim,
110  vtkImageData *cache,
112  vtkInformation* inInfo,
113  ofstream *file);
114  virtual void WriteFile(ofstream *file, vtkImageData *data,
115  int extent[6], int wExtent[6]);
116  virtual void WriteFileHeader(ofstream *, vtkImageData *, int [6]) {}
117  virtual void WriteFileTrailer(ofstream *, vtkImageData *) {}
118 
119  // This is called by the superclass.
120  // This is the method you should override.
121  int RequestData(vtkInformation *request,
122  vtkInformationVector** inputVector,
123  vtkInformationVector* outputVector) VTK_OVERRIDE;
124 
128 
129 private:
130  vtkImageWriter(const vtkImageWriter&) VTK_DELETE_FUNCTION;
131  void operator=(const vtkImageWriter&) VTK_DELETE_FUNCTION;
132 };
133 
134 #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:33
topologically and geometrically regular array of data
Definition: vtkImageData.h:39
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.