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  size_t InternalFileNameSize;
104 
105  // Required for subclasses that need to prevent the writer
106  // from touching the file system. The getter/setter are only
107  // available in these subclasses.
108  unsigned int WriteToMemory;
109 
110  virtual void RecursiveWrite(int dim,
111  vtkImageData *region,
112  vtkInformation*inInfo,
113  ofstream *file);
114  virtual void RecursiveWrite(int dim,
115  vtkImageData *cache,
117  vtkInformation* inInfo,
118  ofstream *file);
119  virtual void WriteFile(ofstream *file, vtkImageData *data,
120  int extent[6], int wExtent[6]);
121  virtual void WriteFileHeader(ofstream *, vtkImageData *, int [6]) {}
122  virtual void WriteFileTrailer(ofstream *, vtkImageData *) {}
123 
124  // This is called by the superclass.
125  // This is the method you should override.
126  int RequestData(vtkInformation *request,
127  vtkInformationVector** inputVector,
128  vtkInformationVector* outputVector) VTK_OVERRIDE;
129 
133 
134 private:
135  vtkImageWriter(const vtkImageWriter&) VTK_DELETE_FUNCTION;
136  void operator=(const vtkImageWriter&) VTK_DELETE_FUNCTION;
137 };
138 
139 #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.