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 =========================================================================*/
52 #ifndef vtkThinPlateSplineTransform_h
53 #define vtkThinPlateSplineTransform_h
54 
55 #include "vtkCommonTransformsModule.h" // For export macro
56 #include "vtkWarpTransform.h"
57 
58 #define VTK_RBF_CUSTOM 0
59 #define VTK_RBF_R 1
60 #define VTK_RBF_R2LOGR 2
61 
62 class VTKCOMMONTRANSFORMS_EXPORT vtkThinPlateSplineTransform : public vtkWarpTransform
63 {
64 public:
66  void PrintSelf(ostream& os, vtkIndent indent) override;
68 
70 
73  vtkGetMacro(Sigma, double);
74  vtkSetMacro(Sigma, double);
76 
78 
85  void SetBasis(int basis);
86  vtkGetMacro(Basis, int);
87  void SetBasisToR() { this->SetBasis(VTK_RBF_R); }
88  void SetBasisToR2LogR() { this->SetBasis(VTK_RBF_R2LOGR); }
89  const char* GetBasisAsString();
91 
93 
97  void SetBasisFunction(double (*U)(double r))
98  {
99  if (this->BasisFunction == U)
100  {
101  return;
102  }
103  this->SetBasis(VTK_RBF_CUSTOM);
104  this->BasisFunction = U;
105  this->Modified();
106  }
107  void SetBasisDerivative(double (*dUdr)(double r, double& dU))
108  {
109  this->BasisDerivative = dUdr;
110  this->Modified();
111  }
113 
115 
121  vtkGetObjectMacro(SourceLandmarks, vtkPoints);
123 
125 
131  vtkGetObjectMacro(TargetLandmarks, vtkPoints);
133 
137  vtkMTimeType GetMTime() override;
138 
143 
145 
161  vtkGetMacro(RegularizeBulkTransform, bool);
162  vtkSetMacro(RegularizeBulkTransform, bool);
163  vtkBooleanMacro(RegularizeBulkTransform, bool);
165 
166 protected:
169 
173  void InternalUpdate() override;
174 
178  void InternalDeepCopy(vtkAbstractTransform* transform) override;
179 
180  void ForwardTransformPoint(const float in[3], float out[3]) override;
181  void ForwardTransformPoint(const double in[3], double out[3]) override;
182 
183  void ForwardTransformDerivative(const float in[3], float out[3], float derivative[3][3]) override;
185  const double in[3], double out[3], double derivative[3][3]) override;
186 
187  double Sigma;
190 
191  // the radial basis function to use
192  double (*BasisFunction)(double r);
193  double (*BasisDerivative)(double r, double& dUdr);
194 
195  int Basis;
196 
198  double** MatrixW;
199 
201 
202 private:
204  void operator=(const vtkThinPlateSplineTransform&) = delete;
205 };
206 
207 #endif
superclass for all geometric transformations
a simple class to control print indentation
Definition: vtkIndent.h:49
virtual void Modified()
Update the modification time for this object.
represent and manipulate 3D points
Definition: vtkPoints.h:49
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