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 
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 
191  virtual void PrecomputeWeightsForExtent(
192  const double matrix[16], const int extent[6], int newExtent[6],
193  vtkInterpolationWeights *&weights);
194  virtual void PrecomputeWeightsForExtent(
195  const float matrix[16], const int extent[6], int newExtent[6],
196  vtkInterpolationWeights *&weights);
198 
200  virtual void FreePrecomputedWeights(vtkInterpolationWeights *&weights);
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 
224  virtual void GetRowInterpolationFunc(
225  void (**doublefunc)(
226  vtkInterpolationWeights *, int, int, int, double *, int));
227  virtual void GetRowInterpolationFunc(
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
interpolate data values from images
#define VTK_KAISER_WINDOW
#define VTK_LANCZOS_WINDOW
virtual void InternalDeepCopy(vtkAbstractImageInterpolator *obj)=0
virtual void InternalUpdate()=0
#define VTK_NUTTALL_WINDOW
#define VTK_BLACKMAN_NUTTALL4
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
#define VTK_HAMMING_WINDOW
virtual void PrintSelf(ostream &os, vtkIndent indent)
#define VTK_BLACKMAN_NUTTALL3
perform sinc interpolation on images
static vtkObject * New()
virtual void ComputeSupportSize(const double matrix[16], int support[3])=0
void SetBlurFactors(const double f[3])
#define VTK_COSINE_WINDOW