VTK  9.3.1
vtkImageBSplineInterpolator.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
31 #ifndef vtkImageBSplineInterpolator_h
32 #define vtkImageBSplineInterpolator_h
33 
35 #include "vtkImagingCoreModule.h" // For export macro
36 
37 #define VTK_IMAGE_BSPLINE_DEGREE_MAX 9
38 
39 VTK_ABI_NAMESPACE_BEGIN
40 class vtkImageData;
42 
43 class VTKIMAGINGCORE_EXPORT vtkImageBSplineInterpolator : public vtkAbstractImageInterpolator
44 {
45 public:
48  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
51 
56  void SetSplineDegree(int degree);
57  int GetSplineDegree() { return this->SplineDegree; }
58  int GetSplineDegreeMinValue() { return 0; }
61 
68  void ComputeSupportSize(const double matrix[16], int size[3]) override;
69 
74  bool IsSeparable() override;
75 
77 
87  void PrecomputeWeightsForExtent(const double matrix[16], const int extent[6], int newExtent[6],
88  vtkInterpolationWeights*& weights) override;
89  void PrecomputeWeightsForExtent(const float matrix[16], const int extent[6], int newExtent[6],
90  vtkInterpolationWeights*& weights) override;
92 
96  void FreePrecomputedWeights(vtkInterpolationWeights*& weights) override;
97 
98 protected:
100  ~vtkImageBSplineInterpolator() override;
101 
105  void InternalUpdate() override;
106 
111 
113 
117  void (**doublefunc)(vtkInterpolationInfo*, const double[3], double*)) override;
119  void (**floatfunc)(vtkInterpolationInfo*, const float[3], float*)) override;
121 
123 
127  void (**doublefunc)(vtkInterpolationWeights*, int, int, int, double*, int)) override;
129  void (**floatfunc)(vtkInterpolationWeights*, int, int, int, float*, int)) override;
131 
135  virtual void BuildKernelLookupTable();
136 
140  virtual void FreeKernelLookupTable();
141 
144 
145 private:
147  void operator=(const vtkImageBSplineInterpolator&) = delete;
148 };
149 
150 VTK_ABI_NAMESPACE_END
151 #endif
interpolate data values from images
int GetSplineDegree()
Set the degree of the spline polynomial.
virtual void InternalDeepCopy(vtkAbstractImageInterpolator *obj)=0
Subclass-specific copy.
virtual void InternalUpdate()=0
Subclass-specific updates.
int GetSplineDegreeMaxValue()
Set the degree of the spline polynomial.
#define VTK_IMAGE_BSPLINE_DEGREE_MAX
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...
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
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.
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.
perform b-spline interpolation on images
int GetSplineDegreeMinValue()
Set the degree of the spline polynomial.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
virtual void ComputeSupportSize(const double matrix[16], int support[3])=0
Get the support size for use in computing update extents.
boost::graph_traits< vtkGraph * >::degree_size_type degree(boost::graph_traits< vtkGraph * >::vertex_descriptor u, vtkGraph *g)