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

Hybrid/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 =========================================================================*/
00041 #ifndef __vtkThinPlateSplineTransform_h
00042 #define __vtkThinPlateSplineTransform_h
00043 
00044 #include "vtkWarpTransform.h"
00045 
00046 #define VTK_RBF_CUSTOM 0
00047 #define VTK_RBF_R      1
00048 #define VTK_RBF_R2LOGR 2
00049 
00050 class VTK_HYBRID_EXPORT vtkThinPlateSplineTransform : public vtkWarpTransform
00051 {
00052 public:
00053   vtkTypeRevisionMacro(vtkThinPlateSplineTransform,vtkWarpTransform);
00054   void PrintSelf(ostream& os, vtkIndent indent);
00055   static vtkThinPlateSplineTransform *New();
00056 
00058 
00059   vtkGetMacro(Sigma,double);
00060   vtkSetMacro(Sigma,double);
00062 
00064 
00068   void SetBasis(int basis);
00069   vtkGetMacro(Basis,int);
00070   void SetBasisToR() { this->SetBasis(VTK_RBF_R); };
00071   void SetBasisToR2LogR() { this->SetBasis(VTK_RBF_R2LOGR); };
00072   const char *GetBasisAsString();
00074 
00075 //BTX
00077 
00079   void SetBasisFunction(double (*U)(double r)) {
00080     if (this->BasisFunction == U) { return; }
00081     this->SetBasis(VTK_RBF_CUSTOM);
00082     this->BasisFunction = U; 
00083     this->Modified(); };
00084   void SetBasisDerivative(double (*dUdr)(double r, double &dU)) {
00085     this->BasisDerivative = dUdr; 
00086     this->Modified(); };    
00088 //ETX
00089 
00091 
00094   void SetSourceLandmarks(vtkPoints *source);
00095   vtkGetObjectMacro(SourceLandmarks,vtkPoints);
00097 
00099 
00102   void SetTargetLandmarks(vtkPoints *target);
00103   vtkGetObjectMacro(TargetLandmarks,vtkPoints);
00105 
00107   unsigned long GetMTime();
00108 
00110   vtkAbstractTransform *MakeTransform();
00111 
00112 protected:
00113   vtkThinPlateSplineTransform();
00114   ~vtkThinPlateSplineTransform();
00115 
00117   void InternalUpdate();
00118 
00120   void InternalDeepCopy(vtkAbstractTransform *transform);
00121 
00122   void ForwardTransformPoint(const float in[3], float out[3]);
00123   void ForwardTransformPoint(const double in[3], double out[3]);
00124 
00125   void ForwardTransformDerivative(const float in[3], float out[3],
00126                                   float derivative[3][3]);
00127   void ForwardTransformDerivative(const double in[3], double out[3],
00128                                   double derivative[3][3]);
00129 
00130   double Sigma;
00131   vtkPoints *SourceLandmarks;
00132   vtkPoints *TargetLandmarks;
00133 
00134 //BTX
00135   // the radial basis function to use
00136   double (*BasisFunction)(double r);
00137   double (*BasisDerivative)(double r, double& dUdr);
00138 //ETX
00139   int Basis;
00140 
00141   int NumberOfPoints;
00142   double **MatrixW;
00143 private:
00144   vtkThinPlateSplineTransform(const vtkThinPlateSplineTransform&);  // Not implemented.
00145   void operator=(const vtkThinPlateSplineTransform&);  // Not implemented.
00146 };
00147 
00148 #endif
00149 
00150 
00151 
00152 
00153