VTK
vtkThinPlateSplineTransform.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkThinPlateSplineTransform.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
41 #ifndef __vtkThinPlateSplineTransform_h
42 #define __vtkThinPlateSplineTransform_h
43 
44 #include "vtkWarpTransform.h"
45 
46 #define VTK_RBF_CUSTOM 0
47 #define VTK_RBF_R 1
48 #define VTK_RBF_R2LOGR 2
49 
51 {
52 public:
54  void PrintSelf(ostream& os, vtkIndent indent);
56 
58 
59  vtkGetMacro(Sigma,double);
60  vtkSetMacro(Sigma,double);
62 
64 
68  void SetBasis(int basis);
69  vtkGetMacro(Basis,int);
70  void SetBasisToR() { this->SetBasis(VTK_RBF_R); };
71  void SetBasisToR2LogR() { this->SetBasis(VTK_RBF_R2LOGR); };
72  const char *GetBasisAsString();
74 
75 //BTX
77 
79  void SetBasisFunction(double (*U)(double r)) {
80  if (this->BasisFunction == U) { return; }
81  this->SetBasis(VTK_RBF_CUSTOM);
82  this->BasisFunction = U;
83  this->Modified(); };
84  void SetBasisDerivative(double (*dUdr)(double r, double &dU)) {
85  this->BasisDerivative = dUdr;
86  this->Modified(); };
87 //ETX
89 
91 
94  void SetSourceLandmarks(vtkPoints *source);
95  vtkGetObjectMacro(SourceLandmarks,vtkPoints);
97 
99 
102  void SetTargetLandmarks(vtkPoints *target);
103  vtkGetObjectMacro(TargetLandmarks,vtkPoints);
105 
107  unsigned long GetMTime();
108 
111 
112 protected:
115 
117  void InternalUpdate();
118 
120  void InternalDeepCopy(vtkAbstractTransform *transform);
121 
122  void ForwardTransformPoint(const float in[3], float out[3]);
123  void ForwardTransformPoint(const double in[3], double out[3]);
124 
125  void ForwardTransformDerivative(const float in[3], float out[3],
126  float derivative[3][3]);
127  void ForwardTransformDerivative(const double in[3], double out[3],
128  double derivative[3][3]);
129 
130  double Sigma;
133 
134 //BTX
135  // the radial basis function to use
136  double (*BasisFunction)(double r);
137  double (*BasisDerivative)(double r, double& dUdr);
138 //ETX
139  int Basis;
140 
142  double **MatrixW;
143 private:
144  vtkThinPlateSplineTransform(const vtkThinPlateSplineTransform&); // Not implemented.
145  void operator=(const vtkThinPlateSplineTransform&); // Not implemented.
146 };
147 
148 #endif
149 
150 
151 
152 
153