VTK  9.0.1
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 =========================================================================*/
28 #ifndef vtkImageInterpolator_h
29 #define vtkImageInterpolator_h
30 
32 #include "vtkImagingCoreModule.h" // For export macro
33 
34 class VTKIMAGINGCORE_EXPORT vtkImageInterpolator : public vtkAbstractImageInterpolator
35 {
36 public:
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
42 
46  virtual void SetInterpolationMode(int mode);
47  void SetInterpolationModeToNearest() { this->SetInterpolationMode(VTK_NEAREST_INTERPOLATION); }
48  void SetInterpolationModeToLinear() { this->SetInterpolationMode(VTK_LINEAR_INTERPOLATION); }
49  void SetInterpolationModeToCubic() { this->SetInterpolationMode(VTK_CUBIC_INTERPOLATION); }
50  int GetInterpolationMode() { return this->InterpolationMode; }
51  virtual const char* GetInterpolationModeAsString();
53 
60  void ComputeSupportSize(const double matrix[16], int support[3]) override;
61 
66  bool IsSeparable() override;
67 
69 
78  void PrecomputeWeightsForExtent(const double matrix[16], const int extent[6], int newExtent[6],
79  vtkInterpolationWeights*& weights) override;
80  void PrecomputeWeightsForExtent(const float matrix[16], const int extent[6], int newExtent[6],
81  vtkInterpolationWeights*& weights) override;
83 
88 
89 protected:
92 
96  void InternalUpdate() override;
97 
102 
104 
108  void (**doublefunc)(vtkInterpolationInfo*, const double[3], double*)) override;
110  void (**floatfunc)(vtkInterpolationInfo*, const float[3], float*)) override;
112 
114 
118  void (**doublefunc)(vtkInterpolationWeights*, int, int, int, double*, int)) override;
120  void (**floatfunc)(vtkInterpolationWeights*, int, int, int, float*, int)) override;
122 
124 
125 private:
127  void operator=(const vtkImageInterpolator&) = delete;
128 };
129 
130 #endif
vtkImageInterpolator::GetRowInterpolationFunc
void GetRowInterpolationFunc(void(**doublefunc)(vtkInterpolationWeights *, int, int, int, double *, int)) override
Get the row interpolation functions.
vtkImageInterpolator::FreePrecomputedWeights
void FreePrecomputedWeights(vtkInterpolationWeights *&weights) override
Free the precomputed weights.
vtkInterpolationInfo
Definition: vtkImageInterpolatorInternals.h:27
vtkImageInterpolator::InternalUpdate
void InternalUpdate() override
Update the interpolator.
VTK_CUBIC_INTERPOLATION
#define VTK_CUBIC_INTERPOLATION
Definition: vtkSystemIncludes.h:96
vtkImageInterpolator::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
VTK_NEAREST_INTERPOLATION
#define VTK_NEAREST_INTERPOLATION
Definition: vtkSystemIncludes.h:94
vtkImageInterpolator::SetInterpolationModeToCubic
void SetInterpolationModeToCubic()
Definition: vtkImageInterpolator.h:49
vtkImageInterpolator::New
static vtkImageInterpolator * New()
vtkImageInterpolator
interpolate data values from images
Definition: vtkImageInterpolator.h:35
vtkImageInterpolator::SetInterpolationMode
virtual void SetInterpolationMode(int mode)
The interpolation mode for point scalars (default: linear).
vtkImageInterpolator::GetInterpolationFunc
void GetInterpolationFunc(void(**doublefunc)(vtkInterpolationInfo *, const double[3], double *)) override
Get the interpolation functions.
vtkImageInterpolator::~vtkImageInterpolator
~vtkImageInterpolator() override
vtkImageInterpolator::GetInterpolationMode
int GetInterpolationMode()
Definition: vtkImageInterpolator.h:50
vtkImageInterpolator::vtkImageInterpolator
vtkImageInterpolator()
vtkImageInterpolator::InterpolationMode
int InterpolationMode
Definition: vtkImageInterpolator.h:123
vtkAbstractImageInterpolator.h
vtkImageInterpolator::PrecomputeWeightsForExtent
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...
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
VTK_LINEAR_INTERPOLATION
#define VTK_LINEAR_INTERPOLATION
Definition: vtkSystemIncludes.h:95
vtkImageInterpolator::ComputeSupportSize
void ComputeSupportSize(const double matrix[16], int support[3]) override
Get the support size for use in computing update extents.
vtkImageInterpolator::IsSeparable
bool IsSeparable() override
Returns true if the interpolator supports weight precomputation.
vtkImageInterpolator::GetRowInterpolationFunc
void GetRowInterpolationFunc(void(**floatfunc)(vtkInterpolationWeights *, int, int, int, float *, int)) override
vtkInterpolationWeights
Definition: vtkImageInterpolatorInternals.h:40
vtkImageInterpolator::PrecomputeWeightsForExtent
void PrecomputeWeightsForExtent(const float matrix[16], const int extent[6], int newExtent[6], vtkInterpolationWeights *&weights) override
vtkX3D::mode
@ mode
Definition: vtkX3D.h:253
vtkX3D::extent
@ extent
Definition: vtkX3D.h:351
vtkAbstractImageInterpolator
interpolate data values from images
Definition: vtkAbstractImageInterpolator.h:47
vtkImageInterpolator::SetInterpolationModeToNearest
void SetInterpolationModeToNearest()
Definition: vtkImageInterpolator.h:47
vtkImageInterpolator::SetInterpolationModeToLinear
void SetInterpolationModeToLinear()
Definition: vtkImageInterpolator.h:48
vtkImageInterpolator::GetInterpolationModeAsString
virtual const char * GetInterpolationModeAsString()
vtkImageInterpolator::InternalDeepCopy
void InternalDeepCopy(vtkAbstractImageInterpolator *obj) override
Copy all members.
vtkImageInterpolator::GetInterpolationFunc
void GetInterpolationFunc(void(**floatfunc)(vtkInterpolationInfo *, const float[3], float *)) override