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 
37 
38 #define VTK_LANCZOS_WINDOW 0
39 #define VTK_KAISER_WINDOW 1
40 #define VTK_COSINE_WINDOW 2
41 #define VTK_HANN_WINDOW 3
42 #define VTK_HAMMING_WINDOW 4
43 #define VTK_BLACKMAN_WINDOW 5
44 #define VTK_BLACKMAN_HARRIS3 6
45 #define VTK_BLACKMAN_HARRIS4 7
46 #define VTK_NUTTALL_WINDOW 8
47 #define VTK_BLACKMAN_NUTTALL3 9
48 #define VTK_BLACKMAN_NUTTALL4 10
49 #define VTK_SINC_KERNEL_SIZE_MAX 32
50 
51 class vtkImageData;
53 
56 {
57 public:
58  static vtkImageSincInterpolator *New();
60  virtual void PrintSelf(ostream& os, vtkIndent indent);
61 
63 
69  virtual void SetWindowFunction(int mode);
71  this->SetWindowFunction(VTK_LANCZOS_WINDOW); }
73  this->SetWindowFunction(VTK_KAISER_WINDOW); }
75  this->SetWindowFunction(VTK_COSINE_WINDOW); }
77  this->SetWindowFunction(VTK_HANN_WINDOW); }
79  this->SetWindowFunction(VTK_HAMMING_WINDOW); }
81  this->SetWindowFunction(VTK_BLACKMAN_WINDOW); }
83  this->SetWindowFunction(VTK_BLACKMAN_HARRIS3); }
85  this->SetWindowFunction(VTK_BLACKMAN_HARRIS4); }
87  this->SetWindowFunction(VTK_NUTTALL_WINDOW); }
89  this->SetWindowFunction(VTK_BLACKMAN_NUTTALL3); }
91  this->SetWindowFunction(VTK_BLACKMAN_NUTTALL4); }
92  int GetWindowFunction() { return this->WindowFunction; }
93  virtual const char *GetWindowFunctionAsString();
95 
97 
102  void SetWindowHalfWidth(int n);
103  int GetWindowHalfWidth() { return this->WindowHalfWidth; }
105 
107 
109  void SetUseWindowParameter(int val);
110  void UseWindowParameterOn() { this->SetUseWindowParameter(1); }
111  void UseWindowParameterOff() { this->SetUseWindowParameter(0); }
112  int GetUseWindowParameter() { return this->UseWindowParameter; }
114 
116 
121  void SetWindowParameter(double parm);
122  double GetWindowParameter() { return this->WindowParameter; }
124 
130  virtual void ComputeSupportSize(const double matrix[16], int support[3]);
131 
133 
139  void SetBlurFactors(double x, double y, double z);
140  void SetBlurFactors(const double f[3]) {
141  this->SetBlurFactors(f[0], f[1], f[2]); }
142  void GetBlurFactors(double f[3]) {
143  f[0] = this->BlurFactors[0];
144  f[1] = this->BlurFactors[1];
145  f[2] = this->BlurFactors[2]; }
146  double *GetBlurFactors() { return this->BlurFactors; }
148 
150 
158  void SetAntialiasing(int antialiasing);
159  void AntialiasingOn() { this->SetAntialiasing(1); }
160  void AntialiasingOff() { this->SetAntialiasing(0); }
161  int GetAntialiasing() { return this->Antialiasing; }
163 
165 
171  void SetRenormalization(int antialiasing);
172  void RenormalizationOn() { this->SetRenormalization(1); }
173  void RenormalizationOff() { this->SetRenormalization(0); }
174  int GetRenormalization() { return this->Renormalization; }
176 
179  virtual bool IsSeparable();
180 
182 
189  virtual void PrecomputeWeightsForExtent(
190  const double matrix[16], const int extent[6], int newExtent[6],
191  vtkInterpolationWeights *&weights);
192  virtual void PrecomputeWeightsForExtent(
193  const float matrix[16], const int extent[6], int newExtent[6],
194  vtkInterpolationWeights *&weights);
196 
198  virtual void FreePrecomputedWeights(vtkInterpolationWeights *&weights);
199 
200 protected:
203 
205  virtual void InternalUpdate();
206 
209 
211 
212  virtual void GetInterpolationFunc(
213  void (**doublefunc)(
214  vtkInterpolationInfo *, const double [3], double *));
215  virtual void GetInterpolationFunc(
216  void (**floatfunc)(
217  vtkInterpolationInfo *, const float [3], float *));
219 
221 
222  virtual void GetRowInterpolationFunc(
223  void (**doublefunc)(
224  vtkInterpolationWeights *, int, int, int, double *, int));
225  virtual void GetRowInterpolationFunc(
226  void (**floatfunc)(
227  vtkInterpolationWeights *, int, int, int, float *, int));
229 
231  virtual void BuildKernelLookupTable();
232 
234  virtual void FreeKernelLookupTable();
235 
238  float *KernelLookupTable[3];
239  int KernelSize[3];
242  double BlurFactors[3];
243  double LastBlurFactors[3];
246 
247 private:
248  vtkImageSincInterpolator(const vtkImageSincInterpolator&); // Not implemented.
249  void operator=(const vtkImageSincInterpolator&); // Not implemented.
250 };
251 
252 #endif