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 =========================================================================*/
51 #ifndef vtkImageExport_h
52 #define vtkImageExport_h
53 
54 #include "vtkIOImageModule.h" // For export macro
55 #include "vtkImageAlgorithm.h"
56 
57 class VTKIOIMAGE_EXPORT vtkImageExport : public vtkImageAlgorithm
58 {
59 public:
60  static vtkImageExport* New();
62  void PrintSelf(ostream& os, vtkIndent indent) override;
63 
68 
70 
74  void GetDataDimensions(int* ptr);
76  {
77  this->GetDataDimensions(this->DataDimensions);
78  return this->DataDimensions;
79  }
81 
88 
95  {
96  return vtkImageScalarTypeNameMacro(this->GetDataScalarType());
97  }
98 
100 
104  void GetDataExtent(int* ptr);
105  double* GetDataSpacing() VTK_SIZEHINT(3);
106  void GetDataSpacing(double* ptr);
107  double* GetDataOrigin() VTK_SIZEHINT(3);
108  void GetDataOrigin(double* ptr);
109  double* GetDataDirection() VTK_SIZEHINT(9);
110  void GetDataDirection(double* ptr);
112 
116  vtkImageData* GetInput();
117 
119 
127  vtkBooleanMacro(ImageLowerLeft, vtkTypeBool);
128  vtkGetMacro(ImageLowerLeft, vtkTypeBool);
129  vtkSetMacro(ImageLowerLeft, vtkTypeBool);
131 
133 
138  void SetExportVoidPointer(void*);
139  void* GetExportVoidPointer() { return this->ExportVoidPointer; }
141 
143 
148  void Export() { this->Export(this->ExportVoidPointer); }
149  virtual void Export(void*);
151 
160 
165 
167 
171  typedef void (*UpdateInformationCallbackType)(void*);
172  typedef int (*PipelineModifiedCallbackType)(void*);
173  typedef int* (*WholeExtentCallbackType)(void*);
174  typedef double* (*SpacingCallbackType)(void*);
175  typedef double* (*OriginCallbackType)(void*);
176  typedef double* (*DirectionCallbackType)(void*);
177  typedef const char* (*ScalarTypeCallbackType)(void*);
178  typedef int (*NumberOfComponentsCallbackType)(void*);
179  typedef void (*PropagateUpdateExtentCallbackType)(void*, int*);
180  typedef void (*UpdateDataCallbackType)(void*);
181  typedef int* (*DataExtentCallbackType)(void*);
182  typedef void* (*BufferPointerCallbackType)(void*);
184 
186 
189  UpdateInformationCallbackType GetUpdateInformationCallback() const;
190  PipelineModifiedCallbackType GetPipelineModifiedCallback() const;
191  WholeExtentCallbackType GetWholeExtentCallback() const;
192  SpacingCallbackType GetSpacingCallback() const;
193  OriginCallbackType GetOriginCallback() const;
194  DirectionCallbackType GetDirectionCallback() const;
195  ScalarTypeCallbackType GetScalarTypeCallback() const;
196  NumberOfComponentsCallbackType GetNumberOfComponentsCallback() const;
197  PropagateUpdateExtentCallbackType GetPropagateUpdateExtentCallback() const;
198  UpdateDataCallbackType GetUpdateDataCallback() const;
199  DataExtentCallbackType GetDataExtentCallback() const;
200  BufferPointerCallbackType GetBufferPointerCallback() const;
202 
203 protected:
205  ~vtkImageExport() override;
206 
207  // This is called by the superclass.
208  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
209  vtkInformationVector* outputVector) override;
210 
213  virtual void UpdateDataCallback();
214  virtual int* WholeExtentCallback();
215  virtual double* SpacingCallback();
216  virtual double* OriginCallback();
217  virtual double* DirectionCallback();
218  virtual const char* ScalarTypeCallback();
220  virtual void PropagateUpdateExtentCallback(int*);
221  virtual int* DataExtentCallback();
222  virtual void* BufferPointerCallback();
223 
225  int DataDimensions[3];
227 
229 
230 private:
231  vtkImageExport(const vtkImageExport&) = delete;
232  void operator=(const vtkImageExport&) = delete;
233 
234  static void UpdateInformationCallbackFunction(void*);
235  static int PipelineModifiedCallbackFunction(void*);
236  static int* WholeExtentCallbackFunction(void*);
237  static double* SpacingCallbackFunction(void*);
238  static double* OriginCallbackFunction(void*);
239  static double* DirectionCallbackFunction(void*);
240  static const char* ScalarTypeCallbackFunction(void*);
241  static int NumberOfComponentsCallbackFunction(void*);
242  static void PropagateUpdateExtentCallbackFunction(void*, int*);
243  static void UpdateDataCallbackFunction(void*);
244  static int* DataExtentCallbackFunction(void*);
245  static void* BufferPointerCallbackFunction(void*);
246 
249 };
250 
251 #endif
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:114
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:157
Export VTK images to third-party systems.
virtual double * OriginCallback()
virtual void * BufferPointerCallback()
const char * GetDataScalarTypeAsString()
WholeExtentCallbackType GetWholeExtentCallback() const
Get pointers to the pipeline interface callbacks.
DataExtentCallbackType GetDataExtentCallback() const
Get pointers to the pipeline interface callbacks.
void * ExportVoidPointer
static vtkImageExport * New()
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.
void * GetPointerToData()
An alternative to Export(): Use with caution.
PropagateUpdateExtentCallbackType GetPropagateUpdateExtentCallback() const
Get pointers to the pipeline interface callbacks.
OriginCallbackType GetOriginCallback() const
Get pointers to the pipeline interface callbacks.
virtual int NumberOfComponentsCallback()
UpdateDataCallbackType GetUpdateDataCallback() const
Get pointers to the pipeline interface callbacks.
void * GetCallbackUserData()
Get the user data that should be passed to the callback functions.
ScalarTypeCallbackType GetScalarTypeCallback() const
Get pointers to the pipeline interface callbacks.
SpacingCallbackType GetSpacingCallback() const
Get pointers to the pipeline interface callbacks.
virtual const char * ScalarTypeCallback()
int * GetDataDimensions()
Get the (x,y,z) index dimensions of the data.
int * GetDataExtent()
Get miscellaneous additional information about the data.
virtual int * WholeExtentCallback()
virtual double * SpacingCallback()
vtkIdType GetDataMemorySize()
Get the number of bytes required for the output C array.
void Export()
The main interface: update the pipeline and export the image to the memory pointed to by SetExportVoi...
~vtkImageExport() override
virtual void UpdateDataCallback()
vtkMTimeType LastPipelineMTime
virtual void PropagateUpdateExtentCallback(int *)
void GetDataDimensions(int *ptr)
Get the (x,y,z) index dimensions of the data.
virtual int * DataExtentCallback()
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.
virtual double * DirectionCallback()
UpdateInformationCallbackType GetUpdateInformationCallback() const
Get pointers to the pipeline interface callbacks.
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:113
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(...)