VTK  9.0.1
vtkImageBSplineInterpolator.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImageBSplineInterpolator.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 =========================================================================*/
37 #ifndef vtkImageBSplineInterpolator_h
38 #define vtkImageBSplineInterpolator_h
39 
41 #include "vtkImagingCoreModule.h" // For export macro
42 
43 #define VTK_IMAGE_BSPLINE_DEGREE_MAX 9
44 
45 class vtkImageData;
47 
48 class VTKIMAGINGCORE_EXPORT vtkImageBSplineInterpolator : public vtkAbstractImageInterpolator
49 {
50 public:
53  void PrintSelf(ostream& os, vtkIndent indent) override;
54 
56 
61  void SetSplineDegree(int degree);
62  int GetSplineDegree() { return this->SplineDegree; }
63  int GetSplineDegreeMinValue() { return 0; }
66 
73  void ComputeSupportSize(const double matrix[16], int support[3]) override;
74 
79  bool IsSeparable() override;
80 
82 
92  void PrecomputeWeightsForExtent(const double matrix[16], const int extent[6], int newExtent[6],
93  vtkInterpolationWeights*& weights) override;
94  void PrecomputeWeightsForExtent(const float matrix[16], const int extent[6], int newExtent[6],
95  vtkInterpolationWeights*& weights) override;
97 
101  void FreePrecomputedWeights(vtkInterpolationWeights*& weights) override;
102 
103 protected:
105  ~vtkImageBSplineInterpolator() override;
106 
110  void InternalUpdate() override;
111 
116 
118 
122  void (**doublefunc)(vtkInterpolationInfo*, const double[3], double*)) override;
124  void (**floatfunc)(vtkInterpolationInfo*, const float[3], float*)) override;
126 
128 
132  void (**doublefunc)(vtkInterpolationWeights*, int, int, int, double*, int)) override;
134  void (**floatfunc)(vtkInterpolationWeights*, int, int, int, float*, int)) override;
136 
140  virtual void BuildKernelLookupTable();
141 
145  virtual void FreeKernelLookupTable();
146 
149 
150 private:
152  void operator=(const vtkImageBSplineInterpolator&) = delete;
153 };
154 
155 #endif
vtkAbstractImageInterpolator::FreePrecomputedWeights
virtual void FreePrecomputedWeights(vtkInterpolationWeights *&weights)
Free the weights that were provided by PrecomputeWeightsForExtent.
degree
boost::graph_traits< vtkGraph * >::degree_size_type degree(boost::graph_traits< vtkGraph * >::vertex_descriptor u, vtkGraph *g)
Definition: vtkBoostGraphAdapter.h:1044
vtkAbstractImageInterpolator::GetRowInterpolationFunc
virtual void GetRowInterpolationFunc(void(**doublefunc)(vtkInterpolationWeights *, int, int, int, double *, int))
Get the row interpolation functions.
VTK_IMAGE_BSPLINE_DEGREE_MAX
#define VTK_IMAGE_BSPLINE_DEGREE_MAX
Definition: vtkImageBSplineInterpolator.h:43
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkInterpolationInfo
Definition: vtkImageInterpolatorInternals.h:26
vtkAbstractImageInterpolator::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkImageBSplineInterpolator::GetSplineDegreeMinValue
int GetSplineDegreeMinValue()
Definition: vtkImageBSplineInterpolator.h:63
vtkAbstractImageInterpolator::InternalDeepCopy
virtual void InternalDeepCopy(vtkAbstractImageInterpolator *obj)=0
Subclass-specific copy.
vtkImageBSplineInterpolator::GetSplineDegree
int GetSplineDegree()
Definition: vtkImageBSplineInterpolator.h:62
vtkAbstractImageInterpolator.h
vtkAbstractImageInterpolator::ComputeSupportSize
virtual void ComputeSupportSize(const double matrix[16], int support[3])=0
Get the support size for use in computing update extents.
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:41
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkAbstractImageInterpolator::InternalUpdate
virtual void InternalUpdate()=0
Subclass-specific updates.
vtkImageBSplineInterpolator::GetSplineDegreeMaxValue
int GetSplineDegreeMaxValue()
Definition: vtkImageBSplineInterpolator.h:64
vtkImageBSplineInterpolator::KernelLookupTable
float * KernelLookupTable
Definition: vtkImageBSplineInterpolator.h:148
vtkImageBSplineInterpolator
perform b-spline interpolation on images
Definition: vtkImageBSplineInterpolator.h:48
vtkInterpolationWeights
Definition: vtkImageInterpolatorInternals.h:39
vtkAbstractImageInterpolator::IsSeparable
virtual bool IsSeparable()=0
True if the interpolation is separable, which means that the weights can be precomputed in order to a...
vtkAbstractImageInterpolator::GetInterpolationFunc
virtual void GetInterpolationFunc(void(**doublefunc)(vtkInterpolationInfo *, const double[3], double *))
Get the interpolation functions.
vtkX3D::extent
@ extent
Definition: vtkX3D.h:351
vtkImageBSplineInterpolator::SplineDegree
int SplineDegree
Definition: vtkImageBSplineInterpolator.h:147
vtkAbstractImageInterpolator
interpolate data values from images
Definition: vtkAbstractImageInterpolator.h:46
vtkAbstractImageInterpolator::PrecomputeWeightsForExtent
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...