VTK  9.0.3
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) 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() override;
92 
94  char* FilePrefix;
95  char* FilePattern;
96  char* FileName;
101 
102  virtual void RecursiveWrite(int dim, vtkImageData* region, vtkInformation* inInfo, ostream* file);
103  virtual void RecursiveWrite(
104  int dim, vtkImageData* cache, vtkImageData* data, vtkInformation* inInfo, ostream* file);
105  virtual void WriteFile(ostream* file, vtkImageData* data, int extent[6], int wExtent[6]);
106  virtual void WriteFileHeader(ostream*, vtkImageData*, int[6]) {}
107  virtual void WriteFileTrailer(ostream*, vtkImageData*) {}
108 
109  // Required for subclasses that need to prevent the writer
110  // from touching the file system. The getter/setter are only
111  // available in these subclasses.
113 
114  // subclasses that do write to memory can override this
115  // to implement the simple case
116  virtual void MemoryWrite(int, vtkImageData*, int[6], vtkInformation*) {}
117 
118  // This is called by the superclass.
119  // This is the method you should override.
120  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
121  vtkInformationVector* outputVector) override;
122 
126 
127 private:
128  vtkImageWriter(const vtkImageWriter&) = delete;
129  void operator=(const vtkImageWriter&) = delete;
130 };
131 
132 #endif
Generic algorithm superclass for image algs.
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
Writes images to files.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
char * InternalFileName
static vtkImageWriter * New()
size_t InternalFileNameSize
virtual void MemoryWrite(int, vtkImageData *, int[6], vtkInformation *)
virtual void RecursiveWrite(int dim, vtkImageData *region, vtkInformation *inInfo, ostream *file)
virtual void WriteFileHeader(ostream *, vtkImageData *, int[6])
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called in response to a REQUEST_DATA request from the executive.
virtual void Write()
The main interface which triggers the writer to start.
vtkTypeUBool WriteToMemory
void DeleteFiles()
~vtkImageWriter() override
virtual void RecursiveWrite(int dim, vtkImageData *cache, vtkImageData *data, vtkInformation *inInfo, ostream *file)
virtual void WriteFileTrailer(ostream *, vtkImageData *)
vtkImageData * GetInput()
Set/Get the input object from the image pipeline.
virtual void WriteFile(ostream *file, vtkImageData *data, int extent[6], int wExtent[6])
a simple class to control print indentation
Definition: vtkIndent.h:34
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
@ extent
Definition: vtkX3D.h:351
@ data
Definition: vtkX3D.h:321
unsigned int vtkTypeUBool
Definition: vtkABI.h:70