VTK  9.2.5
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 =========================================================================*/
62 #ifndef vtkThinPlateSplineTransform_h
63 #define vtkThinPlateSplineTransform_h
64 
65 #include "vtkCommonTransformsModule.h" // For export macro
66 #include "vtkWarpTransform.h"
67 
68 #define VTK_RBF_CUSTOM 0
69 #define VTK_RBF_R 1
70 #define VTK_RBF_R2LOGR 2
71 
72 class VTKCOMMONTRANSFORMS_EXPORT vtkThinPlateSplineTransform : public vtkWarpTransform
73 {
74 public:
76  void PrintSelf(ostream& os, vtkIndent indent) override;
78 
80 
83  vtkGetMacro(Sigma, double);
84  vtkSetMacro(Sigma, double);
86 
88 
95  void SetBasis(int basis);
96  vtkGetMacro(Basis, int);
97  void SetBasisToR() { this->SetBasis(VTK_RBF_R); }
98  void SetBasisToR2LogR() { this->SetBasis(VTK_RBF_R2LOGR); }
99  const char* GetBasisAsString();
101 
103 
107  void SetBasisFunction(double (*U)(double r))
108  {
109  if (this->BasisFunction == U)
110  {
111  return;
112  }
113  this->SetBasis(VTK_RBF_CUSTOM);
114  this->BasisFunction = U;
115  this->Modified();
116  }
117  void SetBasisDerivative(double (*dUdr)(double r, double& dU))
118  {
119  this->BasisDerivative = dUdr;
120  this->Modified();
121  }
123 
125 
131  vtkGetObjectMacro(SourceLandmarks, vtkPoints);
133 
135 
141  vtkGetObjectMacro(TargetLandmarks, vtkPoints);
143 
147  vtkMTimeType GetMTime() override;
148 
153 
155 
171  vtkGetMacro(RegularizeBulkTransform, bool);
172  vtkSetMacro(RegularizeBulkTransform, bool);
173  vtkBooleanMacro(RegularizeBulkTransform, bool);
175 
176 protected:
179 
183  void InternalUpdate() override;
184 
188  void InternalDeepCopy(vtkAbstractTransform* transform) override;
189 
190  void ForwardTransformPoint(const float in[3], float out[3]) override;
191  void ForwardTransformPoint(const double in[3], double out[3]) override;
192 
193  void ForwardTransformDerivative(const float in[3], float out[3], float derivative[3][3]) override;
195  const double in[3], double out[3], double derivative[3][3]) override;
196 
197  double Sigma;
200 
201  // the radial basis function to use
202  double (*BasisFunction)(double r);
203  double (*BasisDerivative)(double r, double& dUdr);
204 
205  int Basis;
206 
208  double** MatrixW;
209 
211 
212 private:
214  void operator=(const vtkThinPlateSplineTransform&) = delete;
215 };
216 
217 #endif
superclass for all geometric transformations
a simple class to control print indentation
Definition: vtkIndent.h:119
virtual void Modified()
Update the modification time for this object.
represent and manipulate 3D points
Definition: vtkPoints.h:149
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:287