VTK
dox/Imaging/Core/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 "vtkImagingCoreModule.h" // For export macro
00043 #include "vtkAbstractImageInterpolator.h"
00044 
00045 #define VTK_IMAGE_BSPLINE_DEGREE_MAX 9
00046 
00047 class vtkImageData;
00048 struct vtkInterpolationInfo;
00049 
00050 class VTKIMAGINGCORE_EXPORT vtkImageBSplineInterpolator :
00051   public vtkAbstractImageInterpolator
00052 {
00053 public:
00054   static vtkImageBSplineInterpolator *New();
00055   vtkTypeMacro(vtkImageBSplineInterpolator, vtkAbstractImageInterpolator);
00056   virtual void PrintSelf(ostream& os, vtkIndent indent);
00057 
00059 
00062   void SetSplineDegree(int degree);
00063   int GetSplineDegree() { return this->SplineDegree; };
00064   int GetSplineDegreeMinValue() { return 0; }
00065   int GetSplineDegreeMaxValue() { return VTK_IMAGE_BSPLINE_DEGREE_MAX; }
00067 
00073   virtual void ComputeSupportSize(const double matrix[16], int support[3]);
00074 
00077   virtual bool IsSeparable();
00078 
00080 
00087   virtual void PrecomputeWeightsForExtent(
00088     const double matrix[16], const int extent[6], int newExtent[6],
00089     vtkInterpolationWeights *&weights);
00090   virtual void PrecomputeWeightsForExtent(
00091     const float matrix[16], const int extent[6], int newExtent[6],
00092     vtkInterpolationWeights *&weights);
00094 
00096   virtual void FreePrecomputedWeights(vtkInterpolationWeights *&weights);
00097 
00098 protected:
00099   vtkImageBSplineInterpolator();
00100   ~vtkImageBSplineInterpolator();
00101 
00103   virtual void InternalUpdate();
00104 
00106   virtual void InternalDeepCopy(vtkAbstractImageInterpolator *obj);
00107 
00109 
00110   virtual void GetInterpolationFunc(
00111     void (**doublefunc)(
00112       vtkInterpolationInfo *, const double [3], double *));
00113   virtual void GetInterpolationFunc(
00114     void (**floatfunc)(
00115       vtkInterpolationInfo *, const float [3], float *));
00117 
00119 
00120   virtual void GetRowInterpolationFunc(
00121     void (**doublefunc)(
00122       vtkInterpolationWeights *, int, int, int, double *, int));
00123   virtual void GetRowInterpolationFunc(
00124     void (**floatfunc)(
00125       vtkInterpolationWeights *, int, int, int, float *, int));
00127 
00129   virtual void BuildKernelLookupTable();
00130 
00132   virtual void FreeKernelLookupTable();
00133 
00134   int SplineDegree;
00135   float *KernelLookupTable;
00136 
00137 private:
00138   vtkImageBSplineInterpolator(const vtkImageBSplineInterpolator&);  // Not implemented.
00139   void operator=(const vtkImageBSplineInterpolator&);  // Not implemented.
00140 };
00141 
00142 #endif