VTK  9.1.0
vtkImageExport.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkImageExport.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=========================================================================*/
41#ifndef vtkImageExport_h
42#define vtkImageExport_h
43
44#include "vtkIOImageModule.h" // For export macro
45#include "vtkImageAlgorithm.h"
46
47class VTKIOIMAGE_EXPORT vtkImageExport : public vtkImageAlgorithm
48{
49public:
52 void PrintSelf(ostream& os, vtkIndent indent) override;
53
58
60
64 void GetDataDimensions(int* ptr);
66 {
67 this->GetDataDimensions(this->DataDimensions);
68 return this->DataDimensions;
69 }
71
78
85 {
86 return vtkImageScalarTypeNameMacro(this->GetDataScalarType());
87 }
88
90
94 void GetDataExtent(int* ptr);
95 double* GetDataSpacing() VTK_SIZEHINT(3);
96 void GetDataSpacing(double* ptr);
97 double* GetDataOrigin() VTK_SIZEHINT(3);
98 void GetDataOrigin(double* ptr);
99 double* GetDataDirection() VTK_SIZEHINT(9);
100 void GetDataDirection(double* ptr);
102
106 vtkImageData* GetInput();
107
109
117 vtkBooleanMacro(ImageLowerLeft, vtkTypeBool);
118 vtkGetMacro(ImageLowerLeft, vtkTypeBool);
119 vtkSetMacro(ImageLowerLeft, vtkTypeBool);
121
123
128 void SetExportVoidPointer(void*);
129 void* GetExportVoidPointer() { return this->ExportVoidPointer; }
131
133
138 void Export() { this->Export(this->ExportVoidPointer); }
139 virtual void Export(void*);
141
150
155
157
161 typedef void (*UpdateInformationCallbackType)(void*);
162 typedef int (*PipelineModifiedCallbackType)(void*);
163 typedef int* (*WholeExtentCallbackType)(void*);
164 typedef double* (*SpacingCallbackType)(void*);
165 typedef double* (*OriginCallbackType)(void*);
166 typedef double* (*DirectionCallbackType)(void*);
167 typedef const char* (*ScalarTypeCallbackType)(void*);
168 typedef int (*NumberOfComponentsCallbackType)(void*);
169 typedef void (*PropagateUpdateExtentCallbackType)(void*, int*);
170 typedef void (*UpdateDataCallbackType)(void*);
171 typedef int* (*DataExtentCallbackType)(void*);
172 typedef void* (*BufferPointerCallbackType)(void*);
174
176
179 UpdateInformationCallbackType GetUpdateInformationCallback() const;
180 PipelineModifiedCallbackType GetPipelineModifiedCallback() const;
181 WholeExtentCallbackType GetWholeExtentCallback() const;
182 SpacingCallbackType GetSpacingCallback() const;
183 OriginCallbackType GetOriginCallback() const;
184 DirectionCallbackType GetDirectionCallback() const;
185 ScalarTypeCallbackType GetScalarTypeCallback() const;
186 NumberOfComponentsCallbackType GetNumberOfComponentsCallback() const;
187 PropagateUpdateExtentCallbackType GetPropagateUpdateExtentCallback() const;
188 UpdateDataCallbackType GetUpdateDataCallback() const;
189 DataExtentCallbackType GetDataExtentCallback() const;
190 BufferPointerCallbackType GetBufferPointerCallback() const;
192
193protected:
195 ~vtkImageExport() override;
196
197 // This is called by the superclass.
199 vtkInformationVector* outputVector) override;
200
203 virtual void UpdateDataCallback();
204 virtual int* WholeExtentCallback();
205 virtual double* SpacingCallback();
206 virtual double* OriginCallback();
207 virtual double* DirectionCallback();
208 virtual const char* ScalarTypeCallback();
211 virtual int* DataExtentCallback();
212 virtual void* BufferPointerCallback();
213
215 int DataDimensions[3];
217
219
220private:
221 vtkImageExport(const vtkImageExport&) = delete;
222 void operator=(const vtkImageExport&) = delete;
223
224 static void UpdateInformationCallbackFunction(void*);
225 static int PipelineModifiedCallbackFunction(void*);
226 static int* WholeExtentCallbackFunction(void*);
227 static double* SpacingCallbackFunction(void*);
228 static double* OriginCallbackFunction(void*);
229 static double* DirectionCallbackFunction(void*);
230 static const char* ScalarTypeCallbackFunction(void*);
231 static int NumberOfComponentsCallbackFunction(void*);
232 static void PropagateUpdateExtentCallbackFunction(void*, int*);
233 static void UpdateDataCallbackFunction(void*);
234 static int* DataExtentCallbackFunction(void*);
235 static void* BufferPointerCallbackFunction(void*);
236
239};
240
241#endif
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:64
vtkInformation * GetInputInformation()
Equivalent to GetInputInformation(0, 0)
Definition: vtkAlgorithm.h:536
vtkAlgorithm * GetInputAlgorithm()
Equivalent to GetInputAlgorithm(0, 0).
Definition: vtkAlgorithm.h:510
Generic algorithm superclass for image algs.
topologically and geometrically regular array of data
Definition: vtkImageData.h:57
Export VTK images to third-party systems.
void * GetPointerToData()
An alternative to Export(): Use with caution.
WholeExtentCallbackType GetWholeExtentCallback() const
Get pointers to the pipeline interface callbacks.
DataExtentCallbackType GetDataExtentCallback() const
Get pointers to the pipeline interface callbacks.
virtual int * DataExtentCallback()
void * ExportVoidPointer
int GetDataNumberOfScalarComponents()
Get the number of scalar components of the data.
NumberOfComponentsCallbackType GetNumberOfComponentsCallback() const
Get pointers to the pipeline interface callbacks.
int GetDataScalarType()
Get the scalar type of the data.
vtkTypeBool ImageLowerLeft
virtual void Export(void *)
The main interface: update the pipeline and export the image to the memory pointed to by SetExportVoi...
BufferPointerCallbackType GetBufferPointerCallback() const
Get pointers to the pipeline interface callbacks.
PipelineModifiedCallbackType GetPipelineModifiedCallback() const
Get pointers to the pipeline interface callbacks.
const char * GetDataScalarTypeAsString()
PropagateUpdateExtentCallbackType GetPropagateUpdateExtentCallback() const
Get pointers to the pipeline interface callbacks.
OriginCallbackType GetOriginCallback() const
Get pointers to the pipeline interface callbacks.
virtual int NumberOfComponentsCallback()
virtual double * OriginCallback()
virtual double * SpacingCallback()
UpdateDataCallbackType GetUpdateDataCallback() const
Get pointers to the pipeline interface callbacks.
static vtkImageExport * New()
ScalarTypeCallbackType GetScalarTypeCallback() const
Get pointers to the pipeline interface callbacks.
SpacingCallbackType GetSpacingCallback() const
Get pointers to the pipeline interface callbacks.
virtual int * WholeExtentCallback()
vtkIdType GetDataMemorySize()
Get the number of bytes required for the output C array.
virtual void * BufferPointerCallback()
int * GetDataExtent()
Get miscellaneous additional information about the data.
void Export()
The main interface: update the pipeline and export the image to the memory pointed to by SetExportVoi...
int * GetDataDimensions()
Get the (x,y,z) index dimensions of the data.
virtual double * DirectionCallback()
~vtkImageExport() override
virtual void UpdateDataCallback()
vtkMTimeType LastPipelineMTime
virtual void PropagateUpdateExtentCallback(int *)
virtual const char * ScalarTypeCallback()
void GetDataDimensions(int *ptr)
Get the (x,y,z) index dimensions of the data.
DirectionCallbackType GetDirectionCallback() const
Get pointers to the pipeline interface callbacks.
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called in response to a REQUEST_DATA request from the executive.
UpdateInformationCallbackType GetUpdateInformationCallback() const
Get pointers to the pipeline interface callbacks.
void * GetCallbackUserData()
Get the user data that should be passed to the callback functions.
virtual int PipelineModifiedCallback()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void UpdateInformationCallback()
a simple class to control print indentation
Definition: vtkIndent.h:43
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
int vtkTypeBool
Definition: vtkABI.h:69
int vtkIdType
Definition: vtkType.h:332
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287
#define VTK_SIZEHINT(...)