NifTK
16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
|
Base class for deformable transforms. More...
Public Types | |
typedef DeformableTransform | Self |
typedef Transform< TScalarType, NDimensions, NDimensions > | Superclass |
typedef SmartPointer< Self > | Pointer |
typedef SmartPointer< const Self > | ConstPointer |
typedef Superclass::ScalarType | ScalarType |
typedef Superclass::NumberOfParametersType | NumberOfParametersType |
typedef Superclass::ParametersType | ParametersType |
typedef Superclass::ParametersValueType | ParametersValueType |
typedef Array < ParametersValueType > | DerivativeType |
typedef Superclass::OutputPointType | OutputPointType |
typedef Superclass::InputPointType | InputPointType |
typedef Superclass::InputVectorType | InputVectorType |
typedef Superclass::OutputVectorType | OutputVectorType |
typedef Superclass::InputCovariantVectorType | InputCovariantVectorType |
typedef Superclass::OutputCovariantVectorType | OutputCovariantVectorType |
typedef Superclass::InputVnlVectorType | InputVnlVectorType |
typedef Superclass::OutputVnlVectorType | OutputVnlVectorType |
typedef Vector < TDeformationScalar, NDimensions > | VectorFieldPixelType |
typedef Image < VectorFieldPixelType, NDimensions > | VectorFieldImageType |
typedef VectorFieldImageType::Pointer | VectorFieldImagePointer |
typedef VectorFieldImageType::SizeType | VectorFieldSizeType |
typedef ImageRegionIterator < VectorFieldImageType > | VectorFieldIteratorType |
typedef ImageRegionConstIterator < VectorFieldImageType > | VectorFieldConstIteratorType |
typedef VectorFieldPixelType | DeformationFieldPixelType |
typedef VectorFieldImageType | DeformationFieldType |
typedef DeformationFieldType::Pointer | DeformationFieldPointer |
typedef ImageRegion< NDimensions > | DeformationFieldRegionType |
typedef DeformationFieldRegionType::IndexType | DeformationFieldIndexType |
typedef DeformationFieldRegionType::SizeType | DeformationFieldSizeType |
typedef DeformationFieldType::SpacingType | DeformationFieldSpacingType |
typedef DeformationFieldType::DirectionType | DeformationFieldDirectionType |
typedef DeformationFieldType::PointType | DeformationFieldOriginType |
typedef Image < TDeformationScalar, NDimensions > | DeformationFieldComponentImageType |
typedef TFixedImage | FixedImageType |
typedef FixedImageType::ConstPointer | FixedImagePointer |
typedef Transform< TScalarType, itkGetStaticConstMacro(SpaceDimension), itkGetStaticConstMacro(SpaceDimension)> | GlobalTransformType |
typedef GlobalTransformType::ConstPointer | GlobalTransformPointer |
typedef DisplacementFieldJacobianDeterminantFilter < DeformationFieldType, TScalarType > | JacobianDeterminantFilterType |
typedef JacobianDeterminantFilterType::Pointer | JacobianDeterminantFilterPointer |
typedef Superclass::JacobianType | JacobianType |
Protected Member Functions | |
DeformableTransform () | |
virtual | ~DeformableTransform () |
void | PrintSelf (std::ostream &os, Indent indent) const |
unsigned long int | GetNumberOfParametersImpliedByImage (const VectorFieldImagePointer image) |
void | ResizeParametersArray (const VectorFieldImagePointer image) |
void | MarshallParametersToImage (VectorFieldImagePointer image) |
void | MarshallImageToParameters (const VectorFieldImagePointer image, ParametersType ¶meters) |
virtual JacobianDeterminantFilterType::OutputImageRegionType | GetValidJacobianRegion () const |
Protected Attributes | |
DeformationFieldType::Pointer | m_DeformationField |
GlobalTransformPointer | m_GlobalTransform |
JacobianDeterminantFilterPointer | m_JacobianFilter |
double | m_InverseSearchRadius |
double | m_InverseVoxelTolerance |
double | m_InverseIterationTolerance |
double | m_MaxNumberOfInverseIterations |
DeformationFieldComponentImageType::Pointer | m_DeformationFieldComponent [NDimensions] |
Base class for deformable transforms.
For both UCLBSplineTransform and FluidDeformableTransform, the transformation is represented as an image of vectors, one vector per voxel. Its parameterisation depends on derived classes. So, for Fluid, you are actually working at the voxel level, and for BSpline/FFD based transformation, the transformation is parameterized by the control point grid, and interpolated to each voxel.
The optimizer API requires SetParameters() and GetParameters(). So, this class provides protected utility methods GetNumberOfParametersImpliedByImage, ResizeParametersArray and MarshallParametersToImage to marshall parameters from the array representation to an image. In both cases, the transformation owns its internal parameter array, and should be responsible for resizing it, and deciding if its the right size.
Don't forget that even though the transformation owns its internal parameter array, such that GetParameters returns a reference to the parameters contained herein, the optimizer class provides new parameters arrays throughout the optimisation. This means that when the optimizer calls transform->SetParameters(¶meters), then the argument is passed by reference, and the parameters are copied to the parameters array within this class.
This class also provides a Global transform. This can be any parametric transform using the standard ITK Transform class hierarchy. If this has been set then calling TransformPoint will multiply the point by the Global transform (for example an affine one), and then add the deformation vector onto the point.
TODO: We haven't tested this Global transform. I think you would actually need to interpolate the vector field. So, in most cases, you are better off sorting out your affine transform, resampling, and then just doing deformable stuff on pre-registered images.
typedef SmartPointer<const Self> itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::ConstPointer |
typedef Image<TDeformationScalar, NDimensions> itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::DeformationFieldComponentImageType |
typedef DeformationFieldType::DirectionType itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::DeformationFieldDirectionType |
typedef DeformationFieldRegionType::IndexType itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::DeformationFieldIndexType |
typedef DeformationFieldType::PointType itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::DeformationFieldOriginType |
typedef VectorFieldPixelType itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::DeformationFieldPixelType |
Both Fluid and FFD will represent the deformation field as a vector at each point in an image.
typedef DeformationFieldType::Pointer itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::DeformationFieldPointer |
typedef ImageRegion<NDimensions> itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::DeformationFieldRegionType |
typedef DeformationFieldRegionType::SizeType itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::DeformationFieldSizeType |
typedef DeformationFieldType::SpacingType itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::DeformationFieldSpacingType |
typedef VectorFieldImageType itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::DeformationFieldType |
typedef Array<ParametersValueType> itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::DerivativeType |
typedef FixedImageType::ConstPointer itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::FixedImagePointer |
typedef TFixedImage itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::FixedImageType |
The deformation field is defined over the fixed image.
typedef GlobalTransformType::ConstPointer itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::GlobalTransformPointer |
typedef Transform<TScalarType, itkGetStaticConstMacro(SpaceDimension), itkGetStaticConstMacro(SpaceDimension)> itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::GlobalTransformType |
Typedef of the bulk transform, i.e. we set up an affine transform.
typedef Superclass::InputCovariantVectorType itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::InputCovariantVectorType |
Standard covariant vector type for this class
typedef Superclass::InputPointType itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::InputPointType |
typedef Superclass::InputVectorType itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::InputVectorType |
Standard vector type for this class.
typedef Superclass::InputVnlVectorType itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::InputVnlVectorType |
Standard vnl_vector type for this class.
typedef JacobianDeterminantFilterType::Pointer itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::JacobianDeterminantFilterPointer |
typedef DisplacementFieldJacobianDeterminantFilter< DeformationFieldType, TScalarType > itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::JacobianDeterminantFilterType |
Typedef for Jacobian Calculator.
typedef Superclass::JacobianType itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::JacobianType |
typedef Superclass::NumberOfParametersType itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::NumberOfParametersType |
Standard parameters container.
typedef Superclass::OutputCovariantVectorType itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::OutputCovariantVectorType |
typedef Superclass::OutputPointType itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::OutputPointType |
Standard coordinate point type for this class.
typedef Superclass::OutputVectorType itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::OutputVectorType |
typedef Superclass::OutputVnlVectorType itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::OutputVnlVectorType |
typedef Superclass::ParametersType itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::ParametersType |
typedef Superclass::ParametersValueType itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::ParametersValueType |
typedef SmartPointer<Self> itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::Pointer |
typedef Superclass::ScalarType itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::ScalarType |
Standard scalar type for this class.
typedef DeformableTransform itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::Self |
Standard class typedefs.
typedef Transform< TScalarType, NDimensions, NDimensions > itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::Superclass |
typedef ImageRegionConstIterator<VectorFieldImageType> itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::VectorFieldConstIteratorType |
typedef VectorFieldImageType::Pointer itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::VectorFieldImagePointer |
typedef Image< VectorFieldPixelType, NDimensions > itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::VectorFieldImageType |
typedef ImageRegionIterator<VectorFieldImageType> itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::VectorFieldIteratorType |
typedef Vector< TDeformationScalar, NDimensions > itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::VectorFieldPixelType |
These are so we can marshall parameters into an image of either control points, or voxels.
typedef VectorFieldImageType::SizeType itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::VectorFieldSizeType |
|
protected |
|
protectedvirtual |
|
inlinevirtual |
TScalarType itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::ComputeMaxDeformation | ( | ) |
Actually run through the deformation field, and calculate the max deformation. This is the maximum magnitude of a deformation vector (not of the individual component in x,y,z).
TScalarType itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::ComputeMaxJacobian | ( | ) |
Actually run through the deformation field, and calculate the max jacobian.
TScalarType itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::ComputeMinDeformation | ( | ) |
Actually run through the deformation field, and calculate the min deformation. This is the minimum magnitude of a deformation vector (not of the individual component in x,y,z).
TScalarType itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::ComputeMinJacobian | ( | ) |
Actually run through the deformation field, and calculate the min jacobian.
void itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::ConcatenateAfterGivenTransform | ( | Self * | givenTransform | ) |
Concatenate the current deformation field after the given deformation field
void itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::ExtractComponents | ( | ) |
Extract the x, y, z components of the vector deformation field into 3 images.
|
virtual |
Run-time type information (and related methods).
Reimplemented in itk::UCLBSplineTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >, and itk::FluidDeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >.
|
inlinevirtual |
Get the deformation field pointer.
|
virtual |
Get the fixed parameters for saving.
Reimplemented in itk::UCLBSplineTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >.
|
virtual |
bool itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::GetInverse | ( | Self * | inverse | ) | const |
Create inverse of a deformable transformation according to Methods for inverting dense displacement fields: Evaluation in brain image registration, Crum et al, MICCAI, 2007.
|
virtual |
|
inline |
Get the Jacobian image.
|
inlinevirtual |
Return the number of parameters that completely define the Transfom
|
protected |
Works out the number of parameters implied by the image.
|
inlinevirtual |
Return the transformation parameters.
TScalarType itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::GetSumLogJacobianDeterminant | ( | ) |
Calculate the log of the jacobian determinant at each voxel.
|
inlineprotectedvirtual |
To get the valid Jacobian region - because for fluid Diriac boundary condition - the deformation around the edge is 0.
Reimplemented in itk::FluidDeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >.
void itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::InitialiseGlobalTransformation | ( | ) |
Iniitilise the deformation field with the global transformation.
void itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::Initialize | ( | FixedImagePointer | image | ) |
Convenience method to set up internal deformation field to the same size as the supplied image. In this method, we can't set up a corresponding m_Parameters array, as different subclasses will have different requirements.
void itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::InvertUsingIterativeFixedPoint | ( | typename Self::Pointer | invertedTransform, |
int | maxIterations, | ||
int | maxOuterIterations, | ||
double | tol | ||
) |
Invert using fixed point iteration.
Recommended values: maxIterations=30 maxOuterIterations=5 tol=0.001
|
virtual |
Returns true if we are currently equal to Identity transform.
Reimplemented in itk::FluidDeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >.
|
inlinevirtual |
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)
|
inlinevirtual |
Return true if the deformable is regriddable. This then requires the implementation the Regrid function.
Reimplemented in itk::FluidDeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >.
itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::itkStaticConstMacro | ( | SpaceDimension | , |
unsigned | int, | ||
NDimensions | |||
) |
Dimension of the domain space.
|
protected |
To Convert image to parameters array.
|
protected |
To Convert parameters array to an image.
|
protected |
Print contents of an FluidDeformableTransform.
void itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::ReadMidasStrImage | ( | std::string | filename, |
int | origin[NDimensions], | ||
typename TFixedImage::RegionType | paddedDesiredRegion, | ||
typename JacobianDeterminantFilterType::OutputImageType * | jacobianImage | ||
) |
Write the Midas jacobian image of the deformation field out to the given filename.
|
protected |
Makes the parameters array match the size of the image, and resets everything.
|
virtual |
Set the fixed paramters for loading
Reimplemented in itk::UCLBSplineTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >.
|
virtual |
This method specifies the bulk transform to be applied.
|
virtual |
Set the parameters array to Identity. Doesn't affect the Global transform. Doesn't resize anything either.
Reimplemented in itk::UCLBSplineTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >, and itk::FluidDeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >.
|
virtual |
Set/Get the search radius (voxel unit) for computing the inverse.
|
inlinevirtual |
Set the transformation parameters.
Reimplemented in itk::UCLBSplineTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >, and itk::FluidDeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >.
|
virtual |
Sets the transformation parameters from an image. The parameter 'force' is to force parameter array to the right size. If force is false, and the parameters array is the wrong size, an exception is thrown. If force is true, the parameters array is resized.
|
inline |
Call to set the Jacobian calculation to be using the forward difference. This function should be called immediately after constructing the deformable transform.
|
inlinevirtual |
Method to transform a CovariantVector - not applicable for this type of transform
|
virtual |
Declared virtual in base class, transform points
Reimplemented in itk::UCLBSplineTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >.
|
inlinevirtual |
Method to transform a vector - not applicable for this type of transform.
|
inlinevirtual |
Method to transform a vnl_vector - not applicable for this type of transform
|
inlinevirtual |
Regrid and compose the new regridded deformation
void itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::WriteJacobianImage | ( | std::string | filename | ) |
Write the jacobian image of the deformation field out to the given filename.
void itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::WriteMidasStrImage | ( | std::string | filename, |
int | origin[NDimensions], | ||
typename TFixedImage::RegionType | paddedDesiredRegion, | ||
const typename JacobianDeterminantFilterType::OutputImageType * | jacobianImage | ||
) |
Write the Midas jacobian image of the deformation field out to the given filename.
void itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::WriteMidasVecImage | ( | std::string | filename, |
int | origin[NDimensions], | ||
typename TFixedImage::RegionType | paddedDesiredRegion | ||
) |
Write the Midas vector image of the deformation field out to the given filename.
|
inlinevirtual |
Write parameters, so subclass can override if necessary. Default implementation is suitable for Fluid.
Reimplemented in itk::UCLBSplineTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >.
|
inlinevirtual |
Write transform, so subclass can override it if necessary. Default implementation is suitable for Fluid.
void itk::DeformableTransform< TFixedImage, TScalarType, NDimensions, TDeformationScalar >::WriteVectorImage | ( | std::string | filename | ) |
Write the vector image of the deformation field out to the given filename.
|
protected |
The deformation/displacement field, represented as an image.
|
protected |
Hold the x, y, z components of the deformation field.
|
protected |
The global transform.
|
protected |
Tolerance for checking in the iteration if the forward transformation is close to the source image grid.
|
protected |
Search radius for calculating the inverse transformation
|
protected |
Tolerance for checking if the forward transformation hits the source image grid.
|
protected |
Jacobian Filter. Currently no need to expose this publically, so no Setter/Getter.
|
protected |
Maximum number of iteration in the inverse computaion.