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 =========================================================================*/
42 #ifndef vtkThinPlateSplineTransform_h
43 #define vtkThinPlateSplineTransform_h
44 
45 #include "vtkCommonTransformsModule.h" // For export macro
46 #include "vtkWarpTransform.h"
47 
48 #define VTK_RBF_CUSTOM 0
49 #define VTK_RBF_R 1
50 #define VTK_RBF_R2LOGR 2
51 
52 class VTKCOMMONTRANSFORMS_EXPORT vtkThinPlateSplineTransform : public vtkWarpTransform
53 {
54 public:
56  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
58 
60 
63  vtkGetMacro(Sigma,double);
64  vtkSetMacro(Sigma,double);
66 
68 
75  void SetBasis(int basis);
76  vtkGetMacro(Basis,int);
77  void SetBasisToR() { this->SetBasis(VTK_RBF_R); };
78  void SetBasisToR2LogR() { this->SetBasis(VTK_RBF_R2LOGR); };
79  const char *GetBasisAsString();
81 
83 
87  void SetBasisFunction(double (*U)(double r)) {
88  if (this->BasisFunction == U) { return; }
89  this->SetBasis(VTK_RBF_CUSTOM);
90  this->BasisFunction = U;
91  this->Modified(); };
92  void SetBasisDerivative(double (*dUdr)(double r, double &dU)) {
93  this->BasisDerivative = dUdr;
94  this->Modified(); };
96 
98 
103  void SetSourceLandmarks(vtkPoints *source);
104  vtkGetObjectMacro(SourceLandmarks,vtkPoints);
106 
108 
113  void SetTargetLandmarks(vtkPoints *target);
114  vtkGetObjectMacro(TargetLandmarks,vtkPoints);
116 
120  vtkMTimeType GetMTime() VTK_OVERRIDE;
121 
125  vtkAbstractTransform *MakeTransform() VTK_OVERRIDE;
126 
127 protected:
129  ~vtkThinPlateSplineTransform() VTK_OVERRIDE;
130 
134  void InternalUpdate() VTK_OVERRIDE;
135 
139  void InternalDeepCopy(vtkAbstractTransform *transform) VTK_OVERRIDE;
140 
141  void ForwardTransformPoint(const float in[3], float out[3]) VTK_OVERRIDE;
142  void ForwardTransformPoint(const double in[3], double out[3]) VTK_OVERRIDE;
143 
144  void ForwardTransformDerivative(const float in[3], float out[3],
145  float derivative[3][3]) VTK_OVERRIDE;
146  void ForwardTransformDerivative(const double in[3], double out[3],
147  double derivative[3][3]) VTK_OVERRIDE;
148 
149  double Sigma;
150  vtkPoints *SourceLandmarks;
151  vtkPoints *TargetLandmarks;
152 
153  // the radial basis function to use
154  double (*BasisFunction)(double r);
155  double (*BasisDerivative)(double r, double& dUdr);
156 
157  int Basis;
158 
159  int NumberOfPoints;
160  double **MatrixW;
161 private:
162  vtkThinPlateSplineTransform(const vtkThinPlateSplineTransform&) VTK_DELETE_FUNCTION;
163  void operator=(const vtkThinPlateSplineTransform&) VTK_DELETE_FUNCTION;
164 };
165 
166 #endif
167 
168 
169 
170 
171 
boost::graph_traits< vtkGraph * >::vertex_descriptor target(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
vtkMTimeType GetMTime() override
Override GetMTime necessary because of inverse transforms.
#define VTK_RBF_R
void SetBasisDerivative(double(*dUdr)(double r, double &dU))
Set the radial basis function to a custom function.
a nonlinear warp transformation
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248
a simple class to control print indentation
Definition: vtkIndent.h:39
void SetBasisToR2LogR()
Specify the radial basis function to use.
superclass for all geometric transformations
#define VTK_RBF_R2LOGR
virtual void Modified()
Update the modification time for this object.
#define VTK_RBF_CUSTOM
superclass for nonlinear geometric transformations
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetBasisToR()
Specify the radial basis function to use.
represent and manipulate 3D points
Definition: vtkPoints.h:39
void SetBasisFunction(double(*U)(double r))
Set the radial basis function to a custom function.