VTK  9.7.0
vtkImageWriter.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
16
17#ifndef vtkImageWriter_h
18#define vtkImageWriter_h
19
20#include "vtkIOImageModule.h" // For export macro
21#include "vtkImageAlgorithm.h"
22
23VTK_ABI_NAMESPACE_BEGIN
24class VTKIOIMAGE_EXPORT vtkImageWriter : public vtkImageAlgorithm
25{
26public:
29 void PrintSelf(ostream& os, vtkIndent indent) override;
30
32
40
42
50
52
55 virtual void SetFilePattern(VTK_FILEPATH const char*);
58
60
65 vtkSetMacro(FileDimensionality, int);
66 vtkGetMacro(FileDimensionality, int);
68
73
78 virtual void Write();
79
81
82protected:
84 ~vtkImageWriter() override;
85
89 char* FileName;
94
95 virtual void RecursiveWrite(int dim, vtkImageData* region, vtkInformation* inInfo, ostream* file);
96 virtual void RecursiveWrite(
97 int dim, vtkImageData* cache, vtkImageData* data, vtkInformation* inInfo, ostream* file);
98 virtual void WriteFile(ostream* file, vtkImageData* data, VTK_FUTURE_CONST int extent[6],
99 VTK_FUTURE_CONST int wExtent[6]);
100 virtual void WriteFileHeader(ostream*, vtkImageData*, VTK_FUTURE_CONST int[6]) {}
101 virtual void WriteFileTrailer(ostream*, vtkImageData*) {}
102
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.
107
108 // subclasses that do write to memory can override this
109 // to implement the simple case
110 virtual void MemoryWrite(int, vtkImageData*, VTK_FUTURE_CONST int[6], vtkInformation*) {}
111
112 // This is called by the superclass.
113 // This is the method you should override.
115 vtkInformationVector* outputVector) override;
116
120
121private:
122 vtkImageWriter(const vtkImageWriter&) = delete;
123 void operator=(const vtkImageWriter&) = delete;
124};
125
126VTK_ABI_NAMESPACE_END
127#endif
topologically and geometrically regular array of data
virtual void SetFilePattern(const char *)
The std::format or printf style format used to build filename from FilePrefix and number.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
char * InternalFileName
vtkGetFilePathMacro(FilePrefix)
Specify file prefix for the image file(s).You should specify either a FileName or FilePrefix.
vtkGetFilePathMacro(FilePattern)
The std::format or printf style format used to build filename from FilePrefix and number.
size_t InternalFileNameSize
virtual void RecursiveWrite(int dim, vtkImageData *region, vtkInformation *inInfo, ostream *file)
vtkGetFilePathMacro(FileName)
Specify file name for the image file.
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.
vtkSetFilePathMacro(FilePrefix)
Specify file prefix for the image file(s).You should specify either a FileName or FilePrefix.
vtkImageData * GetInput()
Set/Get the input object from the image pipeline.
virtual void MemoryWrite(int, vtkImageData *, VTK_FUTURE_CONST int[6], vtkInformation *)
vtkTypeUBool WriteToMemory
void DeleteFiles()
~vtkImageWriter() override
virtual void RecursiveWrite(int dim, vtkImageData *cache, vtkImageData *data, vtkInformation *inInfo, ostream *file)
virtual void WriteFileTrailer(ostream *, vtkImageData *)
virtual void WriteFile(ostream *file, vtkImageData *data, VTK_FUTURE_CONST int extent[6], VTK_FUTURE_CONST int wExtent[6])
static vtkImageWriter * New()
virtual void WriteFileHeader(ostream *, vtkImageData *, VTK_FUTURE_CONST int[6])
vtkSetFilePathMacro(FileName)
Specify file name for the image file.
a simple class to control print indentation
Definition vtkIndent.h:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
unsigned int vtkTypeUBool
Definition vtkABI.h:65
#define VTK_FILEPATH
#define VTK_UNBLOCKTHREADS