VTK  9.1.0
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=========================================================================*/
40#ifndef vtkThinPlateSplineTransform_h
41#define vtkThinPlateSplineTransform_h
42
43#include "vtkCommonTransformsModule.h" // For export macro
44#include "vtkWarpTransform.h"
45
46#define VTK_RBF_CUSTOM 0
47#define VTK_RBF_R 1
48#define VTK_RBF_R2LOGR 2
49
50class VTKCOMMONTRANSFORMS_EXPORT vtkThinPlateSplineTransform : public vtkWarpTransform
51{
52public:
54 void PrintSelf(ostream& os, vtkIndent indent) override;
56
58
61 vtkGetMacro(Sigma, double);
62 vtkSetMacro(Sigma, double);
64
66
73 void SetBasis(int basis);
74 vtkGetMacro(Basis, int);
75 void SetBasisToR() { this->SetBasis(VTK_RBF_R); }
76 void SetBasisToR2LogR() { this->SetBasis(VTK_RBF_R2LOGR); }
77 const char* GetBasisAsString();
79
81
85 void SetBasisFunction(double (*U)(double r))
86 {
87 if (this->BasisFunction == U)
88 {
89 return;
90 }
91 this->SetBasis(VTK_RBF_CUSTOM);
92 this->BasisFunction = U;
93 this->Modified();
94 }
95 void SetBasisDerivative(double (*dUdr)(double r, double& dU))
96 {
97 this->BasisDerivative = dUdr;
98 this->Modified();
99 }
101
103
109 vtkGetObjectMacro(SourceLandmarks, vtkPoints);
111
113
119 vtkGetObjectMacro(TargetLandmarks, vtkPoints);
121
126
131
133
149 vtkGetMacro(RegularizeBulkTransform, bool);
150 vtkSetMacro(RegularizeBulkTransform, bool);
151 vtkBooleanMacro(RegularizeBulkTransform, bool);
153
154protected:
157
161 void InternalUpdate() override;
162
166 void InternalDeepCopy(vtkAbstractTransform* transform) override;
167
168 void ForwardTransformPoint(const float in[3], float out[3]) override;
169 void ForwardTransformPoint(const double in[3], double out[3]) override;
170
171 void ForwardTransformDerivative(const float in[3], float out[3], float derivative[3][3]) override;
173 const double in[3], double out[3], double derivative[3][3]) override;
174
175 double Sigma;
178
179 // the radial basis function to use
180 double (*BasisFunction)(double r);
181 double (*BasisDerivative)(double r, double& dUdr);
182
183 int Basis;
184
186 double** MatrixW;
187
189
190private:
192 void operator=(const vtkThinPlateSplineTransform&) = delete;
193};
194
195#endif
superclass for all geometric transformations
a simple class to control print indentation
Definition: vtkIndent.h:34
virtual void Modified()
Update the modification time for this object.
represent and manipulate 3D points
Definition: vtkPoints.h:34
a nonlinear warp transformation
void SetBasisToR()
Specify the radial basis function to use.
const char * GetBasisAsString()
Specify the radial basis function to use.
static vtkThinPlateSplineTransform * New()
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.
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 *)
#define VTK_RBF_R
#define VTK_RBF_CUSTOM
#define VTK_RBF_R2LOGR
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287