| 1 |
|
/*========================================================================= |
| 2 |
|
|
| 3 |
|
Program: Insight Segmentation & Registration Toolkit |
| 4 |
|
Module: $RCSfile: itkVolumeSplineKernelTransform.h.html,v $ |
| 5 |
|
Language: C++ |
| 6 |
|
Date: $Date: 2006/01/17 19:15:49 $ |
| 7 |
|
Version: $Revision: 1.4 $ |
| 8 |
|
|
| 9 |
|
Copyright (c) Insight Software Consortium. All rights reserved. |
| 10 |
|
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. |
| 11 |
|
|
| 12 |
|
This software is distributed WITHOUT ANY WARRANTY; without even |
| 13 |
|
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
| 14 |
|
PURPOSE. See the above copyright notices for more information. |
| 15 |
|
|
| 16 |
|
=========================================================================*/ |
| 17 |
|
#ifndef __itkVolumeSplineKernelTransform_h |
| 18 |
|
#define __itkVolumeSplineKernelTransform_h |
| 19 |
|
|
| 20 |
|
#include "itkKernelTransform.h" |
| 21 |
|
|
| 22 |
|
namespace itk |
| 23 |
|
{ |
| 24 |
|
/** \class VolumeSplineKernelTransform |
| 25 |
|
* This class defines the thin plate spline (TPS) transformation. |
| 26 |
|
* It is implemented in as straightforward a manner as possible from |
| 27 |
|
* the IEEE TMI paper by Davis, Khotanzad, Flamig, and Harms, |
| 28 |
|
* Vol. 16 No. 3 June 1997 |
| 29 |
|
* |
| 30 |
|
* \ingroup Transforms |
| 31 |
|
*/ |
| 32 |
|
template <class TScalarType, // Data type for scalars (float or double) |
| 33 |
|
unsigned int NDimensions = 3> // Number of dimensions |
| 34 |
|
class ITK_EXPORT VolumeSplineKernelTransform : |
| 35 |
IND |
****************public KernelTransform< TScalarType, NDimensions> |
| 36 |
|
{ |
| 37 |
|
public: |
| 38 |
|
/** Standard class typedefs. */ |
| 39 |
|
typedef VolumeSplineKernelTransform Self; |
| 40 |
TDA |
typedef KernelTransform< TScalarType, NDimensions> Superclass; |
| 41 |
TDA |
typedef SmartPointer<Self> Pointer; |
| 42 |
TDA |
typedef SmartPointer<const Self> ConstPointer; |
| 43 |
|
|
| 44 |
|
/** New macro for creation of through a Smart Pointer */ |
| 45 |
|
itkNewMacro( Self ); |
| 46 |
|
|
| 47 |
|
/** Run-time type information (and related methods). */ |
| 48 |
|
itkTypeMacro( VolumeSplineKernelTransform, KernelTransform ); |
| 49 |
|
|
| 50 |
|
/** Scalar type. */ |
| 51 |
|
typedef typename Superclass::ScalarType ScalarType; |
| 52 |
|
|
| 53 |
|
/** Parameters type. */ |
| 54 |
|
typedef typename Superclass::ParametersType ParametersType; |
| 55 |
|
|
| 56 |
|
/** Jacobian Type */ |
| 57 |
|
typedef typename Superclass::JacobianType JacobianType; |
| 58 |
|
|
| 59 |
|
/** Dimension of the domain space. */ |
| 60 |
|
itkStaticConstMacro(SpaceDimension, unsigned int,Superclass::SpaceDimension); |
| 61 |
|
|
| 62 |
|
/** These (rather redundant) typedefs are needed because on SGI, typedefs |
| 63 |
|
* are not inherited */ |
| 64 |
|
typedef typename Superclass::InputPointType InputPointType; |
| 65 |
TDA |
typedef typename Superclass::OutputPointType OutputPointType; |
| 66 |
|
typedef typename Superclass::InputVectorType InputVectorType; |
| 67 |
TDA |
typedef typename Superclass::OutputVectorType OutputVectorType; |
| 68 |
LEN,TDA |
typedef typename Superclass::InputCovariantVectorType InputCovariantVectorType; |
| 69 |
LEN,TDA |
typedef typename Superclass::OutputCovariantVectorType OutputCovariantVectorType; |
| 70 |
TDA |
typedef typename Superclass::PointsIterator PointsIterator; |
| 71 |
|
|
| 72 |
|
|
| 73 |
|
protected: |
| 74 |
|
VolumeSplineKernelTransform() {}; |
| 75 |
|
virtual ~VolumeSplineKernelTransform() {} |
| 76 |
|
|
| 77 |
|
/** These (rather redundant) typedefs are needed because on SGI, typedefs |
| 78 |
|
* are not inherited. */ |
| 79 |
|
typedef typename Superclass::GMatrixType GMatrixType; |
| 80 |
|
|
| 81 |
|
/** Compute G(x) |
| 82 |
|
* For the volume plate spline, this is: |
| 83 |
|
* G(x) = r(x)^3*I |
| 84 |
|
* \f$ G(x) = r(x)^3*I \f$ |
| 85 |
|
* where |
| 86 |
|
* r(x) = Euclidean norm = sqrt[x1^2 + x2^2 + x3^2] |
| 87 |
|
* \f[ r(x) = \sqrt{ x_1^2 + x_2^2 + x_3^2 } \f] |
| 88 |
|
* I = identity matrix. */ |
| 89 |
|
const GMatrixType & ComputeG(const InputVectorType & x) const; |
| 90 |
|
|
| 91 |
|
|
| 92 |
|
/** Compute the contribution of the landmarks weighted by the kernel funcion |
| 93 |
IND |
******to the global deformation of the space */ |
| 94 |
LEN |
virtual void ComputeDeformationContribution( const InputPointType & inputPoint, |
| 95 |
LEN |
OutputPointType & result ) const; |
| 96 |
|
|
| 97 |
IND |
*private: |
| 98 |
|
VolumeSplineKernelTransform(const Self&); //purposely not implemented |
| 99 |
|
void operator=(const Self&); //purposely not implemented |
| 100 |
|
|
| 101 |
|
}; |
| 102 |
|
|
| 103 |
|
} // namespace itk |
| 104 |
|
|
| 105 |
|
#ifndef ITK_MANUAL_INSTANTIATION |
| 106 |
|
#include "itkVolumeSplineKernelTransform.txx" |
| 107 |
|
#endif |
| 108 |
|
|
| 109 |
|
#endif // __itkVolumeSplineKernelTransform_h |
| 110 |
|
|