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 "vtkCommonTransformsModule.h" // For export macro
45 #include "vtkWarpTransform.h"
46 
47 #define VTK_RBF_CUSTOM 0
48 #define VTK_RBF_R 1
49 #define VTK_RBF_R2LOGR 2
50 
52 {
53 public:
55  void PrintSelf(ostream& os, vtkIndent indent);
57 
59 
60  vtkGetMacro(Sigma,double);
61  vtkSetMacro(Sigma,double);
63 
65 
69  void SetBasis(int basis);
70  vtkGetMacro(Basis,int);
71  void SetBasisToR() { this->SetBasis(VTK_RBF_R); };
72  void SetBasisToR2LogR() { this->SetBasis(VTK_RBF_R2LOGR); };
73  const char *GetBasisAsString();
75 
76 //BTX
78 
80  void SetBasisFunction(double (*U)(double r)) {
81  if (this->BasisFunction == U) { return; }
82  this->SetBasis(VTK_RBF_CUSTOM);
83  this->BasisFunction = U;
84  this->Modified(); };
85  void SetBasisDerivative(double (*dUdr)(double r, double &dU)) {
86  this->BasisDerivative = dUdr;
87  this->Modified(); };
88 //ETX
90 
92 
95  void SetSourceLandmarks(vtkPoints *source);
96  vtkGetObjectMacro(SourceLandmarks,vtkPoints);
98 
100 
103  void SetTargetLandmarks(vtkPoints *target);
104  vtkGetObjectMacro(TargetLandmarks,vtkPoints);
106 
108  unsigned long GetMTime();
109 
112 
113 protected:
116 
118  void InternalUpdate();
119 
121  void InternalDeepCopy(vtkAbstractTransform *transform);
122 
123  void ForwardTransformPoint(const float in[3], float out[3]);
124  void ForwardTransformPoint(const double in[3], double out[3]);
125 
126  void ForwardTransformDerivative(const float in[3], float out[3],
127  float derivative[3][3]);
128  void ForwardTransformDerivative(const double in[3], double out[3],
129  double derivative[3][3]);
130 
131  double Sigma;
134 
135 //BTX
136  // the radial basis function to use
137  double (*BasisFunction)(double r);
138  double (*BasisDerivative)(double r, double& dUdr);
139 //ETX
140  int Basis;
141 
143  double **MatrixW;
144 private:
145  vtkThinPlateSplineTransform(const vtkThinPlateSplineTransform&); // Not implemented.
146  void operator=(const vtkThinPlateSplineTransform&); // Not implemented.
147 };
148 
149 #endif
150 
151 
152 
153 
154 
virtual void ForwardTransformPoint(const float in[3], float out[3])=0
void PrintSelf(ostream &os, vtkIndent indent)
unsigned long GetMTime()
boost::graph_traits< vtkGraph * >::vertex_descriptor target(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
#define VTK_RBF_R
void SetBasisDerivative(double(*dUdr)(double r, double &dU))
virtual vtkAbstractTransform * MakeTransform()=0
a nonlinear warp transformation
virtual void ForwardTransformDerivative(const float in[3], float out[3], float derivative[3][3])=0
virtual void InternalDeepCopy(vtkAbstractTransform *)
#define VTKCOMMONTRANSFORMS_EXPORT
a simple class to control print indentation
Definition: vtkIndent.h:38
superclass for all geometric transformations
#define VTK_RBF_R2LOGR
virtual void Modified()
#define VTK_RBF_CUSTOM
superclass for nonlinear geometric transformations
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
static vtkObject * New()
represent and manipulate 3D points
Definition: vtkPoints.h:38
void SetBasisFunction(double(*U)(double r))