VTK
vtkImageInterpolator.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImageInterpolator.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 =========================================================================*/
34 #ifndef vtkImageInterpolator_h
35 #define vtkImageInterpolator_h
36 
37 #include "vtkImagingCoreModule.h" // For export macro
39 
40 class VTKIMAGINGCORE_EXPORT vtkImageInterpolator :
42 {
43 public:
44  static vtkImageInterpolator *New();
46  void PrintSelf(ostream& os, vtkIndent indent) override;
47 
49 
53  virtual void SetInterpolationMode(int mode);
55  this->SetInterpolationMode(VTK_NEAREST_INTERPOLATION); }
57  this->SetInterpolationMode(VTK_LINEAR_INTERPOLATION); }
59  this->SetInterpolationMode(VTK_CUBIC_INTERPOLATION); }
60  int GetInterpolationMode() { return this->InterpolationMode; }
61  virtual const char *GetInterpolationModeAsString();
63 
70  void ComputeSupportSize(const double matrix[16], int support[3]) override;
71 
76  bool IsSeparable() override;
77 
79 
89  const double matrix[16], const int extent[6], int newExtent[6],
90  vtkInterpolationWeights *&weights) override;
92  const float matrix[16], const int extent[6], int newExtent[6],
93  vtkInterpolationWeights *&weights) override;
95 
99  void FreePrecomputedWeights(vtkInterpolationWeights *&weights) override;
100 
101 protected:
103  ~vtkImageInterpolator() override;
104 
108  void InternalUpdate() override;
109 
114 
116 
120  void (**doublefunc)(
121  vtkInterpolationInfo *, const double [3], double *)) override;
123  void (**floatfunc)(
124  vtkInterpolationInfo *, const float [3], float *)) override;
126 
128 
132  void (**doublefunc)(
133  vtkInterpolationWeights *, int, int, int, double *, int)) override;
135  void (**floatfunc)(
136  vtkInterpolationWeights *, int, int, int, float *, int)) override;
138 
140 
141 private:
143  void operator=(const vtkImageInterpolator&) = delete;
144 };
145 
146 #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:39
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.