VTK  9.3.0
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 
28 VTK_ABI_NAMESPACE_BEGIN
29 class VTKIMAGINGCORE_EXPORT vtkImageInterpolator : public vtkAbstractImageInterpolator
30 {
31 public:
34  void PrintSelf(ostream& os, vtkIndent indent) override;
35 
37 
41  virtual void SetInterpolationMode(int mode);
42  void SetInterpolationModeToNearest() { this->SetInterpolationMode(VTK_NEAREST_INTERPOLATION); }
43  void SetInterpolationModeToLinear() { this->SetInterpolationMode(VTK_LINEAR_INTERPOLATION); }
44  void SetInterpolationModeToCubic() { this->SetInterpolationMode(VTK_CUBIC_INTERPOLATION); }
45  int GetInterpolationMode() { return this->InterpolationMode; }
46  virtual const char* GetInterpolationModeAsString();
48 
55  void ComputeSupportSize(const double matrix[16], int size[3]) override;
56 
61  bool IsSeparable() override;
62 
64 
73  void PrecomputeWeightsForExtent(const double matrix[16], const int extent[6], int newExtent[6],
74  vtkInterpolationWeights*& weights) override;
75  void PrecomputeWeightsForExtent(const float matrix[16], const int extent[6], int newExtent[6],
76  vtkInterpolationWeights*& weights) override;
78 
83 
84 protected:
87 
91  void InternalUpdate() override;
92 
97 
99 
103  void (**doublefunc)(vtkInterpolationInfo*, const double[3], double*)) override;
105  void (**floatfunc)(vtkInterpolationInfo*, const float[3], float*)) override;
107 
109 
113  void (**doublefunc)(vtkInterpolationWeights*, int, int, int, double*, int)) override;
115  void (**floatfunc)(vtkInterpolationWeights*, int, int, int, float*, int)) override;
117 
119 
120 private:
122  void operator=(const vtkImageInterpolator&) = delete;
123 };
124 
125 VTK_ABI_NAMESPACE_END
126 #endif
interpolate data values from images
interpolate data values from images
void GetRowInterpolationFunc(void(**doublefunc)(vtkInterpolationWeights *, int, int, int, double *, int)) override
Get the row interpolation functions.
void SetInterpolationModeToCubic()
The interpolation mode for point scalars (default: linear).
void InternalDeepCopy(vtkAbstractImageInterpolator *obj) override
Copy all members.
void GetInterpolationFunc(void(**doublefunc)(vtkInterpolationInfo *, const double[3], double *)) override
Get the interpolation functions.
void SetInterpolationModeToLinear()
The interpolation mode for point scalars (default: linear).
void PrecomputeWeightsForExtent(const float matrix[16], const int extent[6], int newExtent[6], vtkInterpolationWeights *&weights) override
If the data is going to be sampled on a regular grid, then the interpolation weights can be precomput...
bool IsSeparable() override
Returns true if the interpolator supports weight precomputation.
void InternalUpdate() override
Update the interpolator.
int GetInterpolationMode()
The interpolation mode for point scalars (default: linear).
virtual void SetInterpolationMode(int mode)
The interpolation mode for point scalars (default: linear).
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void FreePrecomputedWeights(vtkInterpolationWeights *&weights) override
Free the precomputed weights.
~vtkImageInterpolator() override
static vtkImageInterpolator * New()
void PrecomputeWeightsForExtent(const double matrix[16], const int extent[6], int newExtent[6], vtkInterpolationWeights *&weights) override
If the data is going to be sampled on a regular grid, then the interpolation weights can be precomput...
void GetRowInterpolationFunc(void(**floatfunc)(vtkInterpolationWeights *, int, int, int, float *, int)) override
Get the row interpolation functions.
void SetInterpolationModeToNearest()
The interpolation mode for point scalars (default: linear).
void GetInterpolationFunc(void(**floatfunc)(vtkInterpolationInfo *, const float[3], float *)) override
Get the interpolation functions.
virtual const char * GetInterpolationModeAsString()
The interpolation mode for point scalars (default: linear).
void ComputeSupportSize(const double matrix[16], int size[3]) override
Get the support size for use in computing update extents.
a simple class to control print indentation
Definition: vtkIndent.h:38
@ mode
Definition: vtkX3D.h:247
@ extent
Definition: vtkX3D.h:345
@ size
Definition: vtkX3D.h:253
#define VTK_CUBIC_INTERPOLATION
#define VTK_NEAREST_INTERPOLATION
#define VTK_LINEAR_INTERPOLATION