VTK  9.7.1
vtkImageInterpolator.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
22 #ifndef vtkImageInterpolator_h
23 #define vtkImageInterpolator_h
24 
26 #include "vtkImagingCoreModule.h" // For export macro
27 #include "vtkWrappingHints.h"
28 
29 VTK_ABI_NAMESPACE_BEGIN
30 class VTKIMAGINGCORE_EXPORT VTK_MARSHALAUTO vtkImageInterpolator
32 {
33 public:
34  static vtkImageInterpolator* New();
36  void PrintSelf(ostream& os, vtkIndent indent) override;
37 
39 
43  virtual void SetInterpolationMode(int mode);
44  void SetInterpolationModeToNearest() { this->SetInterpolationMode(VTK_NEAREST_INTERPOLATION); }
45  void SetInterpolationModeToLinear() { this->SetInterpolationMode(VTK_LINEAR_INTERPOLATION); }
46  void SetInterpolationModeToCubic() { this->SetInterpolationMode(VTK_CUBIC_INTERPOLATION); }
47  int GetInterpolationMode() { return this->InterpolationMode; }
48  virtual const char* GetInterpolationModeAsString();
50 
57  void ComputeSupportSize(const double matrix[16], int size[3]) override;
58 
63  bool IsSeparable() override;
64 
66 
75  void PrecomputeWeightsForExtent(const double matrix[16], const int extent[6], int newExtent[6],
76  vtkInterpolationWeights*& weights) override;
77  void PrecomputeWeightsForExtent(const float matrix[16], const int extent[6], int newExtent[6],
78  vtkInterpolationWeights*& weights) override;
80 
84  void FreePrecomputedWeights(vtkInterpolationWeights*& weights) override;
85 
86 protected:
88  ~vtkImageInterpolator() override;
89 
93  void InternalUpdate() override;
94 
99 
101 
105  void (**doublefunc)(VTK_FUTURE_CONST vtkInterpolationInfo*, const double[3], double*)) override;
107  void (**floatfunc)(VTK_FUTURE_CONST vtkInterpolationInfo*, const float[3], float*)) override;
109 
111 
115  void (**doublefunc)(vtkInterpolationWeights*, int, int, int, double*, int)) override;
117  void (**floatfunc)(vtkInterpolationWeights*, int, int, int, float*, int)) override;
119 
121 
122 private:
124  void operator=(const vtkImageInterpolator&) = delete;
125 };
126 
127 VTK_ABI_NAMESPACE_END
128 #endif
interpolate data values from images
#define VTK_LINEAR_INTERPOLATION
virtual void InternalDeepCopy(vtkAbstractImageInterpolator *obj)=0
Subclass-specific copy.
virtual void InternalUpdate()=0
Subclass-specific updates.
#define VTK_CUBIC_INTERPOLATION
void SetInterpolationModeToNearest()
The interpolation mode for point scalars (default: linear).
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual void PrecomputeWeightsForExtent(const double matrix[16], const int extent[6], int checkExtent[6], vtkInterpolationWeights *&weights)
If the data is going to be sampled on a regular grid, then the interpolation weights can be precomput...
int GetInterpolationMode()
The interpolation mode for point scalars (default: linear).
virtual void GetRowInterpolationFunc(void(**doublefunc)(vtkInterpolationWeights *, int, int, int, double *, int))
Get the row interpolation functions.
void SetInterpolationModeToLinear()
The interpolation mode for point scalars (default: linear).
virtual bool IsSeparable()=0
True if the interpolation is separable, which means that the weights can be precomputed in order to a...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void FreePrecomputedWeights(vtkInterpolationWeights *&weights)
Free the weights that were provided by PrecomputeWeightsForExtent.
interpolate data values from images
void SetInterpolationModeToCubic()
The interpolation mode for point scalars (default: linear).
#define VTK_MARSHALAUTO
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
virtual void GetInterpolationFunc(void(**doublefunc)(VTK_FUTURE_CONST vtkInterpolationInfo *, const double[3], double *))
Get the interpolation functions.
#define VTK_NEAREST_INTERPOLATION
virtual void ComputeSupportSize(const double matrix[16], int support[3])=0
Get the support size for use in computing update extents.