VTK
dox/Filtering/vtkImageBSplineInterpolator.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkImageBSplineInterpolator.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00039 #ifndef __vtkImageBSplineInterpolator_h
00040 #define __vtkImageBSplineInterpolator_h
00041 
00042 #include "vtkAbstractImageInterpolator.h"
00043 
00044 #define VTK_IMAGE_BSPLINE_DEGREE_MAX 9
00045 
00046 class vtkImageData;
00047 struct vtkInterpolationInfo;
00048 
00049 class VTK_FILTERING_EXPORT vtkImageBSplineInterpolator :
00050   public vtkAbstractImageInterpolator
00051 {
00052 public:
00053   static vtkImageBSplineInterpolator *New();
00054   vtkTypeMacro(vtkImageBSplineInterpolator, vtkAbstractImageInterpolator);
00055   virtual void PrintSelf(ostream& os, vtkIndent indent);
00056 
00058 
00061   void SetSplineDegree(int degree);
00062   int GetSplineDegree() { return this->SplineDegree; };
00063   int GetSplineDegreeMinValue() { return 0; }
00064   int GetSplineDegreeMaxValue() { return VTK_IMAGE_BSPLINE_DEGREE_MAX; }
00066 
00072   virtual void ComputeSupportSize(const double matrix[16], int support[3]);
00073 
00076   virtual bool IsSeparable();
00077 
00079 
00086   virtual void PrecomputeWeightsForExtent(
00087     const double matrix[16], const int extent[6], int newExtent[6],
00088     vtkInterpolationWeights *&weights);
00089   virtual void PrecomputeWeightsForExtent(
00090     const float matrix[16], const int extent[6], int newExtent[6],
00091     vtkInterpolationWeights *&weights);
00093 
00095   virtual void FreePrecomputedWeights(vtkInterpolationWeights *&weights);
00096 
00097 protected:
00098   vtkImageBSplineInterpolator();
00099   ~vtkImageBSplineInterpolator();
00100 
00102   virtual void InternalUpdate();
00103 
00105   virtual void InternalDeepCopy(vtkAbstractImageInterpolator *obj);
00106 
00108 
00109   virtual void GetInterpolationFunc(
00110     void (**doublefunc)(
00111       vtkInterpolationInfo *, const double [3], double *));
00112   virtual void GetInterpolationFunc(
00113     void (**floatfunc)(
00114       vtkInterpolationInfo *, const float [3], float *));
00116 
00118 
00119   virtual void GetRowInterpolationFunc(
00120     void (**doublefunc)(
00121       vtkInterpolationWeights *, int, int, int, double *, int));
00122   virtual void GetRowInterpolationFunc(
00123     void (**floatfunc)(
00124       vtkInterpolationWeights *, int, int, int, float *, int));
00126 
00128   virtual void BuildKernelLookupTable();
00129 
00131   virtual void FreeKernelLookupTable();
00132 
00133   int SplineDegree;
00134   float *KernelLookupTable;
00135 
00136 private:
00137   vtkImageBSplineInterpolator(const vtkImageBSplineInterpolator&);  // Not implemented.
00138   void operator=(const vtkImageBSplineInterpolator&);  // Not implemented.
00139 };
00140 
00141 #endif