VTK  9.3.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 
28 VTK_ABI_NAMESPACE_BEGIN
29 class VTKIMAGINGCORE_EXPORT vtkImageInterpolator : public vtkAbstractImageInterpolator
30 {
31 public:
32  static vtkImageInterpolator* New();
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 
82  void FreePrecomputedWeights(vtkInterpolationWeights*& weights) override;
83 
84 protected:
86  ~vtkImageInterpolator() override;
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
#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.
virtual void GetInterpolationFunc(void(**doublefunc)(vtkInterpolationInfo *, const double[3], double *))
Get the 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).
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
#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.