Hybrid/vtkThinPlateSplineTransform.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
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
00066 void SetBasis(int basis);
00067 vtkGetMacro(Basis,int);
00068 void SetBasisToR() { this->SetBasis(VTK_RBF_R); };
00069 void SetBasisToR2LogR() { this->SetBasis(VTK_RBF_R2LOGR); };
00070 const char *GetBasisAsString();
00072
00073
00075
00077 void SetBasisFunction(double (*U)(double r)) {
00078 if (this->BasisFunction == U) { return; }
00079 this->SetBasis(VTK_RBF_CUSTOM);
00080 this->BasisFunction = U;
00081 this->Modified(); };
00082 void SetBasisDerivative(double (*dUdr)(double r, double &dU)) {
00083 this->BasisDerivative = dUdr;
00084 this->Modified(); };
00086
00087
00089
00092 void SetSourceLandmarks(vtkPoints *source);
00093 vtkGetObjectMacro(SourceLandmarks,vtkPoints);
00095
00097
00100 void SetTargetLandmarks(vtkPoints *target);
00101 vtkGetObjectMacro(TargetLandmarks,vtkPoints);
00103
00105 unsigned long GetMTime();
00106
00108 vtkAbstractTransform *MakeTransform();
00109
00110 protected:
00111 vtkThinPlateSplineTransform();
00112 ~vtkThinPlateSplineTransform();
00113
00115 void InternalUpdate();
00116
00118 void InternalDeepCopy(vtkAbstractTransform *transform);
00119
00120 void ForwardTransformPoint(const float in[3], float out[3]);
00121 void ForwardTransformPoint(const double in[3], double out[3]);
00122
00123 void ForwardTransformDerivative(const float in[3], float out[3],
00124 float derivative[3][3]);
00125 void ForwardTransformDerivative(const double in[3], double out[3],
00126 double derivative[3][3]);
00127
00128 double Sigma;
00129 vtkPoints *SourceLandmarks;
00130 vtkPoints *TargetLandmarks;
00131
00132
00133
00134 double (*BasisFunction)(double r);
00135 double (*BasisDerivative)(double r, double& dUdr);
00136
00137 int Basis;
00138
00139 int NumberOfPoints;
00140 double **MatrixW;
00141 private:
00142 vtkThinPlateSplineTransform(const vtkThinPlateSplineTransform&);
00143 void operator=(const vtkThinPlateSplineTransform&);
00144 };
00145
00146 #endif
00147
00148
00149
00150
00151