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
52class VTKCOMMONTRANSFORMS_EXPORT vtkThinPlateSplineTransform : public vtkWarpTransform
53{
54public:
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
104 vtkGetObjectMacro(SourceLandmarks,vtkPoints);
106
108
114 vtkGetObjectMacro(TargetLandmarks,vtkPoints);
116
120 vtkMTimeType GetMTime() VTK_OVERRIDE;
121
125 vtkAbstractTransform *MakeTransform() VTK_OVERRIDE;
126
127protected:
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;
161private:
163 void operator=(const vtkThinPlateSplineTransform&) VTK_DELETE_FUNCTION;
164};
165
166#endif
167
168
169
170
171
superclass for all geometric transformations
a simple class to control print indentation
Definition: vtkIndent.h:40
virtual void Modified()
Update the modification time for this object.
represent and manipulate 3D points
Definition: vtkPoints.h:40
a nonlinear warp transformation
const char * GetBasisAsString()
static vtkThinPlateSplineTransform * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetBasisFunction(double(*U)(double r))
Set the radial basis function to a custom function.
void SetSourceLandmarks(vtkPoints *source)
Set the source landmarks for the warp.
vtkMTimeType GetMTime() override
Get the MTime.
void SetBasisDerivative(double(*dUdr)(double r, double &dU))
void SetBasis(int basis)
Specify the radial basis function to use.
void SetTargetLandmarks(vtkPoints *target)
Set the target landmarks for the warp.
superclass for nonlinear geometric transformations
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
boost::graph_traits< vtkGraph * >::vertex_descriptor target(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
#define VTK_RBF_R
#define VTK_RBF_CUSTOM
#define VTK_RBF_R2LOGR
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248