VTK  9.2.6
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
43#ifndef vtkThinPlateSplineTransform_h
44#define vtkThinPlateSplineTransform_h
45
46#include "vtkCommonTransformsModule.h" // For export macro
47#include "vtkWarpTransform.h"
48
49#define VTK_RBF_CUSTOM 0
50#define VTK_RBF_R 1
51#define VTK_RBF_R2LOGR 2
52
53class VTKCOMMONTRANSFORMS_EXPORT vtkThinPlateSplineTransform : public vtkWarpTransform
54{
55public:
57 void PrintSelf(ostream& os, vtkIndent indent) override;
59
61
64 vtkGetMacro(Sigma, double);
65 vtkSetMacro(Sigma, double);
67
69
76 void SetBasis(int basis);
77 vtkGetMacro(Basis, int);
78 void SetBasisToR() { this->SetBasis(VTK_RBF_R); }
80 const char* GetBasisAsString();
82
84
88 void SetBasisFunction(double (*U)(double r))
89 {
90 if (this->BasisFunction == U)
91 {
92 return;
93 }
95 this->BasisFunction = U;
96 this->Modified();
97 }
98 void SetBasisDerivative(double (*dUdr)(double r, double& dU))
99 {
100 this->BasisDerivative = dUdr;
101 this->Modified();
102 }
103
104
106
112 vtkGetObjectMacro(SourceLandmarks, vtkPoints);
114
116
122 vtkGetObjectMacro(TargetLandmarks, vtkPoints);
124
129
134
136
152 vtkGetMacro(RegularizeBulkTransform, bool);
153 vtkSetMacro(RegularizeBulkTransform, bool);
154 vtkBooleanMacro(RegularizeBulkTransform, bool);
156
157protected:
160
164 void InternalUpdate() override;
165
169 void InternalDeepCopy(vtkAbstractTransform* transform) override;
170
171 void ForwardTransformPoint(const float in[3], float out[3]) override;
172 void ForwardTransformPoint(const double in[3], double out[3]) override;
173
174 void ForwardTransformDerivative(const float in[3], float out[3], float derivative[3][3]) override;
176 const double in[3], double out[3], double derivative[3][3]) override;
177
178 double Sigma;
181
182 // the radial basis function to use
183 double (*BasisFunction)(double r);
184 double (*BasisDerivative)(double r, double& dUdr);
185
186 int Basis;
187
189 double** MatrixW;
190
192
193private:
195 void operator=(const vtkThinPlateSplineTransform&) = delete;
196};
197
198#endif
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
void SetBasisToR()
Specify the radial basis function to use.
const char * GetBasisAsString()
Specify the radial basis function to use.
static vtkThinPlateSplineTransform * New()
double(* BasisDerivative)(double r, double &dUdr)
void InternalUpdate() override
Prepare the transformation for application.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void ForwardTransformDerivative(const double in[3], double out[3], double derivative[3][3]) override
Calculate the forward transform as well as the derivative.
void ForwardTransformDerivative(const float in[3], float out[3], float derivative[3][3]) override
Calculate the forward transform as well as the derivative.
void SetBasisFunction(double(*U)(double r))
Set the radial basis function to a custom function.
void SetBasisToR2LogR()
Specify the radial basis function to use.
void SetSourceLandmarks(vtkPoints *source)
Set the source landmarks for the warp.
void ForwardTransformPoint(const double in[3], double out[3]) override
If the InverseFlag is set to 0, then a call to InternalTransformPoint results in a call to ForwardTra...
vtkMTimeType GetMTime() override
Get the MTime.
vtkAbstractTransform * MakeTransform() override
Make another transform of the same type.
void SetBasisDerivative(double(*dUdr)(double r, double &dU))
Set the radial basis function to a custom function.
~vtkThinPlateSplineTransform() override
void InternalDeepCopy(vtkAbstractTransform *transform) override
This method does no type checking, use DeepCopy instead.
void SetBasis(int basis)
Specify the radial basis function to use.
void ForwardTransformPoint(const float in[3], float out[3]) override
If the InverseFlag is set to 0, then a call to InternalTransformPoint results in a call to ForwardTra...
void SetTargetLandmarks(vtkPoints *target)
Set the target landmarks for the warp.
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 *)
#define VTK_RBF_R
#define VTK_RBF_CUSTOM
#define VTK_RBF_R2LOGR
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:287