VTK  9.2.6
vtkImageImport.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkImageImport.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=========================================================================*/
34
35#ifndef vtkImageImport_h
36#define vtkImageImport_h
37
38#include "vtkIOImageModule.h" // For export macro
39#include "vtkImageAlgorithm.h"
40
41class VTKIOIMAGE_EXPORT vtkImageImport : public vtkImageAlgorithm
42{
43public:
46 void PrintSelf(ostream& os, vtkIndent indent) override;
47
53 void CopyImportVoidPointer(void* ptr, vtkIdType size);
54
56
62 void SetImportVoidPointer(void* ptr);
63 void* GetImportVoidPointer() { return this->ImportVoidPointer; }
65
73 void SetImportVoidPointer(void* ptr, int save);
74
76
80 vtkSetMacro(DataScalarType, int);
87 vtkGetMacro(DataScalarType, int);
89 {
90 return vtkImageScalarTypeNameMacro(this->DataScalarType);
91 }
92
93
95
99 vtkSetMacro(NumberOfScalarComponents, int);
100 vtkGetMacro(NumberOfScalarComponents, int);
102
104
110 vtkSetVector6Macro(DataExtent, int);
111 vtkGetVector6Macro(DataExtent, int);
114
116
120 vtkSetVector3Macro(DataSpacing, double);
121 vtkGetVector3Macro(DataSpacing, double);
123
125
129 vtkSetVector3Macro(DataOrigin, double);
130 vtkGetVector3Macro(DataOrigin, double);
132
134
139 vtkSetVectorMacro(DataDirection, double, 9);
140 vtkGetVectorMacro(DataDirection, double, 9);
142
144
149 vtkSetVector6Macro(WholeExtent, int);
150 vtkGetVector6Macro(WholeExtent, int);
152
157 vtkInformationVector* outputVector) override;
162 vtkInformationVector* outInfoVec, int requestFromOutputPort, vtkMTimeType* mtime) override;
163
165
169 vtkSetStringMacro(ScalarArrayName);
170 vtkGetStringMacro(ScalarArrayName);
172
174
178 typedef void (*UpdateInformationCallbackType)(void*);
179 typedef int (*PipelineModifiedCallbackType)(void*);
180 typedef int* (*WholeExtentCallbackType)(void*);
181 typedef double* (*SpacingCallbackType)(void*);
182 typedef double* (*OriginCallbackType)(void*);
183 typedef double* (*DirectionCallbackType)(void*);
184 typedef const char* (*ScalarTypeCallbackType)(void*);
185 typedef int (*NumberOfComponentsCallbackType)(void*);
186 typedef void (*PropagateUpdateExtentCallbackType)(void*, int*);
187 typedef void (*UpdateDataCallbackType)(void*);
188 typedef int* (*DataExtentCallbackType)(void*);
189 typedef void* (*BufferPointerCallbackType)(void*);
191
193
201
203
212
214
223
225
233
235
243
245
253
255
263
265
273
275
285
287
295
297
307
309
318
320
324 vtkSetMacro(CallbackUserData, void*);
325 vtkGetMacro(CallbackUserData, void*);
327
329
338
339protected:
341 ~vtkImageImport() override;
342
344
347
350
353 double DataSpacing[3];
354 double DataOrigin[3];
355 double DataDirection[9];
356
359
372
374
375private:
376 vtkImageImport(const vtkImageImport&) = delete;
377 void operator=(const vtkImageImport&) = delete;
378};
379
380#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:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
#define VTK_SHORT
Definition vtkType.h:48
int vtkIdType
Definition vtkType.h:332
#define VTK_DOUBLE
Definition vtkType.h:55
#define VTK_UNSIGNED_CHAR
Definition vtkType.h:47
#define VTK_UNSIGNED_SHORT
Definition vtkType.h:49
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:287
#define VTK_INT
Definition vtkType.h:50
#define VTK_FLOAT
Definition vtkType.h:54
void save(Archiver &ar, const std::string &str, const unsigned int vtkNotUsed(version))