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 =========================================================================*/
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 
53 class VTKCOMMONTRANSFORMS_EXPORT vtkThinPlateSplineTransform : public vtkWarpTransform
54 {
55 public:
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); }
79  void SetBasisToR2LogR() { this->SetBasis(VTK_RBF_R2LOGR); }
80  const char* GetBasisAsString();
82 
84 
88  void SetBasisFunction(double (*U)(double r))
89  {
90  if (this->BasisFunction == U)
91  {
92  return;
93  }
94  this->SetBasis(VTK_RBF_CUSTOM);
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  }
104 
106 
111  void SetSourceLandmarks(vtkPoints* source);
112  vtkGetObjectMacro(SourceLandmarks, vtkPoints);
114 
116 
121  void SetTargetLandmarks(vtkPoints* target);
122  vtkGetObjectMacro(TargetLandmarks, vtkPoints);
124 
128  vtkMTimeType GetMTime() override;
129 
134 
136 
152  vtkGetMacro(RegularizeBulkTransform, bool);
153  vtkSetMacro(RegularizeBulkTransform, bool);
154  vtkBooleanMacro(RegularizeBulkTransform, bool);
156 
157 protected:
159  ~vtkThinPlateSplineTransform() override;
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 
193 private:
195  void operator=(const vtkThinPlateSplineTransform&) = delete;
196 };
197 
198 #endif
virtual void ForwardTransformPoint(const float in[3], float out[3])=0
If the InverseFlag is set to 0, then a call to InternalTransformPoint results in a call to ForwardTra...
vtkMTimeType GetMTime() override
Override GetMTime necessary because of inverse transforms.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287
#define VTK_RBF_R
void SetBasisDerivative(double(*dUdr)(double r, double &dU))
Set the radial basis function to a custom function.
virtual void InternalUpdate()
Perform any subclass-specific Update.
virtual vtkAbstractTransform * MakeTransform()=0
Make another transform of the same type.
a nonlinear warp transformation
virtual void ForwardTransformDerivative(const float in[3], float out[3], float derivative[3][3])=0
Calculate the forward transform as well as the derivative.
virtual void InternalDeepCopy(vtkAbstractTransform *)
Perform any subclass-specific DeepCopy.
a simple class to control print indentation
Definition: vtkIndent.h:39
boost::graph_traits< vtkGraph * >::vertex_descriptor target(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
void SetBasisToR2LogR()
Specify the radial basis function to use.
superclass for all geometric transformations
#define VTK_RBF_R2LOGR
virtual void Modified()
Update the modification time for this object.
#define VTK_RBF_CUSTOM
superclass for nonlinear geometric transformations
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetBasisToR()
Specify the radial basis function to use.
represent and manipulate 3D points
Definition: vtkPoints.h:39
void SetBasisFunction(double(*U)(double r))
Set the radial basis function to a custom function.