VTK  9.3.0
vtkThinPlateSplineTransform.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
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 
50 VTK_ABI_NAMESPACE_BEGIN
51 class VTKCOMMONTRANSFORMS_EXPORT vtkThinPlateSplineTransform : public vtkWarpTransform
52 {
53 public:
55  void PrintSelf(ostream& os, vtkIndent indent) override;
57 
59 
62  vtkGetMacro(Sigma, double);
63  vtkSetMacro(Sigma, double);
65 
67 
74  void SetBasis(int basis);
75  vtkGetMacro(Basis, int);
76  void SetBasisToR() { this->SetBasis(VTK_RBF_R); }
77  void SetBasisToR2LogR() { this->SetBasis(VTK_RBF_R2LOGR); }
78  const char* GetBasisAsString();
80 
82 
86  void SetBasisFunction(double (*U)(double r))
87  {
88  if (this->BasisFunction == U)
89  {
90  return;
91  }
92  this->SetBasis(VTK_RBF_CUSTOM);
93  this->BasisFunction = U;
94  this->Modified();
95  }
96  void SetBasisDerivative(double (*dUdr)(double r, double& dU))
97  {
98  this->BasisDerivative = dUdr;
99  this->Modified();
100  }
102 
104 
110  vtkGetObjectMacro(SourceLandmarks, vtkPoints);
112 
114 
120  vtkGetObjectMacro(TargetLandmarks, vtkPoints);
122 
126  vtkMTimeType GetMTime() override;
127 
132 
134 
150  vtkGetMacro(RegularizeBulkTransform, bool);
151  vtkSetMacro(RegularizeBulkTransform, bool);
152  vtkBooleanMacro(RegularizeBulkTransform, bool);
154 
155 protected:
158 
162  void InternalUpdate() override;
163 
167  void InternalDeepCopy(vtkAbstractTransform* transform) override;
168 
169  void ForwardTransformPoint(const float in[3], float out[3]) override;
170  void ForwardTransformPoint(const double in[3], double out[3]) override;
171 
172  void ForwardTransformDerivative(const float in[3], float out[3], float derivative[3][3]) override;
174  const double in[3], double out[3], double derivative[3][3]) override;
175 
176  double Sigma;
179 
180  // the radial basis function to use
181  double (*BasisFunction)(double r);
182  double (*BasisDerivative)(double r, double& dUdr);
183 
184  int Basis;
185 
187  double** MatrixW;
188 
190 
191 private:
193  void operator=(const vtkThinPlateSplineTransform&) = delete;
194 };
195 
196 VTK_ABI_NAMESPACE_END
197 #endif
superclass for all geometric transformations
a simple class to control print indentation
Definition: vtkIndent.h:38
virtual void Modified()
Update the modification time for this object.
represent and manipulate 3D points
Definition: vtkPoints.h:38
a nonlinear warp transformation
vtkAbstractTransform * MakeTransform() override
Make another transform of the same type.
void SetBasisToR()
Specify the radial basis function to use.
const char * GetBasisAsString()
Specify the radial basis function to use.
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.
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...
static vtkThinPlateSplineTransform * New()
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:270