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=========================================================================*/
49#ifndef vtkThinPlateSplineTransform_h
50#define vtkThinPlateSplineTransform_h
51
52#include "vtkCommonTransformsModule.h" // For export macro
53#include "vtkWarpTransform.h"
54
55#define VTK_RBF_CUSTOM 0
56#define VTK_RBF_R 1
57#define VTK_RBF_R2LOGR 2
58
59class VTKCOMMONTRANSFORMS_EXPORT vtkThinPlateSplineTransform : public vtkWarpTransform
60{
61public:
63 void PrintSelf(ostream& os, vtkIndent indent) override;
65
67
70 vtkGetMacro(Sigma, double);
71 vtkSetMacro(Sigma, double);
73
75
82 void SetBasis(int basis);
83 vtkGetMacro(Basis, int);
84 void SetBasisToR() { this->SetBasis(VTK_RBF_R); }
85 void SetBasisToR2LogR() { this->SetBasis(VTK_RBF_R2LOGR); }
86 const char* GetBasisAsString();
88
90
94 void SetBasisFunction(double (*U)(double r))
95 {
96 if (this->BasisFunction == U)
97 {
98 return;
99 }
100 this->SetBasis(VTK_RBF_CUSTOM);
101 this->BasisFunction = U;
102 this->Modified();
103 }
104 void SetBasisDerivative(double (*dUdr)(double r, double& dU))
105 {
106 this->BasisDerivative = dUdr;
107 this->Modified();
108 }
110
112
118 vtkGetObjectMacro(SourceLandmarks, vtkPoints);
120
122
128 vtkGetObjectMacro(TargetLandmarks, vtkPoints);
130
135
140
142
158 vtkGetMacro(RegularizeBulkTransform, bool);
159 vtkSetMacro(RegularizeBulkTransform, bool);
160 vtkBooleanMacro(RegularizeBulkTransform, bool);
162
163protected:
166
170 void InternalUpdate() override;
171
175 void InternalDeepCopy(vtkAbstractTransform* transform) override;
176
177 void ForwardTransformPoint(const float in[3], float out[3]) override;
178 void ForwardTransformPoint(const double in[3], double out[3]) override;
179
180 void ForwardTransformDerivative(const float in[3], float out[3], float derivative[3][3]) override;
182 const double in[3], double out[3], double derivative[3][3]) override;
183
184 double Sigma;
187
188 // the radial basis function to use
189 double (*BasisFunction)(double r);
190 double (*BasisDerivative)(double r, double& dUdr);
191
192 int Basis;
193
195 double** MatrixW;
196
198
199private:
201 void operator=(const vtkThinPlateSplineTransform&) = delete;
202};
203
204#endif
superclass for all geometric transformations
a simple class to control print indentation
Definition: vtkIndent.h:43
virtual void Modified()
Update the modification time for this object.
represent and manipulate 3D points
Definition: vtkPoints.h:43
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