#include <itkAdvancedMatrixOffsetTransformBase.h>
Matrix and Offset transformation of a vector space (e.g. space coordinates)
This class serves as a base class for transforms that can be expressed as a linear transformation plus a constant offset (e.g., affine, similarity and rigid transforms). This base class also provides the concept of using a center of rotation and a translation instead of an offset.
As derived instances of this class are specializations of an affine transform, any two of these transformations may be composed and the result is an affine transformation. However, the order is important. Given two affine transformations T1 and T2, we will say that "precomposing T1 with T2" yields the transformation which applies T1 to the source, and then applies T2 to that result to obtain the target. Conversely, we will say that "postcomposing T1 with T2" yields the transformation which applies T2 to the source, and then applies T1 to that result to obtain the target. (Whether T1 or T2 comes first lexicographically depends on whether you choose to write mappings from right-to-left or vice versa; we avoid the whole problem by referring to the order of application rather than the textual order.)
There are three template parameters for this class:
ScalarT The type to be used for scalar numeric values. Either float or double.
NInputDimensions The number of dimensions of the input vector space.
NOutputDimensions The number of dimensions of the output vector space.
This class provides several methods for setting the matrix and offset defining the transform. To support the registration framework, the transform parameters can also be set as an Array<double> of size (NInputDimension + 1) * NOutputDimension using method SetParameters(). The first (NOutputDimension x NInputDimension) parameters defines the matrix in row-major order (where the column index varies the fastest). The last NOutputDimension parameters defines the translation in each dimensions.
Definition at line 95 of file itkAdvancedMatrixOffsetTransformBase.h.
Public Member Functions | |
const InputPointType & | GetCenter () const |
virtual const char * | GetClassName () const |
const FixedParametersType & | GetFixedParameters () const override |
void | GetJacobian (const InputPointType &, JacobianType &, NonZeroJacobianIndicesType &) const override |
void | GetJacobianOfSpatialHessian (const InputPointType &, JacobianOfSpatialHessianType &, NonZeroJacobianIndicesType &) const override |
void | GetJacobianOfSpatialHessian (const InputPointType &inputPoint, SpatialHessianType &sh, JacobianOfSpatialHessianType &jsh, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const override |
void | GetJacobianOfSpatialJacobian (const InputPointType &, JacobianOfSpatialJacobianType &, NonZeroJacobianIndicesType &) const override |
void | GetJacobianOfSpatialJacobian (const InputPointType &, SpatialJacobianType &, JacobianOfSpatialJacobianType &, NonZeroJacobianIndicesType &) const override |
const MatrixType & | GetMatrix () const |
const ParametersType & | GetParameters () const override |
void | GetSpatialHessian (const InputPointType &, SpatialHessianType &) const override |
void | GetSpatialJacobian (const InputPointType &, SpatialJacobianType &) const override |
TransformCategoryEnum | GetTransformCategory () const override |
const OutputVectorType & | GetTranslation () const |
bool | IsLinear () const override |
itkStaticConstMacro (InputSpaceDimension, unsigned int, NInputDimensions) | |
itkStaticConstMacro (OutputSpaceDimension, unsigned int, NOutputDimensions) | |
itkStaticConstMacro (ParametersDimension, unsigned int, NOutputDimensions *(NInputDimensions+1)) | |
void | SetCenter (const InputPointType ¢er) |
void | SetFixedParameters (const FixedParametersType &) override |
virtual void | SetIdentity () |
virtual void | SetMatrix (const MatrixType &matrix) |
void | SetParameters (const ParametersType ¶meters) override |
void | SetTranslation (const OutputVectorType &translation) |
OutputCovariantVectorType | TransformCovariantVector (const InputCovariantVectorType &vector) const override |
OutputPointType | TransformPoint (const InputPointType &point) const override |
OutputVectorType | TransformVector (const InputVectorType &vector) const override |
OutputVnlVectorType | TransformVector (const InputVnlVectorType &vector) const override |
Public Member Functions inherited from itk::AdvancedTransform< double, 3, 3 > | |
void | ComputeJacobianWithRespectToParameters (const InputPointType &, JacobianType &) const override |
virtual void | EvaluateJacobianWithImageGradientProduct (const InputPointType &inputPoint, const MovingImageGradientType &movingImageGradient, DerivativeType &imageJacobian, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const |
virtual bool | GetHasNonZeroJacobianOfSpatialHessian () const |
virtual bool | GetHasNonZeroSpatialHessian () const |
virtual NumberOfParametersType | GetNumberOfNonZeroJacobianIndices () const |
ITK_DISALLOW_COPY_AND_MOVE (AdvancedTransform) | |
itkStaticConstMacro (InputSpaceDimension, unsigned int, NInputDimensions) | |
itkStaticConstMacro (OutputSpaceDimension, unsigned int, NOutputDimensions) | |
Static Public Member Functions | |
static Pointer | New () |
Protected Member Functions | |
AdvancedMatrixOffsetTransformBase (const unsigned int paramDims=ParametersDimension) | |
virtual void | ComputeMatrix () |
virtual void | ComputeMatrixParameters () |
virtual void | ComputeOffset () |
void | ComputeTranslation () |
const OutputVectorType & | GetOffset () const |
void | PrintSelf (std::ostream &s, Indent indent) const override |
void | SetVarMatrix (const MatrixType &matrix) |
void | SetVarTranslation (const OutputVectorType &translation) |
~AdvancedMatrixOffsetTransformBase () override=default | |
Protected Member Functions inherited from itk::AdvancedTransform< double, 3, 3 > | |
AdvancedTransform ()=default | |
~AdvancedTransform () override=default | |
Protected Attributes | |
JacobianOfSpatialHessianType | m_JacobianOfSpatialHessian {} |
JacobianOfSpatialJacobianType | m_JacobianOfSpatialJacobian {} |
NonZeroJacobianIndicesType | m_NonZeroJacobianIndices {} |
SpatialHessianType | m_SpatialHessian {} |
Protected Attributes inherited from itk::AdvancedTransform< double, 3, 3 > | |
bool | m_HasNonZeroJacobianOfSpatialHessian |
bool | m_HasNonZeroSpatialHessian |
Private Member Functions | |
AdvancedMatrixOffsetTransformBase (const Self &other) | |
const InverseMatrixType & | GetInverseMatrix () const |
const Self & | operator= (const Self &) |
void | PrecomputeJacobians (unsigned int paramDims) |
Private Attributes | |
InputPointType | m_Center {} |
InverseMatrixType | m_InverseMatrix { InverseMatrixType::GetIdentity() } |
TimeStamp | m_InverseMatrixMTime {} |
MatrixType | m_Matrix { MatrixType::GetIdentity() } |
TimeStamp | m_MatrixMTime {} |
OutputVectorType | m_Offset {} |
bool | m_Singular { false } |
OutputVectorType | m_Translation {} |
using itk::AdvancedMatrixOffsetTransformBase< TScalarType, NInputDimensions, NOutputDimensions >::CenterType = InputPointType |
Typedefs.
Definition at line 147 of file itkAdvancedMatrixOffsetTransformBase.h.
using itk::AdvancedMatrixOffsetTransformBase< TScalarType, NInputDimensions, NOutputDimensions >::ConstPointer = SmartPointer<const Self> |
Definition at line 103 of file itkAdvancedMatrixOffsetTransformBase.h.
using itk::AdvancedMatrixOffsetTransformBase< TScalarType, NInputDimensions, NOutputDimensions >::InverseMatrixType = Matrix<TScalarType, Self::InputSpaceDimension, Self::OutputSpaceDimension> |
Standard inverse matrix type for this class.
Definition at line 144 of file itkAdvancedMatrixOffsetTransformBase.h.
using itk::AdvancedMatrixOffsetTransformBase< TScalarType, NInputDimensions, NOutputDimensions >::MatrixType = Matrix<TScalarType, Self::OutputSpaceDimension, Self::InputSpaceDimension> |
Standard matrix type for this class.
Definition at line 141 of file itkAdvancedMatrixOffsetTransformBase.h.
using itk::AdvancedMatrixOffsetTransformBase< TScalarType, NInputDimensions, NOutputDimensions >::OffsetType = OutputVectorType |
Definition at line 148 of file itkAdvancedMatrixOffsetTransformBase.h.
using itk::AdvancedMatrixOffsetTransformBase< TScalarType, NInputDimensions, NOutputDimensions >::Pointer = SmartPointer<Self> |
Definition at line 102 of file itkAdvancedMatrixOffsetTransformBase.h.
using itk::AdvancedMatrixOffsetTransformBase< TScalarType, NInputDimensions, NOutputDimensions >::Self = AdvancedMatrixOffsetTransformBase |
Standard typedefs
Definition at line 100 of file itkAdvancedMatrixOffsetTransformBase.h.
using itk::AdvancedMatrixOffsetTransformBase< TScalarType, NInputDimensions, NOutputDimensions >::Superclass = AdvancedTransform<TScalarType, NInputDimensions, NOutputDimensions> |
Definition at line 101 of file itkAdvancedMatrixOffsetTransformBase.h.
using itk::AdvancedMatrixOffsetTransformBase< TScalarType, NInputDimensions, NOutputDimensions >::TranslationType = OutputVectorType |
Definition at line 149 of file itkAdvancedMatrixOffsetTransformBase.h.
|
explicitprotected |
Construct an AdvancedMatrixOffsetTransformBase object
This method constructs a new AdvancedMatrixOffsetTransformBase object and initializes the matrix and offset parts of the transformation to values specified by the caller. If the arguments are omitted, then the AdvancedMatrixOffsetTransformBase is initialized to an identity transformation in the appropriate number of dimensions.
|
overrideprotecteddefault |
Destroy an AdvancedMatrixOffsetTransformBase object.
|
private |
|
protectedvirtual |
Reimplemented in itk::AdvancedEuler3DTransform< TScalarType >, itk::AdvancedEuler3DTransform< float >, itk::AdvancedRigid2DTransform< TScalarType >, itk::AdvancedRigid2DTransform< double >, itk::AdvancedRigid2DTransform< float >, itk::AdvancedSimilarity2DTransform< TScalarType >, itk::AdvancedSimilarity2DTransform< float >, itk::AdvancedSimilarity3DTransform< TScalarType >, itk::AdvancedSimilarity3DTransform< float >, itk::AdvancedVersorTransform< TScalarType >, itk::AdvancedVersorTransform< double >, itk::AdvancedVersorTransform< float >, itk::AffineDTI2DTransform< TScalarType >, and itk::AffineDTI3DTransform< TScalarType >.
|
protectedvirtual |
Reimplemented in itk::AdvancedEuler3DTransform< TScalarType >, itk::AdvancedEuler3DTransform< float >, itk::AdvancedRigid2DTransform< TScalarType >, itk::AdvancedRigid2DTransform< double >, itk::AdvancedRigid2DTransform< float >, itk::AdvancedSimilarity2DTransform< TScalarType >, itk::AdvancedSimilarity2DTransform< float >, itk::AdvancedSimilarity3DTransform< TScalarType >, itk::AdvancedSimilarity3DTransform< float >, itk::AdvancedVersorTransform< TScalarType >, itk::AdvancedVersorTransform< double >, itk::AdvancedVersorTransform< float >, itk::AffineDTI2DTransform< TScalarType >, and itk::AffineDTI3DTransform< TScalarType >.
|
protectedvirtual |
|
protected |
|
inline |
Get center of rotation of the AdvancedMatrixOffsetTransformBase
This method returns the point used as the fixed center of rotation for the AdvancedMatrixOffsetTransformBase. To define an affine transform, you must set the matrix, center, and translation OR the matrix and offset.
Definition at line 234 of file itkAdvancedMatrixOffsetTransformBase.h.
|
virtual |
Run-time type information (and related methods).
Reimplemented from itk::AdvancedTransform< double, 3, 3 >.
Reimplemented in itk::AdvancedEuler3DTransform< TScalarType >, itk::AdvancedEuler3DTransform< float >, itk::AdvancedRigid2DTransform< TScalarType >, itk::AdvancedRigid2DTransform< double >, itk::AdvancedRigid2DTransform< float >, itk::AdvancedRigid3DTransform< TScalarType >, itk::AdvancedRigid3DTransform< double >, itk::AdvancedRigid3DTransform< float >, itk::AdvancedSimilarity2DTransform< TScalarType >, itk::AdvancedSimilarity2DTransform< float >, itk::AdvancedSimilarity3DTransform< TScalarType >, itk::AdvancedSimilarity3DTransform< float >, itk::AdvancedVersorRigid3DTransform< TScalarType >, itk::AdvancedVersorRigid3DTransform< double >, itk::AdvancedVersorRigid3DTransform< float >, itk::AdvancedVersorTransform< TScalarType >, itk::AdvancedVersorTransform< double >, itk::AdvancedVersorTransform< float >, itk::AffineDTI2DTransform< TScalarType >, itk::AffineDTI3DTransform< TScalarType >, itk::AffineLogTransform< TScalarType, Dimension >, itk::GPUAdvancedEuler2DTransform< TScalarType, TParentTransform >, itk::GPUAdvancedEuler3DTransform< TScalarType, TParentTransform >, itk::GPUAdvancedMatrixOffsetTransformBase< TScalarType, NDimensions, TParentTransform >, itk::GPUAdvancedSimilarity2DTransform< TScalarType, TParentTransform >, and itk::GPUAdvancedSimilarity3DTransform< TScalarType, TParentTransform >.
|
override |
Get the Fixed Parameters.
|
private |
|
overridevirtual |
Compute the Jacobian of the transformation.
Implements itk::AdvancedTransform< double, 3, 3 >.
Reimplemented in itk::AdvancedRigid2DTransform< TScalarType >, itk::AdvancedRigid2DTransform< double >, itk::AdvancedRigid2DTransform< float >, itk::AdvancedSimilarity2DTransform< TScalarType >, itk::AdvancedSimilarity2DTransform< float >, itk::AdvancedSimilarity3DTransform< TScalarType >, itk::AdvancedSimilarity3DTransform< float >, itk::AdvancedVersorRigid3DTransform< TScalarType >, itk::AdvancedVersorRigid3DTransform< double >, itk::AdvancedVersorRigid3DTransform< float >, itk::AdvancedVersorTransform< TScalarType >, itk::AdvancedVersorTransform< double >, itk::AdvancedVersorTransform< float >, itk::AffineDTI2DTransform< TScalarType >, itk::AffineDTI3DTransform< TScalarType >, and itk::AffineLogTransform< TScalarType, Dimension >.
|
overridevirtual |
Compute the Jacobian of the spatial Hessian of the transformation.
Implements itk::AdvancedTransform< double, 3, 3 >.
|
overridevirtual |
Compute both the spatial Hessian and the Jacobian of the spatial Hessian of the transformation.
Implements itk::AdvancedTransform< double, 3, 3 >.
|
overridevirtual |
Compute the Jacobian of the spatial Jacobian of the transformation.
Implements itk::AdvancedTransform< double, 3, 3 >.
|
overridevirtual |
Compute the Jacobian of the spatial Jacobian of the transformation.
Implements itk::AdvancedTransform< double, 3, 3 >.
|
inline |
Get matrix of an AdvancedMatrixOffsetTransformBase
This method returns the value of the matrix of the AdvancedMatrixOffsetTransformBase. To define an affine transform, you must set the matrix, center, and translation OR the matrix and offset.
Definition at line 188 of file itkAdvancedMatrixOffsetTransformBase.h.
|
inlineprotected |
Get offset of an AdvancedMatrixOffsetTransformBase
This method returns the offset value of the AdvancedMatrixOffsetTransformBase. To define an affine transform, you must set the matrix, center, and translation OR the matrix and offset.
Definition at line 421 of file itkAdvancedMatrixOffsetTransformBase.h.
|
override |
Get the Transformation Parameters.
|
overridevirtual |
Compute the spatial Hessian of the transformation.
Implements itk::AdvancedTransform< double, 3, 3 >.
|
overridevirtual |
Compute the spatial Jacobian of the transformation.
Implements itk::AdvancedTransform< double, 3, 3 >.
|
inlineoverride |
Indicates the category transform. e.g. an affine transform, or a local one, e.g. a deformation field.
Definition at line 326 of file itkAdvancedMatrixOffsetTransformBase.h.
|
inline |
Get translation component of the AdvancedMatrixOffsetTransformBase
This method returns the translation used after rotation about the center point. To define an affine transform, you must set the matrix, center, and translation OR the matrix and offset.
Definition at line 264 of file itkAdvancedMatrixOffsetTransformBase.h.
|
inlineoverride |
Indicates that this transform is linear. That is, given two points P and Q, and scalar coefficients a and b, then
T( a*P + b*Q ) = a * T(P) + b * T(Q)
Definition at line 316 of file itkAdvancedMatrixOffsetTransformBase.h.
itk::AdvancedMatrixOffsetTransformBase< TScalarType, NInputDimensions, NOutputDimensions >::itkStaticConstMacro | ( | InputSpaceDimension | , |
unsigned int | , | ||
NInputDimensions | ) |
Dimension of the domain space.
itk::AdvancedMatrixOffsetTransformBase< TScalarType, NInputDimensions, NOutputDimensions >::itkStaticConstMacro | ( | OutputSpaceDimension | , |
unsigned int | , | ||
NOutputDimensions | ) |
itk::AdvancedMatrixOffsetTransformBase< TScalarType, NInputDimensions, NOutputDimensions >::itkStaticConstMacro | ( | ParametersDimension | , |
unsigned int | , | ||
NOutputDimensions * | NInputDimensions+1 ) |
|
static |
New macro for creation of through a Smart Pointer.
|
private |
|
private |
Called by constructors:
|
overrideprotected |
Print contents of an AdvancedMatrixOffsetTransformBase.
|
inline |
Set center of rotation of an AdvancedMatrixOffsetTransformBase
This method sets the center of rotation of an AdvancedMatrixOffsetTransformBase to a fixed point - for most transforms derived from this class, this point is not a "parameter" of the transform - the exception is that "centered" transforms have center as a parameter during optimization.
This method updates offset wrt to current translation and matrix. That is, changing the center changes the transform!
WARNING: When using the Center, we strongly recommend only changing the matrix and translation to define a transform. Changing a transform's center, changes the mapping between spaces - specifically, translation is not changed with respect to that new center, and so the offset is updated to * maintain the consistency with translation. If a center is not used, or is set before the matrix and the offset, then it is safe to change the offset directly. As a rule of thumb, if you wish to set the center explicitly, set before Offset computations are done.
To define an affine transform, you must set the matrix, center, and translation OR the matrix and offset.
Definition at line 218 of file itkAdvancedMatrixOffsetTransformBase.h.
|
override |
Set the fixed parameters and update internal transformation.
|
virtual |
Set the transformation to an Identity This sets the matrix to identity and the Offset to null.
Reimplemented in itk::AdvancedEuler3DTransform< TScalarType >, itk::AdvancedEuler3DTransform< float >, itk::AdvancedRigid2DTransform< TScalarType >, itk::AdvancedRigid2DTransform< double >, itk::AdvancedRigid2DTransform< float >, itk::AdvancedSimilarity2DTransform< TScalarType >, itk::AdvancedSimilarity2DTransform< float >, itk::AdvancedVersorTransform< TScalarType >, itk::AdvancedVersorTransform< double >, itk::AdvancedVersorTransform< float >, itk::AffineDTI2DTransform< TScalarType >, itk::AffineDTI3DTransform< TScalarType >, and itk::AffineLogTransform< TScalarType, Dimension >.
|
inlinevirtual |
Set matrix of an AdvancedMatrixOffsetTransformBase
This method sets the matrix of an AdvancedMatrixOffsetTransformBase to a value specified by the user.
This updates the Offset wrt to current translation and center. See the warning regarding offset-versus-translation in the documentation for SetCenter.
To define an affine transform, you must set the matrix, center, and translation OR the matrix and offset.
Reimplemented in itk::AdvancedRigid2DTransform< double >, itk::AdvancedRigid2DTransform< float >, itk::AdvancedRigid3DTransform< double >, itk::AdvancedRigid3DTransform< float >, itk::AdvancedSimilarity2DTransform< float >, itk::AdvancedSimilarity3DTransform< TScalarType >, and itk::AdvancedSimilarity3DTransform< float >.
Definition at line 170 of file itkAdvancedMatrixOffsetTransformBase.h.
|
override |
Set the transformation from a container of parameters. The first (NOutputDimension x NInputDimension) parameters define the matrix and the last NOutputDimension parameters the translation. Offset is updated based on current center.
|
inline |
Set translation of an AdvancedMatrixOffsetTransformBase
This method sets the translation of an AdvancedMatrixOffsetTransformBase. This updates Offset to reflect current translation. To define an affine transform, you must set the matrix, center, and translation OR the matrix and offset.
Definition at line 248 of file itkAdvancedMatrixOffsetTransformBase.h.
|
inlineprotected |
Definition at line 396 of file itkAdvancedMatrixOffsetTransformBase.h.
|
inlineprotected |
Definition at line 406 of file itkAdvancedMatrixOffsetTransformBase.h.
|
override |
|
override |
Transform by an affine transformation
This method applies the affine transform given by self to a given point or vector, returning the transformed point or vector. The TransformPoint method transforms its argument as an affine point, whereas the TransformVector method transforms its argument as a vector.
|
override |
|
override |
|
private |
Definition at line 457 of file itkAdvancedMatrixOffsetTransformBase.h.
|
mutableprivate |
Definition at line 454 of file itkAdvancedMatrixOffsetTransformBase.h.
|
mutableprivate |
Definition at line 462 of file itkAdvancedMatrixOffsetTransformBase.h.
|
protected |
Definition at line 432 of file itkAdvancedMatrixOffsetTransformBase.h.
|
protected |
Definition at line 431 of file itkAdvancedMatrixOffsetTransformBase.h.
|
private |
Member variables.
Definition at line 452 of file itkAdvancedMatrixOffsetTransformBase.h.
|
private |
To avoid recomputation of the inverse if not needed.
Definition at line 461 of file itkAdvancedMatrixOffsetTransformBase.h.
|
protected |
(spatial) Jacobians and Hessians can mostly be precomputed by this transform. Store them in these member variables. SpatialJacobian is simply m_Matrix
Definition at line 429 of file itkAdvancedMatrixOffsetTransformBase.h.
|
private |
Definition at line 453 of file itkAdvancedMatrixOffsetTransformBase.h.
|
mutableprivate |
Definition at line 455 of file itkAdvancedMatrixOffsetTransformBase.h.
|
protected |
Definition at line 430 of file itkAdvancedMatrixOffsetTransformBase.h.
|
private |
Definition at line 458 of file itkAdvancedMatrixOffsetTransformBase.h.
Generated on 2024-07-17 for elastix by 1.11.0 (9b424b03c9833626cd435af22a444888fbbb192d) |