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:
59  static vtkImageSincInterpolator *New();
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 
103  void SetWindowHalfWidth(int n);
104  int GetWindowHalfWidth() { return this->WindowHalfWidth; }
106 
108 
110  void SetUseWindowParameter(int val);
111  void UseWindowParameterOn() { this->SetUseWindowParameter(1); }
112  void UseWindowParameterOff() { this->SetUseWindowParameter(0); }
113  int GetUseWindowParameter() { return this->UseWindowParameter; }
115 
117 
122  void SetWindowParameter(double parm);
123  double GetWindowParameter() { return this->WindowParameter; }
125 
131  virtual void ComputeSupportSize(const double matrix[16], int support[3]);
132 
134 
140  void SetBlurFactors(double x, double y, double z);
141  void SetBlurFactors(const double f[3]) {
142  this->SetBlurFactors(f[0], f[1], f[2]); }
143  void GetBlurFactors(double f[3]) {
144  f[0] = this->BlurFactors[0];
145  f[1] = this->BlurFactors[1];
146  f[2] = this->BlurFactors[2]; }
147  double *GetBlurFactors() { return this->BlurFactors; }
149 
151 
159  void SetAntialiasing(int antialiasing);
160  void AntialiasingOn() { this->SetAntialiasing(1); }
161  void AntialiasingOff() { this->SetAntialiasing(0); }
162  int GetAntialiasing() { return this->Antialiasing; }
164 
166 
172  void SetRenormalization(int antialiasing);
173  void RenormalizationOn() { this->SetRenormalization(1); }
174  void RenormalizationOff() { this->SetRenormalization(0); }
175  int GetRenormalization() { return this->Renormalization; }
177 
180  virtual bool IsSeparable();
181 
183 
190  virtual void PrecomputeWeightsForExtent(
191  const double matrix[16], const int extent[6], int newExtent[6],
193  virtual void PrecomputeWeightsForExtent(
194  const float matrix[16], const int extent[6], int newExtent[6],
197 
200 
201 protected:
204 
206  virtual void InternalUpdate();
207 
210 
212 
213  virtual void GetInterpolationFunc(
214  void (**doublefunc)(
215  vtkInterpolationInfo *, const double [3], double *));
216  virtual void GetInterpolationFunc(
217  void (**floatfunc)(
218  vtkInterpolationInfo *, const float [3], float *));
220 
222 
223  virtual void GetRowInterpolationFunc(
224  void (**doublefunc)(
225  vtkInterpolationWeights *, int, int, int, double *, int));
226  virtual void GetRowInterpolationFunc(
227  void (**floatfunc)(
228  vtkInterpolationWeights *, int, int, int, float *, int));
230 
232  virtual void BuildKernelLookupTable();
233 
235  virtual void FreeKernelLookupTable();
236 
239  float *KernelLookupTable[3];
240  int KernelSize[3];
243  double BlurFactors[3];
244  double LastBlurFactors[3];
247 
248 private:
249  vtkImageSincInterpolator(const vtkImageSincInterpolator&); // Not implemented.
250  void operator=(const vtkImageSincInterpolator&); // Not implemented.
251 };
252 
253 #endif
interpolate data values from images
GLclampf f
Definition: vtkgl.h:14181
#define VTK_KAISER_WINDOW
#define VTK_LANCZOS_WINDOW
GLsizei GLsizei GLuint * obj
Definition: vtkgl.h:11994
virtual void InternalDeepCopy(vtkAbstractImageInterpolator *obj)=0
virtual void InternalUpdate()=0
GLint GLint GLint GLint GLint GLint y
Definition: vtkgl.h:11318
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:619
#define VTK_NUTTALL_WINDOW
#define VTK_BLACKMAN_NUTTALL4
GLuint GLenum matrix
Definition: vtkgl.h:16451
GLdouble GLdouble z
Definition: vtkgl.h:11754
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
const GLbyte * weights
Definition: vtkgl.h:12766
a simple class to control print indentation
Definition: vtkIndent.h:38
virtual void PrecomputeWeightsForExtent(const double matrix[16], const int extent[6], int checkExtent[6], vtkInterpolationWeights *&weights)
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
virtual void GetRowInterpolationFunc(void(**doublefunc)(vtkInterpolationWeights *, int, int, int, double *, int))
virtual void GetInterpolationFunc(void(**doublefunc)(vtkInterpolationInfo *, const double[3], double *))
#define VTKIMAGINGCORE_EXPORT
virtual bool IsSeparable()=0
#define VTK_BLACKMAN_HARRIS4
#define VTK_HANN_WINDOW
virtual void FreePrecomputedWeights(vtkInterpolationWeights *&weights)
#define VTK_BLACKMAN_WINDOW
#define VTK_BLACKMAN_HARRIS3
GLclampd n
Definition: vtkgl.h:14370
#define VTK_HAMMING_WINDOW
virtual void PrintSelf(ostream &os, vtkIndent indent)
#define VTK_BLACKMAN_NUTTALL3
perform sinc interpolation on images
static vtkObject * New()
GLenum mode
Definition: vtkgl.h:12325
virtual void ComputeSupportSize(const double matrix[16], int support[3])=0
void SetBlurFactors(const double f[3])
GLuint GLfloat * val
Definition: vtkgl.h:13789
#define VTK_COSINE_WINDOW