VTK  9.5.20251214
vtkImageImport.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
41
42#ifndef vtkImageImport_h
43#define vtkImageImport_h
44
45#include "vtkIOImageModule.h" // For export macro
46#include "vtkImageAlgorithm.h"
47
48VTK_ABI_NAMESPACE_BEGIN
49class VTKIOIMAGE_EXPORT vtkImageImport : public vtkImageAlgorithm
50{
51public:
54 void PrintSelf(ostream& os, vtkIndent indent) override;
55
61 void CopyImportVoidPointer(void* ptr, vtkIdType size);
62
64
70 void SetImportVoidPointer(void* ptr);
71 void* GetImportVoidPointer() { return this->ImportVoidPointer; }
73
81 void SetImportVoidPointer(void* ptr, int save);
82
84
88 vtkSetMacro(DataScalarType, int);
95 vtkGetMacro(DataScalarType, int);
97 {
98 return vtkImageScalarTypeNameMacro(this->DataScalarType);
99 }
100
101
103
107 vtkSetMacro(NumberOfScalarComponents, int);
108 vtkGetMacro(NumberOfScalarComponents, int);
110
112
118 vtkSetVector6Macro(DataExtent, int);
119 vtkGetVector6Macro(DataExtent, int);
122
124
128 vtkSetVector3Macro(DataSpacing, double);
129 vtkGetVector3Macro(DataSpacing, double);
131
133
137 vtkSetVector3Macro(DataOrigin, double);
138 vtkGetVector3Macro(DataOrigin, double);
140
142
147 vtkSetVectorMacro(DataDirection, double, 9);
148 vtkGetVectorMacro(DataDirection, double, 9);
150
152
157 vtkSetVector6Macro(WholeExtent, int);
158 vtkGetVector6Macro(WholeExtent, int);
160
165 vtkInformationVector* outputVector) override;
170 vtkInformationVector* outInfoVec, int requestFromOutputPort, vtkMTimeType* mtime) override;
171
173
177 vtkSetStringMacro(ScalarArrayName);
178 vtkGetStringMacro(ScalarArrayName);
180
182
186 typedef void (*UpdateInformationCallbackType)(void*);
187 typedef int (*PipelineModifiedCallbackType)(void*);
188 typedef int* (*WholeExtentCallbackType)(void*);
189 typedef double* (*SpacingCallbackType)(void*);
190 typedef double* (*OriginCallbackType)(void*);
191 typedef double* (*DirectionCallbackType)(void*);
192 typedef const char* (*ScalarTypeCallbackType)(void*);
193 typedef int (*NumberOfComponentsCallbackType)(void*);
194 typedef void (*PropagateUpdateExtentCallbackType)(void*, int*);
195 typedef void (*UpdateDataCallbackType)(void*);
196 typedef int* (*DataExtentCallbackType)(void*);
197 typedef void* (*BufferPointerCallbackType)(void*);
199
201
209
211
220
222
231
233
241
243
251
253
261
263
271
273
281
283
293
295
303
305
315
317
326
328
332 vtkSetMacro(CallbackUserData, void*);
333 vtkGetMacro(CallbackUserData, void*);
335
337
346
347protected:
349 ~vtkImageImport() override;
350
352
355
358
361 double DataSpacing[3];
362 double DataOrigin[3];
363 double DataDirection[9];
364
367
380
382
383private:
384 vtkImageImport(const vtkImageImport&) = delete;
385 void operator=(const vtkImageImport&) = delete;
386};
387
388VTK_ABI_NAMESPACE_END
389#endif
general representation of visualization data
void SetDataExtentToWholeExtent()
Get/Set the extent of the data buffer.
virtual void SetDataScalarType(int)
Set/Get the data type of pixels in the imported data.
void ExecuteDataWithInformation(vtkDataObject *d, vtkInformation *outInfo) override
This is a convenience method that is implemented in many subclasses instead of RequestData.
const char *(* ScalarTypeCallbackType)(void *)
These are function pointer types for the pipeline connection callbacks.
void SetImportVoidPointer(void *ptr, int save)
Set the pointer from which the image data is imported.
static vtkImageImport * New()
double DataSpacing[3]
~vtkImageImport() override
NumberOfComponentsCallbackType NumberOfComponentsCallback
int(* NumberOfComponentsCallbackType)(void *)
These are function pointer types for the pipeline connection callbacks.
int RequestUpdateExtent(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Propagates the update extent through the callback if it is set.
virtual int * GetWholeExtent()
Get/Set the whole extent of the image.
UpdateDataCallbackType UpdateDataCallback
int(* PipelineModifiedCallbackType)(void *)
These are function pointer types for the pipeline connection callbacks.
void * GetImportVoidPointer()
Set the pointer from which the image data is imported.
void SetImportVoidPointer(void *ptr)
Set the pointer from which the image data is imported.
void SetDataScalarTypeToUnsignedShort()
Set/Get the data type of pixels in the imported data.
int *(* WholeExtentCallbackType)(void *)
These are function pointer types for the pipeline connection callbacks.
void InvokeExecuteDataCallbacks()
Invoke the appropriate callbacks.
void InvokeUpdateInformationCallbacks()
Invoke the appropriate callbacks.
void SetDataScalarTypeToDouble()
Set/Get the data type of pixels in the imported data.
int *(* DataExtentCallbackType)(void *)
These are function pointer types for the pipeline connection callbacks.
void SetDataScalarTypeToShort()
Set/Get the data type of pixels in the imported data.
void InvokeExecuteInformationCallbacks()
Invoke the appropriate callbacks.
void *(* BufferPointerCallbackType)(void *)
These are function pointer types for the pipeline connection callbacks.
PipelineModifiedCallbackType PipelineModifiedCallback
const char * GetDataScalarTypeAsString()
Set/Get the data type of pixels in the imported data.
void LegacyCheckWholeExtent()
Invoke the appropriate callbacks.
WholeExtentCallbackType WholeExtentCallback
void SetDataScalarTypeToUnsignedChar()
Set/Get the data type of pixels in the imported data.
double *(* SpacingCallbackType)(void *)
These are function pointer types for the pipeline connection callbacks.
double DataDirection[9]
DirectionCallbackType DirectionCallback
PropagateUpdateExtentCallbackType PropagateUpdateExtentCallback
int InvokePipelineModifiedCallbacks()
Invoke the appropriate callbacks.
void CopyImportVoidPointer(void *ptr, vtkIdType size)
Import data and make an internal copy of it.
virtual void SetDataExtent(int, int, int, int, int, int)
Get/Set the extent of the data buffer.
int ComputePipelineMTime(vtkInformation *request, vtkInformationVector **inInfoVec, vtkInformationVector *outInfoVec, int requestFromOutputPort, vtkMTimeType *mtime) override
Override vtkAlgorithm.
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses can reimplement this method to collect information from their inputs and set information f...
SpacingCallbackType SpacingCallback
void(* UpdateInformationCallbackType)(void *)
These are function pointer types for the pipeline connection callbacks.
double *(* OriginCallbackType)(void *)
These are function pointer types for the pipeline connection callbacks.
ScalarTypeCallbackType ScalarTypeCallback
void(* UpdateDataCallbackType)(void *)
These are function pointer types for the pipeline connection callbacks.
OriginCallbackType OriginCallback
BufferPointerCallbackType BufferPointerCallback
DataExtentCallbackType DataExtentCallback
void SetDataScalarTypeToFloat()
Set/Get the data type of pixels in the imported data.
UpdateInformationCallbackType UpdateInformationCallback
void(* PropagateUpdateExtentCallbackType)(void *, int *)
These are function pointer types for the pipeline connection callbacks.
double *(* DirectionCallbackType)(void *)
These are function pointer types for the pipeline connection callbacks.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetDataScalarTypeToInt()
Set/Get the data type of pixels in the imported data.
double DataOrigin[3]
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
#define VTK_SHORT
Definition vtkType.h:37
int vtkIdType
Definition vtkType.h:367
#define VTK_DOUBLE
Definition vtkType.h:44
#define VTK_UNSIGNED_CHAR
Definition vtkType.h:36
#define VTK_UNSIGNED_SHORT
Definition vtkType.h:38
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:322
#define VTK_INT
Definition vtkType.h:39
#define VTK_FLOAT
Definition vtkType.h:43
void save(Archiver &ar, const std::string &str, const unsigned int version)