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=========================================================================*/
31
32#ifndef vtkImageImport_h
33#define vtkImageImport_h
34
35#include "vtkIOImageModule.h" // For export macro
36#include "vtkImageAlgorithm.h"
37
38class VTKIOIMAGE_EXPORT vtkImageImport : public vtkImageAlgorithm
39{
40public:
43 void PrintSelf(ostream& os, vtkIndent indent) override;
44
50 void CopyImportVoidPointer(void* ptr, vtkIdType size);
51
53
59 void SetImportVoidPointer(void* ptr);
60 void* GetImportVoidPointer() { return this->ImportVoidPointer; }
62
70 void SetImportVoidPointer(void* ptr, int save);
71
73
77 vtkSetMacro(DataScalarType, int);
84 vtkGetMacro(DataScalarType, int);
86 {
87 return vtkImageScalarTypeNameMacro(this->DataScalarType);
88 }
89
90
92
96 vtkSetMacro(NumberOfScalarComponents, int);
97 vtkGetMacro(NumberOfScalarComponents, int);
99
101
107 vtkSetVector6Macro(DataExtent, int);
108 vtkGetVector6Macro(DataExtent, int);
111
113
117 vtkSetVector3Macro(DataSpacing, double);
118 vtkGetVector3Macro(DataSpacing, double);
120
122
126 vtkSetVector3Macro(DataOrigin, double);
127 vtkGetVector3Macro(DataOrigin, double);
129
131
136 vtkSetVectorMacro(DataDirection, double, 9);
137 vtkGetVectorMacro(DataDirection, double, 9);
139
141
146 vtkSetVector6Macro(WholeExtent, int);
147 vtkGetVector6Macro(WholeExtent, int);
149
154 vtkInformationVector* outputVector) override;
159 vtkInformationVector* outInfoVec, int requestFromOutputPort, vtkMTimeType* mtime) override;
160
162
166 vtkSetStringMacro(ScalarArrayName);
167 vtkGetStringMacro(ScalarArrayName);
169
171
175 typedef void (*UpdateInformationCallbackType)(void*);
176 typedef int (*PipelineModifiedCallbackType)(void*);
177 typedef int* (*WholeExtentCallbackType)(void*);
178 typedef double* (*SpacingCallbackType)(void*);
179 typedef double* (*OriginCallbackType)(void*);
180 typedef double* (*DirectionCallbackType)(void*);
181 typedef const char* (*ScalarTypeCallbackType)(void*);
182 typedef int (*NumberOfComponentsCallbackType)(void*);
183 typedef void (*PropagateUpdateExtentCallbackType)(void*, int*);
184 typedef void (*UpdateDataCallbackType)(void*);
185 typedef int* (*DataExtentCallbackType)(void*);
186 typedef void* (*BufferPointerCallbackType)(void*);
188
190
198
200
209
211
220
222
230
232
240
242
250
252
260
262
270
272
282
284
292
294
304
306
315
317
321 vtkSetMacro(CallbackUserData, void*);
322 vtkGetMacro(CallbackUserData, void*);
324
326
335
336protected:
338 ~vtkImageImport() override;
339
341
344
347
350 double DataSpacing[3];
351 double DataOrigin[3];
352 double DataDirection[9];
353
356
369
371
372private:
373 vtkImageImport(const vtkImageImport&) = delete;
374 void operator=(const vtkImageImport&) = delete;
375};
376
377#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:34
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))