ITK
4.6.0
Insight Segmentation and Registration Toolkit
|
#include <itkDisplacementFieldTransform.h>
Provides local/dense/high-dimensionaltiy transformation via a a displacement field.
The displacement field stores vectors of displacements, with dimension NDimensions
. Transformation is performed at a given point by adding the displacement at that point to the input point.
T(x, p), x is the position, p is the local parameter at position x. For a 2D example:
x = (x0, x1), p = (p0, p1)
then T(x, p) is defined as:
T(x, p) = (T0, T1) = (x0+p0, x1+p1)
During transformation, out-of-bounds input points are returned with zero displacement.
The displacement field is defined using an itkImage, and must be set before use by the user, using SetDisplacementField
. The image has the same dimensionality as the input and output spaces, defined by template parameter NDimensions
, and is an image of vectors of type OutputVectorType
, with dimensionality NDimensions as well.
An interpolator of type VectorInterpolateImageFunction
is used with the displacement field image. By default, VectorLinearInterpolateImageFunction is used, and the user can override using SetInterpolator.
The displacement field data is stored using the common OptimizerParameters
type in conjunction with the ImageVectorOptimizerParametersHelper
class. This allows access of the displacement field image as if it were an itkArray, allowing transparent use with other classes.
SetParameters
method will copy the passed parameters, which can be costly since displacement fields are dense and thus potentially very large.The UpdateTransformParameters
method simply adds the provided update array, applying the usual optional scaling factor. Derived classes may provide different behavior.
Because this is a local transform, methods that have a version that takes a point must be used, such as TransformVector
, TransformCovariantVector
, and TransformDiffusionTensor
. Also, ComputeJacobianWithRespectToParameters
simply returns an identity matrix (see method documentation), and ComputeJacobianWithRespectToPosition
should be used.
Definition at line 87 of file itkDisplacementFieldTransform.h.
Static Public Member Functions | |
static Pointer | New () |
Static Public Member Functions inherited from itk::Object | |
static bool | GetGlobalWarningDisplay () |
static void | GlobalWarningDisplayOff () |
static void | GlobalWarningDisplayOn () |
static Pointer | New () |
static void | SetGlobalWarningDisplay (bool flag) |
Static Public Member Functions inherited from itk::LightObject | |
static void | BreakOnError () |
static Pointer | New () |
Static Public Attributes | |
static const unsigned int | Dimension = NDimensions |
Static Public Attributes inherited from itk::Transform< TScalar, NDimensions, NDimensions > | |
static const unsigned int | InputSpaceDimension |
static const unsigned int | OutputSpaceDimension |
Protected Member Functions | |
DisplacementFieldTransform () | |
void | PrintSelf (std::ostream &os, Indent indent) const |
virtual | ~DisplacementFieldTransform () |
Protected Member Functions inherited from itk::Transform< TScalar, NDimensions, NDimensions > | |
virtual LightObject::Pointer | InternalClone () const |
OutputDiffusionTensor3DType | PreservationOfPrincipalDirectionDiffusionTensor3DReorientation (const InputDiffusionTensor3DType, const JacobianType) const |
Transform () | |
Transform (NumberOfParametersType NumberOfParameters) | |
virtual | ~Transform () |
Protected Member Functions inherited from itk::TransformBaseTemplate< TScalar > | |
TransformBaseTemplate () | |
virtual | ~TransformBaseTemplate () |
Protected Member Functions inherited from itk::Object | |
Object () | |
bool | PrintObservers (std::ostream &os, Indent indent) const |
virtual void | SetTimeStamp (const TimeStamp &time) |
virtual | ~Object () |
Protected Member Functions inherited from itk::LightObject | |
LightObject () | |
virtual void | PrintHeader (std::ostream &os, Indent indent) const |
virtual void | PrintTrailer (std::ostream &os, Indent indent) const |
virtual | ~LightObject () |
Private Member Functions | |
virtual void | ComputeJacobianWithRespectToPositionInternal (const IndexType &index, JacobianType &jacobian, bool doInverseJacobian) const |
DisplacementFieldTransform (const Self &) | |
void | operator= (const Self &) |
virtual void | SetFixedParametersFromDisplacementField () const |
virtual void | VerifyFixedParametersInformation () |
Additional Inherited Members | |
Protected Types inherited from itk::LightObject | |
typedef int | InternalReferenceCountType |
typedef SmartPointer<const Self> itk::DisplacementFieldTransform< TScalar, NDimensions >::ConstPointer |
Definition at line 95 of file itkDisplacementFieldTransform.h.
typedef Superclass::DerivativeType itk::DisplacementFieldTransform< TScalar, NDimensions >::DerivativeType |
Derivative type
Definition at line 156 of file itkDisplacementFieldTransform.h.
typedef DisplacementFieldType::DirectionType itk::DisplacementFieldTransform< TScalar, NDimensions >::DirectionType |
Definition at line 174 of file itkDisplacementFieldTransform.h.
typedef DisplacementFieldType::ConstPointer itk::DisplacementFieldTransform< TScalar, NDimensions >::DisplacementFieldConstPointer |
Definition at line 164 of file itkDisplacementFieldTransform.h.
typedef DisplacementFieldType::Pointer itk::DisplacementFieldTransform< TScalar, NDimensions >::DisplacementFieldPointer |
Definition at line 163 of file itkDisplacementFieldTransform.h.
typedef Image<OutputVectorType, Dimension> itk::DisplacementFieldTransform< TScalar, NDimensions >::DisplacementFieldType |
Define the displacement field type and corresponding interpolator type.
Definition at line 162 of file itkDisplacementFieldTransform.h.
typedef DisplacementFieldType::IndexType itk::DisplacementFieldTransform< TScalar, NDimensions >::IndexType |
Standard types for the displacement Field
Definition at line 170 of file itkDisplacementFieldTransform.h.
typedef Superclass::InputCovariantVectorType itk::DisplacementFieldTransform< TScalar, NDimensions >::InputCovariantVectorType |
Standard covariant vector type for this class
Definition at line 135 of file itkDisplacementFieldTransform.h.
typedef Superclass::InputDiffusionTensor3DType itk::DisplacementFieldTransform< TScalar, NDimensions >::InputDiffusionTensor3DType |
Standard diffusion tensor type for this class
Definition at line 145 of file itkDisplacementFieldTransform.h.
typedef Superclass::InputPointType itk::DisplacementFieldTransform< TScalar, NDimensions >::InputPointType |
Standard coordinate point type for this class.
Definition at line 123 of file itkDisplacementFieldTransform.h.
typedef CovariantVector<ScalarType, InputDiffusionTensor3DType::Dimension> itk::DisplacementFieldTransform< TScalar, NDimensions >::InputTensorEigenVectorType |
Standard tensor type for this class
Definition at line 151 of file itkDisplacementFieldTransform.h.
typedef Superclass::InputVectorPixelType itk::DisplacementFieldTransform< TScalar, NDimensions >::InputVectorPixelType |
Definition at line 130 of file itkDisplacementFieldTransform.h.
typedef Superclass::InputVectorType itk::DisplacementFieldTransform< TScalar, NDimensions >::InputVectorType |
Standard vector type for this class.
Definition at line 127 of file itkDisplacementFieldTransform.h.
typedef Superclass::InputVnlVectorType itk::DisplacementFieldTransform< TScalar, NDimensions >::InputVnlVectorType |
Standard vnl_vector type for this class.
Definition at line 140 of file itkDisplacementFieldTransform.h.
typedef VectorInterpolateImageFunction<DisplacementFieldType, ScalarType> itk::DisplacementFieldTransform< TScalar, NDimensions >::InterpolatorType |
Definition at line 167 of file itkDisplacementFieldTransform.h.
typedef Superclass::InverseTransformBasePointer itk::DisplacementFieldTransform< TScalar, NDimensions >::InverseTransformBasePointer |
InverseTransform type.
Definition at line 101 of file itkDisplacementFieldTransform.h.
typedef Superclass::JacobianType itk::DisplacementFieldTransform< TScalar, NDimensions >::JacobianType |
Jacobian type.
Definition at line 114 of file itkDisplacementFieldTransform.h.
typedef Superclass::NumberOfParametersType itk::DisplacementFieldTransform< TScalar, NDimensions >::NumberOfParametersType |
The number of parameters defininig this transform.
Definition at line 120 of file itkDisplacementFieldTransform.h.
typedef ImageVectorOptimizerParametersHelper< ScalarType, OutputVectorType::Dimension, Dimension> itk::DisplacementFieldTransform< TScalar, NDimensions >::OptimizerParametersHelperType |
Define the internal parameter helper used to access the field
Definition at line 183 of file itkDisplacementFieldTransform.h.
typedef Superclass::OutputCovariantVectorType itk::DisplacementFieldTransform< TScalar, NDimensions >::OutputCovariantVectorType |
Definition at line 137 of file itkDisplacementFieldTransform.h.
typedef Superclass::OutputDiffusionTensor3DType itk::DisplacementFieldTransform< TScalar, NDimensions >::OutputDiffusionTensor3DType |
Definition at line 147 of file itkDisplacementFieldTransform.h.
typedef Superclass::OutputPointType itk::DisplacementFieldTransform< TScalar, NDimensions >::OutputPointType |
Definition at line 124 of file itkDisplacementFieldTransform.h.
typedef CovariantVector<ScalarType, OutputDiffusionTensor3DType::Dimension> itk::DisplacementFieldTransform< TScalar, NDimensions >::OutputTensorEigenVectorType |
Definition at line 153 of file itkDisplacementFieldTransform.h.
typedef Superclass::OutputVectorPixelType itk::DisplacementFieldTransform< TScalar, NDimensions >::OutputVectorPixelType |
Definition at line 131 of file itkDisplacementFieldTransform.h.
typedef Superclass::OutputVectorType itk::DisplacementFieldTransform< TScalar, NDimensions >::OutputVectorType |
Definition at line 128 of file itkDisplacementFieldTransform.h.
typedef Superclass::OutputVnlVectorType itk::DisplacementFieldTransform< TScalar, NDimensions >::OutputVnlVectorType |
Definition at line 141 of file itkDisplacementFieldTransform.h.
typedef Superclass::ParametersType itk::DisplacementFieldTransform< TScalar, NDimensions >::ParametersType |
Type of the input parameters.
Definition at line 110 of file itkDisplacementFieldTransform.h.
typedef Superclass::ParametersValueType itk::DisplacementFieldTransform< TScalar, NDimensions >::ParametersValueType |
Definition at line 111 of file itkDisplacementFieldTransform.h.
typedef DisplacementFieldType::PixelType itk::DisplacementFieldTransform< TScalar, NDimensions >::PixelType |
Definition at line 176 of file itkDisplacementFieldTransform.h.
typedef SmartPointer<Self> itk::DisplacementFieldTransform< TScalar, NDimensions >::Pointer |
Definition at line 94 of file itkDisplacementFieldTransform.h.
typedef DisplacementFieldType::PointType itk::DisplacementFieldTransform< TScalar, NDimensions >::PointType |
Definition at line 175 of file itkDisplacementFieldTransform.h.
typedef DisplacementFieldType::RegionType itk::DisplacementFieldTransform< TScalar, NDimensions >::RegionType |
Definition at line 171 of file itkDisplacementFieldTransform.h.
typedef Superclass::ScalarType itk::DisplacementFieldTransform< TScalar, NDimensions >::ScalarType |
Scalar type.
Definition at line 107 of file itkDisplacementFieldTransform.h.
typedef DisplacementFieldTransform itk::DisplacementFieldTransform< TScalar, NDimensions >::Self |
Standard class typedefs.
Definition at line 92 of file itkDisplacementFieldTransform.h.
typedef DisplacementFieldType::SizeType itk::DisplacementFieldTransform< TScalar, NDimensions >::SizeType |
Definition at line 172 of file itkDisplacementFieldTransform.h.
typedef DisplacementFieldType::SpacingType itk::DisplacementFieldTransform< TScalar, NDimensions >::SpacingType |
Definition at line 173 of file itkDisplacementFieldTransform.h.
typedef Transform<TScalar, NDimensions, NDimensions> itk::DisplacementFieldTransform< TScalar, NDimensions >::Superclass |
Definition at line 93 of file itkDisplacementFieldTransform.h.
typedef Superclass::TransformCategoryType itk::DisplacementFieldTransform< TScalar, NDimensions >::TransformCategoryType |
Transform category type.
Definition at line 117 of file itkDisplacementFieldTransform.h.
|
protected |
|
protectedvirtual |
|
private |
|
virtual |
Compute the jacobian with respect to the position, by point. j
will be resized as needed.
|
inlinevirtual |
Compute the jacobian with respect to the parameters at a point. Simply returns identity matrix, sized [NDimensions, NDimensions].
T(x, p), x is the position, p is the local parameter at position x. Take a 2D example, x = (x0, x1), p = (p0, p1) and T(x, p) is defined as:
T(x, p) = (T0, T1) = (x0+p0, x1+p1)
Each local deformation is defined as a translation transform. So the Jacobian w.r.t parameters are
dT/dp = [ dT0/dp0, dT0/dp1; dT1/dp0, dT1/dp1 ];
= [1, 0; 0, 1];
TODO: format the above for doxygen formula.
Definition at line 326 of file itkDisplacementFieldTransform.h.
References itk::DisplacementFieldTransform< TScalar, NDimensions >::m_IdentityJacobian.
|
inlinevirtual |
Compute the jacobian with respect to the parameters at an index. Simply returns identity matrix, sized [NDimensions, NDimensions]. See ComputeJacobianWithRespectToParameters
( InputPointType, ... ) for rationale.
Definition at line 339 of file itkDisplacementFieldTransform.h.
References itk::DisplacementFieldTransform< TScalar, NDimensions >::m_IdentityJacobian.
|
virtual |
Compute the jacobian with respect to the position, by point. j
will be resized as needed.
|
virtual |
Compute the jacobian with respect to the position, by index. j
will be resized as needed.
|
privatevirtual |
Internal method for calculating either forward or inverse jacobian, depending on state of doInverseJacobian
. Used by public methods ComputeJacobianWithRespectToPosition
and GetInverseJacobianOfForwardFieldWithRespectToPosition
to perform actual work. doInverseJacobian
indicates that the inverse jacobian should be returned
|
virtual |
Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.
Reimplemented from itk::Object.
Reimplemented in itk::TimeVaryingBSplineVelocityFieldTransform< TScalar, NDimensions >, itk::GaussianExponentialDiffeomorphicTransform< TScalar, NDimensions >, itk::TimeVaryingVelocityFieldTransform< TScalar, NDimensions >, itk::GaussianSmoothingOnUpdateDisplacementFieldTransform< TScalar, NDimensions >, itk::GaussianSmoothingOnUpdateTimeVaryingVelocityFieldTransform< TScalar, NDimensions >, and itk::VelocityFieldTransform< TScalar, NDimensions >.
|
virtual |
Get/Set the displacement field. Set the displacement field. Create special set accessor to update interpolator and assign displacement field to transform parameters container.
|
virtual |
Get the modification time of displacement field
|
virtual |
Get/Set the interpolator. Create out own set accessor that assigns the displacement field
bool itk::DisplacementFieldTransform< TScalar, NDimensions >::GetInverse | ( | Self * | inverse | ) | const |
Return an inverse of this transform. Note that the inverse displacement field must be set by the user.
|
virtual |
Get/Set the inverse displacement field. This must be supplied by the user for GetInverse() to work.
|
virtual |
Get/Set the interpolator for the inverse field. Create out own set accessor that assigns the displacement field
|
virtual |
Compute the inverse jacobian of the forward displacement field with respect to the position, by point. Note that this is different than the jacobian of the inverse displacement field. This takes advantage of the ability to compute the inverse jacobian of a displacement field by simply reversing the sign of the forward jacobian. However, a more accurate method for computing the inverse jacobian is to take the inverse of the jacobian matrix. This method is more computationally expensive and may be used by setting useSVD
to true
|
virtual |
Compute the inverse jacobian of the forward displacement field with respect to the position, by index.Note that this is different than the jacobian of the inverse displacement field. This takes advantage of the ability to compute the inverse jacobian of a displacement field by simply reversing the sign of the forward jacobian. However, a more accurate method for computing the inverse jacobian is to take the inverse of the jacobian matrix. This method is more computationally expensive and may be used by setting useSVD
to true
|
virtual |
Return an inverse of this transform. Note that the inverse displacement field must be set by the user.
Reimplemented from itk::Transform< TScalar, NDimensions, NDimensions >.
Reimplemented in itk::VelocityFieldTransform< TScalar, NDimensions >, and itk::ConstantVelocityFieldTransform< TScalar, NDimensions >.
|
virtual |
Get/Set the displacement field. Set the displacement field. Create special set accessor to update interpolator and assign displacement field to transform parameters container.
|
virtual |
Get/Set the interpolator. Create out own set accessor that assigns the displacement field
|
virtual |
Get/Set the inverse displacement field. This must be supplied by the user for GetInverse() to work.
|
virtual |
Get/Set the interpolator for the inverse field. Create out own set accessor that assigns the displacement field
|
virtual |
Run-time type information (and related methods).
Reimplemented from itk::Transform< TScalar, NDimensions, NDimensions >.
Reimplemented in itk::TimeVaryingBSplineVelocityFieldTransform< TScalar, NDimensions >, itk::GaussianExponentialDiffeomorphicTransform< TScalar, NDimensions >, itk::BSplineExponentialDiffeomorphicTransform< TScalar, NDimensions >, itk::TimeVaryingVelocityFieldTransform< TScalar, NDimensions >, itk::BSplineSmoothingOnUpdateDisplacementFieldTransform< TScalar, NDimensions >, itk::GaussianSmoothingOnUpdateDisplacementFieldTransform< TScalar, NDimensions >, itk::GaussianSmoothingOnUpdateTimeVaryingVelocityFieldTransform< TScalar, NDimensions >, itk::ConstantVelocityFieldTransform< TScalar, NDimensions >, and itk::VelocityFieldTransform< TScalar, NDimensions >.
|
inlinevirtual |
Return the number of local parameters that completely defines the Transform at an individual voxel. For transforms with local support, this will enable downstream computation of the jacobian wrt only the local support region. For instance, in the case of a deformation field, this will be equal to the number of image dimensions. If it is an affine transform, this will be the same as the GetNumberOfParameters().
Reimplemented from itk::Transform< TScalar, NDimensions, NDimensions >.
Definition at line 410 of file itkDisplacementFieldTransform.h.
References itk::DisplacementFieldTransform< TScalar, NDimensions >::Dimension.
|
inlinevirtual |
This transform is not linear.
Reimplemented from itk::Transform< TScalar, NDimensions, NDimensions >.
Definition at line 405 of file itkDisplacementFieldTransform.h.
References itk::TransformBaseTemplate< TScalar >::DisplacementField.
|
static |
New macro for creation of through a Smart Pointer
|
private |
|
protectedvirtual |
Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from itk::Object.
Reimplemented in itk::VelocityFieldTransform< TScalar, NDimensions >, itk::TimeVaryingBSplineVelocityFieldTransform< TScalar, NDimensions >, itk::GaussianExponentialDiffeomorphicTransform< TScalar, NDimensions >, itk::GaussianSmoothingOnUpdateTimeVaryingVelocityFieldTransform< TScalar, NDimensions >, and itk::GaussianSmoothingOnUpdateDisplacementFieldTransform< TScalar, NDimensions >.
|
virtual |
Get/Set the displacement field. Set the displacement field. Create special set accessor to update interpolator and assign displacement field to transform parameters container.
Reimplemented in itk::VelocityFieldTransform< TScalar, NDimensions >.
|
virtual |
This method sets the fixed parameters of the transform. For a displacement field transform, the fixed parameters are the following: field size, field origin, field spacing, and field direction.
Note: If a displacement field already exists, this function creates a new one with zero displacement (identity transform). If an inverse displacement field exists, a new one is also created.
Implements itk::Transform< TScalar, NDimensions, NDimensions >.
Reimplemented in itk::ConstantVelocityFieldTransform< TScalar, NDimensions >, and itk::VelocityFieldTransform< TScalar, NDimensions >.
|
privatevirtual |
Convenience method which reads the information from the current displacement field into m_FixedParameters.
|
virtual |
Get/Set the interpolator. Create out own set accessor that assigns the displacement field
|
virtual |
Get/Set the inverse displacement field. This must be supplied by the user for GetInverse() to work.
|
virtual |
Get/Set the interpolator for the inverse field. Create out own set accessor that assigns the displacement field
|
inlinevirtual |
Set the transformation parameters. This sets the displacement field image directly.
Implements itk::Transform< TScalar, NDimensions, NDimensions >.
Definition at line 277 of file itkDisplacementFieldTransform.h.
References itk::Transform< TScalar, NDimensions, NDimensions >::m_Parameters, itk::Object::Modified(), and itk::Array< TValue >::Size().
|
inlinevirtual |
Definition at line 260 of file itkDisplacementFieldTransform.h.
|
inlinevirtual |
Definition at line 268 of file itkDisplacementFieldTransform.h.
|
inline |
Definition at line 243 of file itkDisplacementFieldTransform.h.
|
inline |
Definition at line 251 of file itkDisplacementFieldTransform.h.
|
virtual |
Method to transform a point. Out-of-bounds points will be returned with zero displacemnt.
|
inlinevirtual |
Definition at line 221 of file itkDisplacementFieldTransform.h.
|
inlinevirtual |
Definition at line 228 of file itkDisplacementFieldTransform.h.
|
inlinevirtual |
Definition at line 235 of file itkDisplacementFieldTransform.h.
|
virtual |
|
privatevirtual |
Internal method to check that the inverse and forward displacement fields have the same fixed parameters.
|
static |
Dimension of the domain spaces.
Definition at line 159 of file itkDisplacementFieldTransform.h.
Referenced by itk::DisplacementFieldTransform< TScalar, NDimensions >::GetNumberOfLocalParameters().
|
protected |
The displacement field and its inverse (if it exists).
Definition at line 422 of file itkDisplacementFieldTransform.h.
|
protected |
Track when the displacement field was last set/assigned, as distinct from when it may have had its contents modified.
Definition at line 431 of file itkDisplacementFieldTransform.h.
|
protected |
Create an identity jacobian for use in ComputeJacobianWithRespectToParameters.
Definition at line 435 of file itkDisplacementFieldTransform.h.
Referenced by itk::DisplacementFieldTransform< TScalar, NDimensions >::ComputeJacobianWithRespectToParameters().
|
protected |
The interpolator.
Definition at line 426 of file itkDisplacementFieldTransform.h.
|
protected |
Definition at line 423 of file itkDisplacementFieldTransform.h.
|
protected |
Definition at line 427 of file itkDisplacementFieldTransform.h.