VTK  9.2.6
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=========================================================================*/
54#ifndef vtkImageExport_h
55#define vtkImageExport_h
56
57#include "vtkIOImageModule.h" // For export macro
58#include "vtkImageAlgorithm.h"
59
60class VTKIOIMAGE_EXPORT vtkImageExport : public vtkImageAlgorithm
61{
62public:
65 void PrintSelf(ostream& os, vtkIndent indent) override;
66
71
73
77 void GetDataDimensions(int* ptr);
79 {
80 this->GetDataDimensions(this->DataDimensions);
81 return this->DataDimensions;
82 }
84
91
98 {
99 return vtkImageScalarTypeNameMacro(this->GetDataScalarType());
100 }
101
103
107 void GetDataExtent(int* ptr);
108 double* GetDataSpacing() VTK_SIZEHINT(3);
109 void GetDataSpacing(double* ptr);
110 double* GetDataOrigin() VTK_SIZEHINT(3);
111 void GetDataOrigin(double* ptr);
112 double* GetDataDirection() VTK_SIZEHINT(9);
113 void GetDataDirection(double* ptr);
115
119 vtkImageData* GetInput();
120
122
130 vtkBooleanMacro(ImageLowerLeft, vtkTypeBool);
131 vtkGetMacro(ImageLowerLeft, vtkTypeBool);
132 vtkSetMacro(ImageLowerLeft, vtkTypeBool);
134
136
141 void SetExportVoidPointer(void*);
142 void* GetExportVoidPointer() { return this->ExportVoidPointer; }
144
146
151 void Export() { this->Export(this->ExportVoidPointer); }
152 virtual void Export(void*);
154
163
168
170
174 typedef void (*UpdateInformationCallbackType)(void*);
175 typedef int (*PipelineModifiedCallbackType)(void*);
176 typedef int* (*WholeExtentCallbackType)(void*);
177 typedef double* (*SpacingCallbackType)(void*);
178 typedef double* (*OriginCallbackType)(void*);
179 typedef double* (*DirectionCallbackType)(void*);
180 typedef const char* (*ScalarTypeCallbackType)(void*);
181 typedef int (*NumberOfComponentsCallbackType)(void*);
182 typedef void (*PropagateUpdateExtentCallbackType)(void*, int*);
183 typedef void (*UpdateDataCallbackType)(void*);
184 typedef int* (*DataExtentCallbackType)(void*);
185 typedef void* (*BufferPointerCallbackType)(void*);
187
189
192 UpdateInformationCallbackType GetUpdateInformationCallback() const;
193 PipelineModifiedCallbackType GetPipelineModifiedCallback() const;
194 WholeExtentCallbackType GetWholeExtentCallback() const;
195 SpacingCallbackType GetSpacingCallback() const;
196 OriginCallbackType GetOriginCallback() const;
197 DirectionCallbackType GetDirectionCallback() const;
198 ScalarTypeCallbackType GetScalarTypeCallback() const;
199 NumberOfComponentsCallbackType GetNumberOfComponentsCallback() const;
200 PropagateUpdateExtentCallbackType GetPropagateUpdateExtentCallback() const;
201 UpdateDataCallbackType GetUpdateDataCallback() const;
202 DataExtentCallbackType GetDataExtentCallback() const;
203 BufferPointerCallbackType GetBufferPointerCallback() const;
205
206protected:
208 ~vtkImageExport() override;
209
210 // This is called by the superclass.
212 vtkInformationVector* outputVector) override;
213
216 virtual void UpdateDataCallback();
217 virtual int* WholeExtentCallback();
218 virtual double* SpacingCallback();
219 virtual double* OriginCallback();
220 virtual double* DirectionCallback();
221 virtual const char* ScalarTypeCallback();
224 virtual int* DataExtentCallback();
225 virtual void* BufferPointerCallback();
226
228 int DataDimensions[3];
230
232
233private:
234 vtkImageExport(const vtkImageExport&) = delete;
235 void operator=(const vtkImageExport&) = delete;
236
237 static void UpdateInformationCallbackFunction(void*);
238 static int PipelineModifiedCallbackFunction(void*);
239 static int* WholeExtentCallbackFunction(void*);
240 static double* SpacingCallbackFunction(void*);
241 static double* OriginCallbackFunction(void*);
242 static double* DirectionCallbackFunction(void*);
243 static const char* ScalarTypeCallbackFunction(void*);
244 static int NumberOfComponentsCallbackFunction(void*);
245 static void PropagateUpdateExtentCallbackFunction(void*, int*);
246 static void UpdateDataCallbackFunction(void*);
247 static int* DataExtentCallbackFunction(void*);
248 static void* BufferPointerCallbackFunction(void*);
249
252};
253
254#endif
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:122
vtkInformation * GetInputInformation()
Equivalent to GetInputInformation(0, 0)
Definition: vtkAlgorithm.h:586
vtkAlgorithm * GetInputAlgorithm()
Equivalent to GetInputAlgorithm(0, 0).
Definition: vtkAlgorithm.h:560
Generic algorithm superclass for image algs.
topologically and geometrically regular array of data
Definition: vtkImageData.h:163
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:119
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(...)