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 =========================================================================*/
59 #ifndef vtkThinPlateSplineTransform_h
60 #define vtkThinPlateSplineTransform_h
61 
62 #include "vtkCommonTransformsModule.h" // For export macro
63 #include "vtkWarpTransform.h"
64 
65 #define VTK_RBF_CUSTOM 0
66 #define VTK_RBF_R 1
67 #define VTK_RBF_R2LOGR 2
68 
69 class VTKCOMMONTRANSFORMS_EXPORT vtkThinPlateSplineTransform : public vtkWarpTransform
70 {
71 public:
73  void PrintSelf(ostream& os, vtkIndent indent) override;
75 
77 
80  vtkGetMacro(Sigma, double);
81  vtkSetMacro(Sigma, double);
83 
85 
92  void SetBasis(int basis);
93  vtkGetMacro(Basis, int);
94  void SetBasisToR() { this->SetBasis(VTK_RBF_R); }
95  void SetBasisToR2LogR() { this->SetBasis(VTK_RBF_R2LOGR); }
96  const char* GetBasisAsString();
98 
100 
104  void SetBasisFunction(double (*U)(double r))
105  {
106  if (this->BasisFunction == U)
107  {
108  return;
109  }
110  this->SetBasis(VTK_RBF_CUSTOM);
111  this->BasisFunction = U;
112  this->Modified();
113  }
114  void SetBasisDerivative(double (*dUdr)(double r, double& dU))
115  {
116  this->BasisDerivative = dUdr;
117  this->Modified();
118  }
120 
122 
128  vtkGetObjectMacro(SourceLandmarks, vtkPoints);
130 
132 
138  vtkGetObjectMacro(TargetLandmarks, vtkPoints);
140 
144  vtkMTimeType GetMTime() override;
145 
150 
152 
168  vtkGetMacro(RegularizeBulkTransform, bool);
169  vtkSetMacro(RegularizeBulkTransform, bool);
170  vtkBooleanMacro(RegularizeBulkTransform, bool);
172 
173 protected:
176 
180  void InternalUpdate() override;
181 
185  void InternalDeepCopy(vtkAbstractTransform* transform) override;
186 
187  void ForwardTransformPoint(const float in[3], float out[3]) override;
188  void ForwardTransformPoint(const double in[3], double out[3]) override;
189 
190  void ForwardTransformDerivative(const float in[3], float out[3], float derivative[3][3]) override;
192  const double in[3], double out[3], double derivative[3][3]) override;
193 
194  double Sigma;
197 
198  // the radial basis function to use
199  double (*BasisFunction)(double r);
200  double (*BasisDerivative)(double r, double& dUdr);
201 
202  int Basis;
203 
205  double** MatrixW;
206 
208 
209 private:
211  void operator=(const vtkThinPlateSplineTransform&) = delete;
212 };
213 
214 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:143
vtkThinPlateSplineTransform::ForwardTransformPoint
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...
VTK_RBF_R2LOGR
#define VTK_RBF_R2LOGR
Definition: vtkThinPlateSplineTransform.h:67
vtkThinPlateSplineTransform::SetBasis
void SetBasis(int basis)
Specify the radial basis function to use.
VTK_RBF_R
#define VTK_RBF_R
Definition: vtkThinPlateSplineTransform.h:66
vtkThinPlateSplineTransform::Basis
int Basis
Definition: vtkThinPlateSplineTransform.h:202
vtkAbstractTransform
superclass for all geometric transformations
Definition: vtkAbstractTransform.h:52
vtkThinPlateSplineTransform::~vtkThinPlateSplineTransform
~vtkThinPlateSplineTransform() override
vtkThinPlateSplineTransform::MakeTransform
vtkAbstractTransform * MakeTransform() override
Make another transform of the same type.
vtkThinPlateSplineTransform::InternalUpdate
void InternalUpdate() override
Prepare the transformation for application.
vtkObject::Modified
virtual void Modified()
Update the modification time for this object.
vtkThinPlateSplineTransform::NumberOfPoints
int NumberOfPoints
Definition: vtkThinPlateSplineTransform.h:204
vtkThinPlateSplineTransform::SetBasisToR2LogR
void SetBasisToR2LogR()
Specify the radial basis function to use.
Definition: vtkThinPlateSplineTransform.h:95
vtkThinPlateSplineTransform
a nonlinear warp transformation
Definition: vtkThinPlateSplineTransform.h:70
vtkThinPlateSplineTransform::vtkThinPlateSplineTransform
vtkThinPlateSplineTransform()
vtkThinPlateSplineTransform::GetBasisAsString
const char * GetBasisAsString()
Specify the radial basis function to use.
vtkThinPlateSplineTransform::ForwardTransformPoint
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...
vtkThinPlateSplineTransform::New
static vtkThinPlateSplineTransform * New()
vtkThinPlateSplineTransform::SetTargetLandmarks
void SetTargetLandmarks(vtkPoints *target)
Set the target landmarks for the warp.
vtkThinPlateSplineTransform::SetBasisFunction
void SetBasisFunction(double(*U)(double r))
Set the radial basis function to a custom function.
Definition: vtkThinPlateSplineTransform.h:104
target
boost::graph_traits< vtkGraph * >::vertex_descriptor target(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
Definition: vtkBoostGraphAdapter.h:1004
VTK_RBF_CUSTOM
#define VTK_RBF_CUSTOM
Definition: vtkThinPlateSplineTransform.h:65
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkThinPlateSplineTransform::SetBasisToR
void SetBasisToR()
Specify the radial basis function to use.
Definition: vtkThinPlateSplineTransform.h:94
vtkThinPlateSplineTransform::SourceLandmarks
vtkPoints * SourceLandmarks
Definition: vtkThinPlateSplineTransform.h:195
vtkThinPlateSplineTransform::Sigma
double Sigma
Definition: vtkThinPlateSplineTransform.h:194
vtkThinPlateSplineTransform::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkThinPlateSplineTransform::TargetLandmarks
vtkPoints * TargetLandmarks
Definition: vtkThinPlateSplineTransform.h:196
vtkThinPlateSplineTransform::SetBasisDerivative
void SetBasisDerivative(double(*dUdr)(double r, double &dU))
Set the radial basis function to a custom function.
Definition: vtkThinPlateSplineTransform.h:114
vtkThinPlateSplineTransform::SetSourceLandmarks
void SetSourceLandmarks(vtkPoints *source)
Set the source landmarks for the warp.
vtkThinPlateSplineTransform::InternalDeepCopy
void InternalDeepCopy(vtkAbstractTransform *transform) override
This method does no type checking, use DeepCopy instead.
vtkThinPlateSplineTransform::MatrixW
double ** MatrixW
Definition: vtkThinPlateSplineTransform.h:205
vtkThinPlateSplineTransform::ForwardTransformDerivative
void ForwardTransformDerivative(const float in[3], float out[3], float derivative[3][3]) override
Calculate the forward transform as well as the derivative.
vtkThinPlateSplineTransform::RegularizeBulkTransform
bool RegularizeBulkTransform
Definition: vtkThinPlateSplineTransform.h:207
vtkWarpTransform.h
source
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
Definition: vtkBoostGraphAdapter.h:998
vtkThinPlateSplineTransform::ForwardTransformDerivative
void ForwardTransformDerivative(const double in[3], double out[3], double derivative[3][3]) override
Calculate the forward transform as well as the derivative.
vtkThinPlateSplineTransform::GetMTime
vtkMTimeType GetMTime() override
Get the MTime.
vtkWarpTransform
superclass for nonlinear geometric transformations
Definition: vtkWarpTransform.h:32
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287