ITK
6.0.0
Insight Toolkit
|
#include <itkKernelTransform.h>
Intended to be a base class for elastic body spline and thin plate spline. This is implemented in as straightforward a manner as possible from the IEEE TMI paper by Davis, Khotanzad, Flamig, and Harms, Vol. 16, No. 3 June 1997. Notation closely follows their paper, so if you have it in front of you, this code will make a lot more sense.
KernelTransform: Provides support for defining source and target landmarks Defines a number of data types used in the computations Defines the mathematical framework used to compute all splines, so that subclasses need only provide a kernel specific to that spline
This formulation allows the stiffness of the spline to be adjusted, allowing the spline to vary from interpolating the landmarks to approximating the landmarks. This part of the formulation is based on the short paper by R. Sprengel, K. Rohr, H. Stiehl. "Thin-Plate Spline Approximation for Image Registration". In 18th International Conference of the IEEE Engineering in Medicine and Biology Society. 1996.
Definition at line 61 of file itkKernelTransform.h.
Public Types | |
using | AMatrixType = vnl_matrix_fixed< TParametersValueType, VDimension, VDimension > |
using | BMatrixType = vnl_vector_fixed< TParametersValueType, VDimension > |
using | ColumnMatrixType = vnl_matrix_fixed< TParametersValueType, VDimension, 1 > |
using | ConstPointer = SmartPointer< const Self > |
using | DMatrixType = vnl_matrix< TParametersValueType > |
using | GMatrixType = vnl_matrix_fixed< TParametersValueType, VDimension, VDimension > |
using | IMatrixType = vnl_matrix_fixed< TParametersValueType, VDimension, VDimension > |
using | KMatrixType = vnl_matrix< TParametersValueType > |
using | LMatrixType = vnl_matrix< TParametersValueType > |
using | PMatrixType = vnl_matrix< TParametersValueType > |
using | Pointer = SmartPointer< Self > |
using | PointIdentifier = typename PointSetType::PointIdentifier |
using | PointsConstIterator = typename PointSetType::PointsContainerConstIterator |
using | PointsContainer = typename PointSetType::PointsContainer |
using | PointSetPointer = typename PointSetType::Pointer |
using | PointSetTraitsType = DefaultStaticMeshTraits< TParametersValueType, VDimension, VDimension, TParametersValueType, TParametersValueType > |
using | PointSetType = PointSet< InputPointType, VDimension, PointSetTraitsType > |
using | PointsIterator = typename PointSetType::PointsContainerIterator |
using | RowMatrixType = vnl_matrix_fixed< TParametersValueType, 1, VDimension > |
using | Self = KernelTransform |
using | Superclass = Transform< TParametersValueType, VDimension, VDimension > |
using | VectorSetPointer = typename VectorSetType::Pointer |
using | VectorSetType = itk::VectorContainer< InputVectorType > |
using | WMatrixType = vnl_matrix< TParametersValueType > |
using | YMatrixType = vnl_matrix< TParametersValueType > |
Public Types inherited from itk::Transform< TParametersValueType, VDimension, VDimension > | |
using | ConstPointer = SmartPointer< const Self > |
using | DerivativeType = Array< ParametersValueType > |
using | DirectionChangeMatrix = Matrix< double, Self::OutputSpaceDimension, Self::InputSpaceDimension > |
using | InputCovariantVectorType = CovariantVector< TParametersValueType, VInputDimension > |
using | InputDiffusionTensor3DType = DiffusionTensor3D< TParametersValueType > |
using | InputDirectionMatrix = Matrix< double, Self::InputSpaceDimension, Self::InputSpaceDimension > |
using | InputPointType = Point< TParametersValueType, VInputDimension > |
using | InputSymmetricSecondRankTensorType = SymmetricSecondRankTensor< TParametersValueType, VInputDimension > |
using | InputVectorPixelType = VariableLengthVector< TParametersValueType > |
using | InputVectorType = Vector< TParametersValueType, VInputDimension > |
using | InputVnlVectorType = vnl_vector_fixed< TParametersValueType, VInputDimension > |
using | InverseJacobianPositionType = vnl_matrix_fixed< ParametersValueType, VInputDimension, VOutputDimension > |
using | InverseTransformBasePointer = typename InverseTransformBaseType::Pointer |
using | InverseTransformBaseType = Transform< TParametersValueType, VOutputDimension, VInputDimension > |
using | JacobianPositionType = vnl_matrix_fixed< ParametersValueType, VOutputDimension, VInputDimension > |
using | JacobianType = Array2D< ParametersValueType > |
using | MatrixType = Matrix< TParametersValueType, Self::OutputSpaceDimension, Self::InputSpaceDimension > |
using | OutputCovariantVectorType = CovariantVector< TParametersValueType, VOutputDimension > |
using | OutputDiffusionTensor3DType = DiffusionTensor3D< TParametersValueType > |
using | OutputDirectionMatrix = Matrix< double, Self::OutputSpaceDimension, Self::OutputSpaceDimension > |
using | OutputPointType = Point< TParametersValueType, VOutputDimension > |
using | OutputSymmetricSecondRankTensorType = SymmetricSecondRankTensor< TParametersValueType, VOutputDimension > |
using | OutputVectorPixelType = VariableLengthVector< TParametersValueType > |
using | OutputVectorType = Vector< TParametersValueType, VOutputDimension > |
using | OutputVnlVectorType = vnl_vector_fixed< TParametersValueType, VOutputDimension > |
using | Pointer = SmartPointer< Self > |
using | ScalarType = ParametersValueType |
using | Self = Transform |
using | Superclass = TransformBaseTemplate< TParametersValueType > |
Static Public Member Functions | |
static Pointer | New () |
Static Public Attributes | |
static constexpr unsigned int | SpaceDimension = VDimension |
Static Public Attributes inherited from itk::Transform< TParametersValueType, VDimension, VDimension > | |
static constexpr unsigned int | InputSpaceDimension |
static constexpr unsigned int | OutputSpaceDimension |
Protected Member Functions | |
void | ComputeD () |
virtual void | ComputeDeformationContribution (const InputPointType &thisPoint, OutputPointType &result) const |
virtual void | ComputeG (const InputVectorType &landmarkVector, GMatrixType &gmatrix) const |
void | ComputeK () |
void | ComputeL () |
void | ComputeP () |
virtual const GMatrixType & | ComputeReflexiveG (PointsIterator) const |
void | ComputeY () |
KernelTransform () | |
void | PrintSelf (std::ostream &os, Indent indent) const override |
void | ReorganizeW () |
~KernelTransform () override=default | |
Protected Member Functions inherited from itk::Transform< TParametersValueType, VDimension, VDimension > | |
LightObject::Pointer | InternalClone () const override |
OutputDiffusionTensor3DType | PreservationOfPrincipalDirectionDiffusionTensor3DReorientation (const InputDiffusionTensor3DType &, const InverseJacobianPositionType &) const |
Transform ()=default | |
Transform (NumberOfParametersType numberOfParameters) | |
~Transform () override=default | |
Protected Attributes | |
AMatrixType | m_AMatrix {} |
BMatrixType | m_BVector {} |
VectorSetPointer | m_Displacements {} |
DMatrixType | m_DMatrix {} |
GMatrixType | m_GMatrix {} |
IMatrixType | m_I {} |
KMatrixType | m_KMatrix {} |
LMatrixType | m_LMatrix {} |
PMatrixType | m_PMatrix {} |
PointSetPointer | m_SourceLandmarks {} |
double | m_Stiffness {} |
PointSetPointer | m_TargetLandmarks {} |
WMatrixType | m_WMatrix {} |
bool | m_WMatrixComputed {} |
YMatrixType | m_YMatrix {} |
Protected Attributes inherited from itk::Transform< TParametersValueType, VDimension, VDimension > | |
FixedParametersType | m_FixedParameters |
ParametersType | m_Parameters |
Additional Inherited Members | |
Public Attributes inherited from itk::Transform< TParametersValueType, VDimension, VDimension > | |
InverseJacobianPositionType &jacobian | const |
Static Protected Member Functions inherited from itk::Transform< TParametersValueType, VDimension, VDimension > | |
static InverseTransformBasePointer | InvertTransform (const TTransform &transform) |
using itk::KernelTransform< TParametersValueType, VDimension >::AMatrixType = vnl_matrix_fixed<TParametersValueType, VDimension, VDimension> |
'A' matrix type alias. Rotational part of the Affine component
Definition at line 275 of file itkKernelTransform.h.
using itk::KernelTransform< TParametersValueType, VDimension >::BMatrixType = vnl_vector_fixed<TParametersValueType, VDimension> |
'B' matrix type alias. Translational part of the Affine component
Definition at line 278 of file itkKernelTransform.h.
using itk::KernelTransform< TParametersValueType, VDimension >::ColumnMatrixType = vnl_matrix_fixed<TParametersValueType, VDimension, 1> |
Column matrix type alias.
Definition at line 284 of file itkKernelTransform.h.
using itk::KernelTransform< TParametersValueType, VDimension >::ConstPointer = SmartPointer<const Self> |
Definition at line 70 of file itkKernelTransform.h.
using itk::KernelTransform< TParametersValueType, VDimension >::DMatrixType = vnl_matrix<TParametersValueType> |
'D' matrix type alias. Deformation component
Definition at line 272 of file itkKernelTransform.h.
using itk::KernelTransform< TParametersValueType, VDimension >::GMatrixType = vnl_matrix_fixed<TParametersValueType, VDimension, VDimension> |
'G' matrix type alias.
Definition at line 254 of file itkKernelTransform.h.
using itk::KernelTransform< TParametersValueType, VDimension >::IMatrixType = vnl_matrix_fixed<TParametersValueType, VDimension, VDimension> |
'I' (identity) matrix type alias.
Definition at line 181 of file itkKernelTransform.h.
using itk::KernelTransform< TParametersValueType, VDimension >::KMatrixType = vnl_matrix<TParametersValueType> |
'K' matrix type alias.
Definition at line 260 of file itkKernelTransform.h.
using itk::KernelTransform< TParametersValueType, VDimension >::LMatrixType = vnl_matrix<TParametersValueType> |
'L' matrix type alias.
Definition at line 257 of file itkKernelTransform.h.
using itk::KernelTransform< TParametersValueType, VDimension >::PMatrixType = vnl_matrix<TParametersValueType> |
'P' matrix type alias.
Definition at line 263 of file itkKernelTransform.h.
using itk::KernelTransform< TParametersValueType, VDimension >::Pointer = SmartPointer<Self> |
Definition at line 69 of file itkKernelTransform.h.
using itk::KernelTransform< TParametersValueType, VDimension >::PointIdentifier = typename PointSetType::PointIdentifier |
Definition at line 125 of file itkKernelTransform.h.
using itk::KernelTransform< TParametersValueType, VDimension >::PointsConstIterator = typename PointSetType::PointsContainerConstIterator |
Definition at line 124 of file itkKernelTransform.h.
using itk::KernelTransform< TParametersValueType, VDimension >::PointsContainer = typename PointSetType::PointsContainer |
Definition at line 122 of file itkKernelTransform.h.
using itk::KernelTransform< TParametersValueType, VDimension >::PointSetPointer = typename PointSetType::Pointer |
Definition at line 121 of file itkKernelTransform.h.
using itk::KernelTransform< TParametersValueType, VDimension >::PointSetTraitsType = DefaultStaticMeshTraits<TParametersValueType, VDimension, VDimension, TParametersValueType, TParametersValueType> |
PointList type alias. This type is used for maintaining lists of points, specifically, the source and target landmark lists.
Definition at line 118 of file itkKernelTransform.h.
using itk::KernelTransform< TParametersValueType, VDimension >::PointSetType = PointSet<InputPointType, VDimension, PointSetTraitsType> |
Definition at line 119 of file itkKernelTransform.h.
using itk::KernelTransform< TParametersValueType, VDimension >::PointsIterator = typename PointSetType::PointsContainerIterator |
Definition at line 123 of file itkKernelTransform.h.
using itk::KernelTransform< TParametersValueType, VDimension >::RowMatrixType = vnl_matrix_fixed<TParametersValueType, 1, VDimension> |
Row matrix type alias.
Definition at line 281 of file itkKernelTransform.h.
using itk::KernelTransform< TParametersValueType, VDimension >::Self = KernelTransform |
Standard class type aliases.
Definition at line 67 of file itkKernelTransform.h.
using itk::KernelTransform< TParametersValueType, VDimension >::Superclass = Transform<TParametersValueType, VDimension, VDimension> |
Definition at line 68 of file itkKernelTransform.h.
using itk::KernelTransform< TParametersValueType, VDimension >::VectorSetPointer = typename VectorSetType::Pointer |
Definition at line 129 of file itkKernelTransform.h.
using itk::KernelTransform< TParametersValueType, VDimension >::VectorSetType = itk::VectorContainer<InputVectorType> |
VectorSet type alias.
Definition at line 128 of file itkKernelTransform.h.
using itk::KernelTransform< TParametersValueType, VDimension >::WMatrixType = vnl_matrix<TParametersValueType> |
'W' matrix type alias.
Definition at line 269 of file itkKernelTransform.h.
using itk::KernelTransform< TParametersValueType, VDimension >::YMatrixType = vnl_matrix<TParametersValueType> |
'Y' matrix type alias.
Definition at line 266 of file itkKernelTransform.h.
|
protected |
|
overrideprotecteddefault |
|
protected |
Compute displacements \( q_i - p_i \).
|
protectedvirtual |
Compute the contribution of the landmarks weighted by the kernel function to the global deformation of the space
Reimplemented in itk::ThinPlateR2LogRSplineKernelTransform< TParametersValueType, VDimension >, itk::ThinPlateSplineKernelTransform< TParametersValueType, VDimension >, and itk::VolumeSplineKernelTransform< TParametersValueType, VDimension >.
|
protectedvirtual |
Compute G(x) This is essentially the kernel of the transform. By overriding this method, we can obtain (among others): Elastic body spline Thin plate spline Volume spline
Reimplemented in itk::ElasticBodySplineKernelTransform< TParametersValueType, VDimension >, itk::ElasticBodyReciprocalSplineKernelTransform< TParametersValueType, VDimension >, itk::ThinPlateR2LogRSplineKernelTransform< TParametersValueType, VDimension >, itk::ThinPlateSplineKernelTransform< TParametersValueType, VDimension >, and itk::VolumeSplineKernelTransform< TParametersValueType, VDimension >.
|
overridevirtual |
Compute the Jacobian Matrix of the transformation at one point
Implements itk::Transform< TParametersValueType, VDimension, VDimension >.
|
inlineoverridevirtual |
This provides the ability to get a local jacobian value in a dense/local transform, e.g. DisplacementFieldTransform. For such transforms it would be unclear what parameters would refer to. Generally, global transforms should return an identity jacobian since there is no change with respect to position.
Reimplemented from itk::Transform< TParametersValueType, VDimension, VDimension >.
Definition at line 188 of file itkKernelTransform.h.
References GetNameOfClass().
|
protected |
Compute K matrix.
|
protected |
Compute L matrix.
|
protected |
Compute P matrix.
|
protectedvirtual |
Compute a G(x) for a point to itself (i.e. for the block diagonal elements of the matrix K. Parameter indicates for which landmark the reflexive G is to be computed. The default implementation for the reflexive contribution is a diagonal matrix where the diagonal elements are the stiffness of the spline.
void itk::KernelTransform< TParametersValueType, VDimension >::ComputeWMatrix | ( | ) |
Compute W matrix.
|
protected |
Compute Y matrix.
|
override |
Get Transform Fixed Parameters - Gets the Target Landmarks
|
virtual |
Get the displacements list, which we will denote \( d \), where \( d_i = q_i - p_i \).
|
virtual |
Get/Set the source landmarks list, which we will denote \( p \).
|
virtual |
Get the target landmarks list, which we will denote \( q \).
|
override |
|
override |
Get the Transformation Parameters - Gets the Source Landmarks
|
virtual |
Stiffness of the spline. A stiffness of zero results in the standard interpolating spline. A non-zero stiffness allows the spline to approximate rather than interpolate the landmarks. Stiffness values are usually rather small, typically in the range of 0.001 to 0.1. The approximating spline formulation is based on the short paper by R. Sprengel, K. Rohr, H. Stiehl. "Thin-Plate Spline Approximation for Image Registration". In 18th International Conference of the IEEE Engineering in Medicine and Biology Society. 1996.
|
inlineoverride |
This transform is not linear, because the transformation of a linear combination of points is not equal to the linear combination of the transformations of individual points
Definition at line 227 of file itkKernelTransform.h.
|
static |
New macro for creation of through a Smart Pointer
|
overrideprotected |
|
protected |
Reorganize the components of W into D (deformable), A (rotation part of affine) and B (translational part of affine ) components.
|
overridevirtual |
Set Transform Fixed Parameters: To support the transform file writer this function was added to set the target landmarks similar to the SetParameters function setting the source landmarks
Implements itk::Transform< TParametersValueType, VDimension, VDimension >.
|
overridevirtual |
Set the Transformation Parameters and update the internal transformation. The parameters represent the source landmarks. Each landmark point is represented by VDimension doubles. All the landmarks are concatenated to form one flat Array<double>.
Implements itk::Transform< TParametersValueType, VDimension, VDimension >.
|
virtual |
Get/Set the source landmarks list, which we will denote \( p \).
|
virtual |
Stiffness of the spline. A stiffness of zero results in the standard interpolating spline. A non-zero stiffness allows the spline to approximate rather than interpolate the landmarks. Stiffness values are usually rather small, typically in the range of 0.001 to 0.1. The approximating spline formulation is based on the short paper by R. Sprengel, K. Rohr, H. Stiehl. "Thin-Plate Spline Approximation for Image Registration". In 18th International Conference of the IEEE Engineering in Medicine and Biology Society. 1996.
|
virtual |
Get the target landmarks list, which we will denote \( q \).
|
inlineoverridevirtual |
Method to transform a CovariantVector.
Reimplemented from itk::Transform< TParametersValueType, VDimension, VDimension >.
Definition at line 173 of file itkKernelTransform.h.
|
overridevirtual |
Compute the position of point in the new space
Implements itk::Transform< TParametersValueType, VDimension, VDimension >.
|
inlineoverridevirtual |
Method to transform a vector.
Reimplemented from itk::Transform< TParametersValueType, VDimension, VDimension >.
Definition at line 158 of file itkKernelTransform.h.
|
inlineoverridevirtual |
Method to transform a vnl_vector.
Reimplemented from itk::Transform< TParametersValueType, VDimension, VDimension >.
Definition at line 165 of file itkKernelTransform.h.
|
virtual |
Update the Parameters array from the landmarks coordinates.
|
protected |
Rotational/Shearing part of the Affine component of the Transformation
Definition at line 369 of file itkKernelTransform.h.
|
protected |
Translational part of the Affine component of the Transformation
Definition at line 372 of file itkKernelTransform.h.
|
protected |
The list of displacements. d[i] = q[i] - p[i];
Definition at line 344 of file itkKernelTransform.h.
|
protected |
The Deformation matrix. This is an auxiliary matrix that will hold the Deformation (non-affine) part of the transform. Those are the coefficients that will multiply the Kernel function
Definition at line 366 of file itkKernelTransform.h.
|
mutableprotected |
The G matrix. It is made mutable because m_GMatrix was made an ivar only to avoid copying the matrix at return time
Definition at line 377 of file itkKernelTransform.h.
|
protected |
Identity matrix.
Definition at line 383 of file itkKernelTransform.h.
|
protected |
The K matrix.
Definition at line 350 of file itkKernelTransform.h.
|
protected |
The L matrix.
Definition at line 347 of file itkKernelTransform.h.
|
protected |
The P matrix.
Definition at line 353 of file itkKernelTransform.h.
|
protected |
The list of source landmarks, denoted 'p'.
Definition at line 386 of file itkKernelTransform.h.
|
protected |
Stiffness parameter
Definition at line 340 of file itkKernelTransform.h.
|
protected |
The list of target landmarks, denoted 'q'.
Definition at line 389 of file itkKernelTransform.h.
|
protected |
The W matrix.
Definition at line 359 of file itkKernelTransform.h.
|
protected |
Has the W matrix been computed?
Definition at line 380 of file itkKernelTransform.h.
|
protected |
The Y matrix.
Definition at line 356 of file itkKernelTransform.h.
|
staticconstexpr |
Dimension of the domain space.
Definition at line 79 of file itkKernelTransform.h.