Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtkThinPlateSplineTransform.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkThinPlateSplineTransform.h,v $
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 =========================================================================*/
00051 #ifndef __vtkThinPlateSplineTransform_h
00052 #define __vtkThinPlateSplineTransform_h
00053 
00054 #include "vtkWarpTransform.h"
00055 
00056 #define VTK_RBF_CUSTOM 0
00057 #define VTK_RBF_R      1
00058 #define VTK_RBF_R2LOGR 2
00059 
00060 class VTK_HYBRID_EXPORT vtkThinPlateSplineTransform : public vtkWarpTransform
00061 {
00062 public:
00063   vtkTypeRevisionMacro(vtkThinPlateSplineTransform,vtkWarpTransform);
00064   void PrintSelf(ostream& os, vtkIndent indent);
00065   static vtkThinPlateSplineTransform *New();
00066 
00068 
00069   vtkGetMacro(Sigma,double);
00070   vtkSetMacro(Sigma,double);
00072 
00074 
00078   void SetBasis(int basis);
00079   vtkGetMacro(Basis,int);
00080   void SetBasisToR() { this->SetBasis(VTK_RBF_R); };
00081   void SetBasisToR2LogR() { this->SetBasis(VTK_RBF_R2LOGR); };
00082   const char *GetBasisAsString();
00084 
00085 //BTX
00087 
00089   void SetBasisFunction(double (*U)(double r)) {
00090     if (this->BasisFunction == U) { return; }
00091     this->SetBasis(VTK_RBF_CUSTOM);
00092     this->BasisFunction = U; 
00093     this->Modified(); };
00094   void SetBasisDerivative(double (*dUdr)(double r, double &dU)) {
00095     this->BasisDerivative = dUdr; 
00096     this->Modified(); };    
00098 //ETX
00099 
00101 
00104   void SetSourceLandmarks(vtkPoints *source);
00105   vtkGetObjectMacro(SourceLandmarks,vtkPoints);
00107 
00109 
00112   void SetTargetLandmarks(vtkPoints *target);
00113   vtkGetObjectMacro(TargetLandmarks,vtkPoints);
00115 
00117   unsigned long GetMTime();
00118 
00120   vtkAbstractTransform *MakeTransform();
00121 
00122 protected:
00123   vtkThinPlateSplineTransform();
00124   ~vtkThinPlateSplineTransform();
00125 
00127   void InternalUpdate();
00128 
00130   void InternalDeepCopy(vtkAbstractTransform *transform);
00131 
00132   void ForwardTransformPoint(const float in[3], float out[3]);
00133   void ForwardTransformPoint(const double in[3], double out[3]);
00134 
00135   void ForwardTransformDerivative(const float in[3], float out[3],
00136                                   float derivative[3][3]);
00137   void ForwardTransformDerivative(const double in[3], double out[3],
00138                                   double derivative[3][3]);
00139 
00140   double Sigma;
00141   vtkPoints *SourceLandmarks;
00142   vtkPoints *TargetLandmarks;
00143 
00144 //BTX
00145   // the radial basis function to use
00146   double (*BasisFunction)(double r);
00147   double (*BasisDerivative)(double r, double& dUdr);
00148 //ETX
00149   int Basis;
00150 
00151   int NumberOfPoints;
00152   double **MatrixW;
00153 private:
00154   vtkThinPlateSplineTransform(const vtkThinPlateSplineTransform&);  // Not implemented.
00155   void operator=(const vtkThinPlateSplineTransform&);  // Not implemented.
00156 };
00157 
00158 #endif
00159 
00160 
00161 
00162 
00163