VTK
vtkImageSincInterpolator.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImageSincInterpolator.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 =========================================================================*/
33 #ifndef vtkImageSincInterpolator_h
34 #define vtkImageSincInterpolator_h
35 
36 #include "vtkImagingCoreModule.h" // For export macro
38 
39 #define VTK_LANCZOS_WINDOW 0
40 #define VTK_KAISER_WINDOW 1
41 #define VTK_COSINE_WINDOW 2
42 #define VTK_HANN_WINDOW 3
43 #define VTK_HAMMING_WINDOW 4
44 #define VTK_BLACKMAN_WINDOW 5
45 #define VTK_BLACKMAN_HARRIS3 6
46 #define VTK_BLACKMAN_HARRIS4 7
47 #define VTK_NUTTALL_WINDOW 8
48 #define VTK_BLACKMAN_NUTTALL3 9
49 #define VTK_BLACKMAN_NUTTALL4 10
50 #define VTK_SINC_KERNEL_SIZE_MAX 32
51 
52 class vtkImageData;
54 
57 {
58 public:
61  virtual void PrintSelf(ostream& os, vtkIndent indent);
62 
64 
70  virtual void SetWindowFunction(int mode);
72  this->SetWindowFunction(VTK_LANCZOS_WINDOW); }
74  this->SetWindowFunction(VTK_KAISER_WINDOW); }
76  this->SetWindowFunction(VTK_COSINE_WINDOW); }
78  this->SetWindowFunction(VTK_HANN_WINDOW); }
80  this->SetWindowFunction(VTK_HAMMING_WINDOW); }
82  this->SetWindowFunction(VTK_BLACKMAN_WINDOW); }
84  this->SetWindowFunction(VTK_BLACKMAN_HARRIS3); }
86  this->SetWindowFunction(VTK_BLACKMAN_HARRIS4); }
88  this->SetWindowFunction(VTK_NUTTALL_WINDOW); }
90  this->SetWindowFunction(VTK_BLACKMAN_NUTTALL3); }
92  this->SetWindowFunction(VTK_BLACKMAN_NUTTALL4); }
93  int GetWindowFunction() { return this->WindowFunction; }
94  virtual const char *GetWindowFunctionAsString();
96 
98 
104  int GetWindowHalfWidth() { return this->WindowHalfWidth; }
106 
108 
111  void UseWindowParameterOn() { this->SetUseWindowParameter(1); }
112  void UseWindowParameterOff() { this->SetUseWindowParameter(0); }
113  int GetUseWindowParameter() { return this->UseWindowParameter; }
115 
117 
123  void SetWindowParameter(double parm);
124  double GetWindowParameter() { return this->WindowParameter; }
126 
132  virtual void ComputeSupportSize(const double matrix[16], int support[3]);
133 
135 
141  void SetBlurFactors(double x, double y, double z);
142  void SetBlurFactors(const double f[3]) {
143  this->SetBlurFactors(f[0], f[1], f[2]); }
144  void GetBlurFactors(double f[3]) {
145  f[0] = this->BlurFactors[0];
146  f[1] = this->BlurFactors[1];
147  f[2] = this->BlurFactors[2]; }
148  double *GetBlurFactors() { return this->BlurFactors; }
150 
152 
160  void SetAntialiasing(int antialiasing);
161  void AntialiasingOn() { this->SetAntialiasing(1); }
162  void AntialiasingOff() { this->SetAntialiasing(0); }
163  int GetAntialiasing() { return this->Antialiasing; }
165 
167 
173  void SetRenormalization(int renormalization);
174  void RenormalizationOn() { this->SetRenormalization(1); }
175  void RenormalizationOff() { this->SetRenormalization(0); }
176  int GetRenormalization() { return this->Renormalization; }
178 
181  virtual bool IsSeparable();
182 
184 
192  const double matrix[16], const int extent[6], int newExtent[6],
195  const float matrix[16], const int extent[6], int newExtent[6],
198 
201 
202 protected:
205 
207  virtual void InternalUpdate();
208 
211 
213 
214  virtual void GetInterpolationFunc(
215  void (**doublefunc)(
216  vtkInterpolationInfo *, const double [3], double *));
217  virtual void GetInterpolationFunc(
218  void (**floatfunc)(
219  vtkInterpolationInfo *, const float [3], float *));
221 
223 
225  void (**doublefunc)(
226  vtkInterpolationWeights *, int, int, int, double *, int));
228  void (**floatfunc)(
229  vtkInterpolationWeights *, int, int, int, float *, int));
231 
233  virtual void BuildKernelLookupTable();
234 
236  virtual void FreeKernelLookupTable();
237 
240  float *KernelLookupTable[3];
241  int KernelSize[3];
244  double BlurFactors[3];
245  double LastBlurFactors[3];
248 
249 private:
250  vtkImageSincInterpolator(const vtkImageSincInterpolator&); // Not implemented.
251  void operator=(const vtkImageSincInterpolator&); // Not implemented.
252 };
253 
254 #endif
vtkgl::z
GLdouble GLdouble z
Definition: vtkgl.h:11754
VTK_BLACKMAN_HARRIS4
#define VTK_BLACKMAN_HARRIS4
Definition: vtkImageSincInterpolator.h:46
vtkImageSincInterpolator::ComputeSupportSize
virtual void ComputeSupportSize(const double matrix[16], int support[3])
vtkImageSincInterpolator::UseWindowParameterOn
void UseWindowParameterOn()
Definition: vtkImageSincInterpolator.h:111
vtkImageSincInterpolator::GetWindowHalfWidth
int GetWindowHalfWidth()
Definition: vtkImageSincInterpolator.h:104
vtkImageSincInterpolator::FreePrecomputedWeights
virtual void FreePrecomputedWeights(vtkInterpolationWeights *&weights)
VTK_HANN_WINDOW
#define VTK_HANN_WINDOW
Definition: vtkImageSincInterpolator.h:42
vtkImageSincInterpolator::SetBlurFactors
void SetBlurFactors(const double f[3])
Definition: vtkImageSincInterpolator.h:142
vtkgl::weights
const GLbyte * weights
Definition: vtkgl.h:12766
vtkImageSincInterpolator::~vtkImageSincInterpolator
~vtkImageSincInterpolator()
vtkImageSincInterpolator::GetAntialiasing
int GetAntialiasing()
Definition: vtkImageSincInterpolator.h:163
vtkImageSincInterpolator::FreeKernelLookupTable
virtual void FreeKernelLookupTable()
vtkImageSincInterpolator::SetUseWindowParameter
void SetUseWindowParameter(int val)
vtkImageSincInterpolator::SetAntialiasing
void SetAntialiasing(int antialiasing)
vtkImageSincInterpolator::SetBlurFactors
void SetBlurFactors(double x, double y, double z)
vtkgl::obj
GLsizei GLsizei GLuint * obj
Definition: vtkgl.h:11994
vtkImageSincInterpolator::InternalDeepCopy
virtual void InternalDeepCopy(vtkAbstractImageInterpolator *obj)
vtkImageSincInterpolator::InternalUpdate
virtual void InternalUpdate()
vtkImageSincInterpolator::PrecomputeWeightsForExtent
virtual void PrecomputeWeightsForExtent(const float matrix[16], const int extent[6], int newExtent[6], vtkInterpolationWeights *&weights)
vtkImageSincInterpolator::Renormalization
int Renormalization
Definition: vtkImageSincInterpolator.h:243
vtkImageSincInterpolator::SetWindowFunctionToCosine
void SetWindowFunctionToCosine()
Definition: vtkImageSincInterpolator.h:75
vtkInterpolationInfo
Definition: vtkImageInterpolatorInternals.h:26
vtkImageSincInterpolator::AntialiasingOff
void AntialiasingOff()
Definition: vtkImageSincInterpolator.h:162
vtkImageSincInterpolator::SetWindowFunctionToNuttall
void SetWindowFunctionToNuttall()
Definition: vtkImageSincInterpolator.h:87
vtkImageSincInterpolator::GetInterpolationFunc
virtual void GetInterpolationFunc(void(**floatfunc)(vtkInterpolationInfo *, const float[3], float *))
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkImageSincInterpolator::vtkImageSincInterpolator
vtkImageSincInterpolator()
vtkgl::n
GLclampd n
Definition: vtkgl.h:14370
VTK_BLACKMAN_NUTTALL4
#define VTK_BLACKMAN_NUTTALL4
Definition: vtkImageSincInterpolator.h:49
vtkgl::x
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
vtkImageSincInterpolator::SetWindowFunctionToBlackmanHarris4
void SetWindowFunctionToBlackmanHarris4()
Definition: vtkImageSincInterpolator.h:85
VTK_BLACKMAN_HARRIS3
#define VTK_BLACKMAN_HARRIS3
Definition: vtkImageSincInterpolator.h:45
vtkImageSincInterpolator::GetBlurFactors
void GetBlurFactors(double f[3])
Definition: vtkImageSincInterpolator.h:144
vtkImageSincInterpolator::SetWindowParameter
void SetWindowParameter(double parm)
vtkImageSincInterpolator::GetRenormalization
int GetRenormalization()
Definition: vtkImageSincInterpolator.h:176
VTK_COSINE_WINDOW
#define VTK_COSINE_WINDOW
Definition: vtkImageSincInterpolator.h:41
vtkImageSincInterpolator::BuildKernelLookupTable
virtual void BuildKernelLookupTable()
vtkImageSincInterpolator::GetInterpolationFunc
virtual void GetInterpolationFunc(void(**doublefunc)(vtkInterpolationInfo *, const double[3], double *))
vtkImageSincInterpolator::GetWindowFunctionAsString
virtual const char * GetWindowFunctionAsString()
vtkgl::val
GLuint GLfloat * val
Definition: vtkgl.h:13789
VTK_BLACKMAN_NUTTALL3
#define VTK_BLACKMAN_NUTTALL3
Definition: vtkImageSincInterpolator.h:48
vtkImageSincInterpolator::SetWindowHalfWidth
void SetWindowHalfWidth(int n)
vtkImageSincInterpolator::UseWindowParameterOff
void UseWindowParameterOff()
Definition: vtkImageSincInterpolator.h:112
vtkImageSincInterpolator::GetUseWindowParameter
int GetUseWindowParameter()
Definition: vtkImageSincInterpolator.h:113
vtkImageSincInterpolator::GetWindowParameter
double GetWindowParameter()
Definition: vtkImageSincInterpolator.h:124
vtkImageSincInterpolator::SetWindowFunctionToHamming
void SetWindowFunctionToHamming()
Definition: vtkImageSincInterpolator.h:79
vtkAbstractImageInterpolator.h
vtkImageSincInterpolator::GetWindowFunction
int GetWindowFunction()
Definition: vtkImageSincInterpolator.h:93
VTK_LANCZOS_WINDOW
#define VTK_LANCZOS_WINDOW
Definition: vtkImageSincInterpolator.h:39
vtkImageSincInterpolator::IsSeparable
virtual bool IsSeparable()
vtkImageSincInterpolator::GetRowInterpolationFunc
virtual void GetRowInterpolationFunc(void(**doublefunc)(vtkInterpolationWeights *, int, int, int, double *, int))
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
vtkImageSincInterpolator::UseWindowParameter
int UseWindowParameter
Definition: vtkImageSincInterpolator.h:247
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
VTK_KAISER_WINDOW
#define VTK_KAISER_WINDOW
Definition: vtkImageSincInterpolator.h:40
vtkImageSincInterpolator::PrecomputeWeightsForExtent
virtual void PrecomputeWeightsForExtent(const double matrix[16], const int extent[6], int newExtent[6], vtkInterpolationWeights *&weights)
VTK_HAMMING_WINDOW
#define VTK_HAMMING_WINDOW
Definition: vtkImageSincInterpolator.h:43
vtkImageSincInterpolator::SetWindowFunctionToBlackmanNuttall3
void SetWindowFunctionToBlackmanNuttall3()
Definition: vtkImageSincInterpolator.h:89
vtkImageSincInterpolator::PrintSelf
virtual void PrintSelf(ostream &os, vtkIndent indent)
vtkgl::f
GLclampf f
Definition: vtkgl.h:14181
vtkImageSincInterpolator::SetWindowFunctionToBlackmanHarris3
void SetWindowFunctionToBlackmanHarris3()
Definition: vtkImageSincInterpolator.h:83
vtkImageSincInterpolator::SetWindowFunctionToBlackman
void SetWindowFunctionToBlackman()
Definition: vtkImageSincInterpolator.h:81
vtkImageSincInterpolator::SetWindowFunctionToBlackmanNuttall4
void SetWindowFunctionToBlackmanNuttall4()
Definition: vtkImageSincInterpolator.h:91
vtkImageSincInterpolator::SetWindowFunctionToKaiser
void SetWindowFunctionToKaiser()
Definition: vtkImageSincInterpolator.h:73
vtkImageSincInterpolator::SetRenormalization
void SetRenormalization(int renormalization)
vtkImageSincInterpolator::SetWindowFunction
virtual void SetWindowFunction(int mode)
vtkImageSincInterpolator::SetWindowFunctionToLanczos
void SetWindowFunctionToLanczos()
Definition: vtkImageSincInterpolator.h:71
vtkgl::y
GLint GLint GLint GLint GLint GLint y
Definition: vtkgl.h:11318
vtkImageSincInterpolator::AntialiasingOn
void AntialiasingOn()
Definition: vtkImageSincInterpolator.h:161
vtkInterpolationWeights
Definition: vtkImageInterpolatorInternals.h:39
vtkgl::matrix
GLuint GLenum matrix
Definition: vtkgl.h:16451
vtkImageSincInterpolator::GetRowInterpolationFunc
virtual void GetRowInterpolationFunc(void(**floatfunc)(vtkInterpolationWeights *, int, int, int, float *, int))
VTK_NUTTALL_WINDOW
#define VTK_NUTTALL_WINDOW
Definition: vtkImageSincInterpolator.h:47
vtkImageSincInterpolator::RenormalizationOff
void RenormalizationOff()
Definition: vtkImageSincInterpolator.h:175
vtkImageSincInterpolator::WindowHalfWidth
int WindowHalfWidth
Definition: vtkImageSincInterpolator.h:239
vtkImageSincInterpolator::Antialiasing
int Antialiasing
Definition: vtkImageSincInterpolator.h:242
vtkImageSincInterpolator::New
static vtkImageSincInterpolator * New()
vtkImagingCoreModule.h
vtkX3D::extent
@ extent
Definition: vtkX3D.h:345
vtkImageSincInterpolator
perform sinc interpolation on images
Definition: vtkImageSincInterpolator.h:57
VTKIMAGINGCORE_EXPORT
#define VTKIMAGINGCORE_EXPORT
Definition: vtkImagingCoreModule.h:15
vtkAbstractImageInterpolator
interpolate data values from images
Definition: vtkAbstractImageInterpolator.h:46
vtkgl::mode
GLenum mode
Definition: vtkgl.h:12325
vtkImageSincInterpolator::SetWindowFunctionToHann
void SetWindowFunctionToHann()
Definition: vtkImageSincInterpolator.h:77
vtkImageSincInterpolator::WindowParameter
double WindowParameter
Definition: vtkImageSincInterpolator.h:246
vtkImageSincInterpolator::RenormalizationOn
void RenormalizationOn()
Definition: vtkImageSincInterpolator.h:174
VTK_BLACKMAN_WINDOW
#define VTK_BLACKMAN_WINDOW
Definition: vtkImageSincInterpolator.h:44
vtkImageSincInterpolator::GetBlurFactors
double * GetBlurFactors()
Definition: vtkImageSincInterpolator.h:148
vtkImageSincInterpolator::WindowFunction
int WindowFunction
Definition: vtkImageSincInterpolator.h:238