#include <itkAdvancedBSplineDeformableTransform.h>
Deformable transform using a B-spline representation.
This class encapsulates a deformable transform of points from one N-dimensional one space to another N-dimensional space. The deformation field is modeled using B-splines. A deformation is defined on a sparse regular grid of control points and is varied by defining a deformation of each control point. The deformation at any point is obtained by using a B-spline interpolation kernel.
The deformation field grid is defined by a user specified GridRegion, GridSpacing and GridOrigin. Each grid/control point has associated with it N deformation coefficients , representing the N directional components of the deformation. Deformation outside the grid plus support region for the B-spline interpolation is assumed to be zero.
Additionally, the user can specified an addition bulk transform such that the transformed point is given by:
The parameters for this transform is N x N-D grid of spline coefficients. The user specifies the parameters as one flat array: each N-D grid is represented by an array in the same way an N-D image is represented in the buffer; the N arrays are then concatentated together on form a single array.
For efficiency, this transform does not make a copy of the parameters. It only keeps a pointer to the input parameters and assumes that the memory is managed by the caller.
The following illustrates the typical usage of this class:
* typedef AdvancedBSplineDeformableTransform<double,2,3> TransformType; * auto transform = TransformType::New(); * * transform->SetGridRegion( region ); * transform->SetGridSpacing( spacing ); * transform->SetGridOrigin( origin ); * * // NB: the region must be set first before setting the parameters * * TransformType::ParametersType parameters( * transform->GetNumberOfParameters() ); * * // Fill the parameters with values * * transform->SetParameters( parameters ) * * outputPoint = transform->TransformPoint( inputPoint ); * *
An alternative way to set the B-spline coefficients is via array of images. The grid region, spacing and origin information is taken directly from the first image. It is assumed that the subsequent images are the same buffered region. The following illustrates the API:
* * TransformType::ImageConstPointer images[2]; * * // Fill the images up with values * * transform->SetCoefficientImages( images ); * outputPoint = transform->TransformPoint( inputPoint ); * *
Warning: use either the SetParameters() or SetCoefficientImages() API. Mixing the two modes may results in unexpected results.
The class is templated coordinate representation type (float or double), the space dimension and the spline order.
Definition at line 132 of file itkAdvancedBSplineDeformableTransform.h.
Public Member Functions | |
void | EvaluateJacobianWithImageGradientProduct (const InputPointType &inputPoint, const MovingImageGradientType &movingImageGradient, DerivativeType &imageJacobian, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const override |
virtual const char * | GetClassName () const |
void | GetJacobian (const InputPointType &inputPoint, JacobianType &j, NonZeroJacobianIndicesType &nzji) const override |
void | GetJacobianOfSpatialHessian (const InputPointType &inputPoint, JacobianOfSpatialHessianType &jsh, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const override |
void | GetJacobianOfSpatialHessian (const InputPointType &inputPoint, SpatialHessianType &sh, JacobianOfSpatialHessianType &jsh, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const override |
void | GetJacobianOfSpatialJacobian (const InputPointType &inputPoint, JacobianOfSpatialJacobianType &jsj, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const override |
void | GetJacobianOfSpatialJacobian (const InputPointType &inputPoint, SpatialJacobianType &sj, JacobianOfSpatialJacobianType &jsj, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const override |
unsigned int | GetNumberOfAffectedWeights () const override |
NumberOfParametersType | GetNumberOfNonZeroJacobianIndices () const override |
void | GetSpatialHessian (const InputPointType &inputPoint, SpatialHessianType &sh) const override |
void | GetSpatialJacobian (const InputPointType &inputPoint, SpatialJacobianType &sj) const override |
ITK_DISALLOW_COPY_AND_MOVE (AdvancedBSplineDeformableTransform) | |
itkStaticConstMacro (SpaceDimension, unsigned int, NDimensions) | |
itkStaticConstMacro (SplineOrder, unsigned int, VSplineOrder) | |
void | SetGridRegion (const RegionType ®ion) override |
OutputPointType | TransformPoint (const InputPointType &point) const override |
Public Member Functions inherited from itk::AdvancedBSplineDeformableTransformBase< double, 3 > | |
virtual const ImagePointer * | GetCoefficientImages () const |
const FixedParametersType & | GetFixedParameters () const override |
virtual DirectionType | GetGridDirection () const |
virtual OriginType | GetGridOrigin () const |
virtual RegionType | GetGridRegion () const |
virtual SpacingType | GetGridSpacing () const |
NumberOfParametersType | GetNumberOfParameters () const override |
virtual NumberOfParametersType | GetNumberOfParametersPerDimension () const |
const ParametersType & | GetParameters () const override |
unsigned | GetSplineOrder () const |
TransformCategoryEnum | GetTransformCategory () const override |
virtual const RegionType & | GetValidRegion () |
bool | IsLinear () const override |
ITK_DISALLOW_COPY_AND_MOVE (AdvancedBSplineDeformableTransformBase) | |
itkStaticConstMacro (SpaceDimension, unsigned int, NDimensions) | |
virtual void | SetCoefficientImages (ImagePointer images[]) |
void | SetFixedParameters (const FixedParametersType ¶meters) override |
virtual void | SetGridDirection (const DirectionType &direction) |
virtual void | SetGridOrigin (const OriginType &origin) |
virtual void | SetGridSpacing (const SpacingType &spacing) |
void | SetIdentity () |
void | SetParameters (const ParametersType ¶meters) override |
void | SetParametersByValue (const ParametersType ¶meters) override |
OutputCovariantVectorType | TransformCovariantVector (const InputCovariantVectorType &) const override |
OutputVectorType | TransformVector (const InputVectorType &) const override |
OutputVnlVectorType | TransformVector (const InputVnlVectorType &) const override |
Public Member Functions inherited from itk::AdvancedTransform< double, NDimensions, NDimensions > | |
void | ComputeJacobianWithRespectToParameters (const InputPointType &, JacobianType &) const override |
virtual bool | GetHasNonZeroJacobianOfSpatialHessian () const |
virtual bool | GetHasNonZeroSpatialHessian () const |
ITK_DISALLOW_COPY_AND_MOVE (AdvancedTransform) | |
itkStaticConstMacro (InputSpaceDimension, unsigned int, NInputDimensions) | |
itkStaticConstMacro (OutputSpaceDimension, unsigned int, NOutputDimensions) | |
Static Public Member Functions | |
static Pointer | New () |
Static Public Member Functions inherited from itk::AdvancedBSplineDeformableTransformBase< double, 3 > | |
static Pointer | Create (const unsigned splineOrder) |
Static Public Attributes | |
static constexpr unsigned | NumberOfWeights = WeightsFunctionType::NumberOfWeights |
Static Public Attributes inherited from itk::AdvancedBSplineDeformableTransformBase< double, 3 > | |
static constexpr unsigned int | NumberOfFixedParameters |
Protected Types | |
using | JacobianImageType |
using | JacobianPixelType |
Protected Types inherited from itk::AdvancedBSplineDeformableTransformBase< double, 3 > | |
using | JacobianImageType |
using | JacobianPixelType |
Friends | |
class | MultiBSplineDeformableTransformWithNormal< ScalarType, Self::SpaceDimension, VSplineOrder > |
using itk::AdvancedBSplineDeformableTransform< TScalarType, NDimensions, VSplineOrder >::ConstPointer = SmartPointer<const Self> |
Definition at line 142 of file itkAdvancedBSplineDeformableTransform.h.
using itk::AdvancedBSplineDeformableTransform< TScalarType, NDimensions, VSplineOrder >::ContinuousIndexType = typename WeightsFunctionType::ContinuousIndexType |
Definition at line 208 of file itkAdvancedBSplineDeformableTransform.h.
using itk::AdvancedBSplineDeformableTransform< TScalarType, NDimensions, VSplineOrder >::DerivativeWeightsFunctionPointer = typename DerivativeWeightsFunctionType::Pointer |
Definition at line 211 of file itkAdvancedBSplineDeformableTransform.h.
using itk::AdvancedBSplineDeformableTransform< TScalarType, NDimensions, VSplineOrder >::DerivativeWeightsFunctionType |
Definition at line 209 of file itkAdvancedBSplineDeformableTransform.h.
using itk::AdvancedBSplineDeformableTransformBase< TScalarType, NDimensions >::DirectionType |
Definition at line 229 of file itkAdvancedBSplineDeformableTransformBase.h.
using itk::AdvancedBSplineDeformableTransformBase< TScalarType, NDimensions >::GridOffsetType |
Definition at line 231 of file itkAdvancedBSplineDeformableTransformBase.h.
using itk::AdvancedBSplineDeformableTransformBase< TScalarType, NDimensions >::ImagePointer |
Definition at line 200 of file itkAdvancedBSplineDeformableTransformBase.h.
using itk::AdvancedBSplineDeformableTransformBase< TScalarType, NDimensions >::ImageType |
Definition at line 199 of file itkAdvancedBSplineDeformableTransformBase.h.
using itk::AdvancedBSplineDeformableTransformBase< TScalarType, NDimensions >::IndexType |
Definition at line 226 of file itkAdvancedBSplineDeformableTransformBase.h.
|
protected |
Definition at line 402 of file itkAdvancedBSplineDeformableTransformBase.h.
|
protected |
Jacobian as SpaceDimension number of images.
Definition at line 401 of file itkAdvancedBSplineDeformableTransformBase.h.
using itk::AdvancedBSplineDeformableTransformBase< TScalarType, NDimensions >::OriginType |
Definition at line 230 of file itkAdvancedBSplineDeformableTransformBase.h.
using itk::AdvancedBSplineDeformableTransformBase< TScalarType, NDimensions >::ParameterIndexArrayType |
Parameter index array type.
Definition at line 258 of file itkAdvancedBSplineDeformableTransformBase.h.
using itk::AdvancedBSplineDeformableTransform< TScalarType, NDimensions, VSplineOrder >::Pointer = SmartPointer<Self> |
Definition at line 141 of file itkAdvancedBSplineDeformableTransform.h.
using itk::AdvancedBSplineDeformableTransformBase< TScalarType, NDimensions >::RegionType |
Typedefs for specifying the extend to the grid.
Definition at line 224 of file itkAdvancedBSplineDeformableTransformBase.h.
using itk::AdvancedBSplineDeformableTransform< TScalarType, NDimensions, VSplineOrder >::Self = AdvancedBSplineDeformableTransform |
Standard class typedefs.
Definition at line 139 of file itkAdvancedBSplineDeformableTransform.h.
using itk::AdvancedBSplineDeformableTransformBase< TScalarType, NDimensions >::SizeType |
Definition at line 227 of file itkAdvancedBSplineDeformableTransformBase.h.
using itk::AdvancedBSplineDeformableTransform< TScalarType, NDimensions, VSplineOrder >::SODerivativeWeightsFunctionPointer = typename SODerivativeWeightsFunctionType::Pointer |
Definition at line 214 of file itkAdvancedBSplineDeformableTransform.h.
using itk::AdvancedBSplineDeformableTransform< TScalarType, NDimensions, VSplineOrder >::SODerivativeWeightsFunctionType |
Definition at line 212 of file itkAdvancedBSplineDeformableTransform.h.
using itk::AdvancedBSplineDeformableTransformBase< TScalarType, NDimensions >::SpacingType |
Definition at line 228 of file itkAdvancedBSplineDeformableTransformBase.h.
using itk::AdvancedBSplineDeformableTransform< TScalarType, NDimensions, VSplineOrder >::Superclass = AdvancedBSplineDeformableTransformBase<TScalarType, NDimensions> |
Definition at line 140 of file itkAdvancedBSplineDeformableTransform.h.
using itk::AdvancedBSplineDeformableTransform< TScalarType, NDimensions, VSplineOrder >::WeightsFunctionPointer = typename WeightsFunctionType::Pointer |
Definition at line 206 of file itkAdvancedBSplineDeformableTransform.h.
using itk::AdvancedBSplineDeformableTransform< TScalarType, NDimensions, VSplineOrder >::WeightsFunctionType = BSplineInterpolationWeightFunction2<ScalarType, Self::SpaceDimension, VSplineOrder> |
Interpolation weights function type.
Definition at line 205 of file itkAdvancedBSplineDeformableTransform.h.
using itk::AdvancedBSplineDeformableTransform< TScalarType, NDimensions, VSplineOrder >::WeightsType = typename WeightsFunctionType::WeightsType |
Definition at line 207 of file itkAdvancedBSplineDeformableTransform.h.
|
protected |
|
overrideprotecteddefault |
|
overrideprotectedvirtual |
|
overridevirtual |
Compute the inner product of the Jacobian with the moving image gradient. The Jacobian is (partially) constructed inside this function, but not returned.
Reimplemented from itk::AdvancedTransform< double, NDimensions, NDimensions >.
Reimplemented in itk::RecursiveBSplineTransform< TScalarType, NDimensions, VSplineOrder >.
|
virtual |
Run-time type information (and related methods).
Reimplemented from itk::AdvancedBSplineDeformableTransformBase< double, 3 >.
Reimplemented in itk::CyclicBSplineDeformableTransform< TScalarType, NDimensions, VSplineOrder >, itk::DeformationVectorFieldTransform< TScalarType, NDimensions >, itk::GPUAdvancedBSplineDeformableTransform< TScalarType, NDimensions, VSplineOrder, TParentTransform >, and itk::RecursiveBSplineTransform< TScalarType, NDimensions, VSplineOrder >.
|
overridevirtual |
Compute the Jacobian of the transformation.
Implements itk::AdvancedTransform< double, NDimensions, NDimensions >.
Reimplemented in itk::CyclicBSplineDeformableTransform< TScalarType, NDimensions, VSplineOrder >, and itk::RecursiveBSplineTransform< TScalarType, NDimensions, VSplineOrder >.
|
overridevirtual |
Compute the Jacobian of the spatial Hessian of the transformation.
Implements itk::AdvancedTransform< double, NDimensions, NDimensions >.
Reimplemented in itk::RecursiveBSplineTransform< TScalarType, NDimensions, VSplineOrder >.
|
overridevirtual |
Compute both the spatial Hessian and the Jacobian of the spatial Hessian of the transformation.
Implements itk::AdvancedTransform< double, NDimensions, NDimensions >.
Reimplemented in itk::RecursiveBSplineTransform< TScalarType, NDimensions, VSplineOrder >.
|
overridevirtual |
Compute the Jacobian of the spatial Jacobian of the transformation.
Implements itk::AdvancedTransform< double, NDimensions, NDimensions >.
Reimplemented in itk::RecursiveBSplineTransform< TScalarType, NDimensions, VSplineOrder >.
|
overridevirtual |
Compute both the spatial Jacobian and the Jacobian of the spatial Jacobian of the transformation.
Implements itk::AdvancedTransform< double, NDimensions, NDimensions >.
Reimplemented in itk::RecursiveBSplineTransform< TScalarType, NDimensions, VSplineOrder >.
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
Compute the spatial Hessian of the transformation.
Implements itk::AdvancedTransform< double, NDimensions, NDimensions >.
Reimplemented in itk::RecursiveBSplineTransform< TScalarType, NDimensions, VSplineOrder >.
|
overridevirtual |
Compute the spatial Jacobian of the transformation.
Implements itk::AdvancedTransform< double, NDimensions, NDimensions >.
Reimplemented in itk::CyclicBSplineDeformableTransform< TScalarType, NDimensions, VSplineOrder >, and itk::RecursiveBSplineTransform< TScalarType, NDimensions, VSplineOrder >.
itk::AdvancedBSplineDeformableTransform< TScalarType, NDimensions, VSplineOrder >::ITK_DISALLOW_COPY_AND_MOVE | ( | AdvancedBSplineDeformableTransform< TScalarType, NDimensions, VSplineOrder > | ) |
|
protected |
itk::AdvancedBSplineDeformableTransform< TScalarType, NDimensions, VSplineOrder >::itkStaticConstMacro | ( | SpaceDimension | , |
unsigned int | , | ||
NDimensions | ) |
Dimension of the domain space.
itk::AdvancedBSplineDeformableTransform< TScalarType, NDimensions, VSplineOrder >::itkStaticConstMacro | ( | SplineOrder | , |
unsigned int | , | ||
VSplineOrder | ) |
The B-spline order.
|
static |
New macro for creation of through the object factory.
|
overrideprotected |
Print contents of an AdvancedBSplineDeformableTransform.
|
overridevirtual |
This method specifies the region over which the grid resides.
Implements itk::AdvancedBSplineDeformableTransformBase< double, 3 >.
Reimplemented in itk::CyclicBSplineDeformableTransform< TScalarType, NDimensions, VSplineOrder >.
|
protectedvirtual |
Allow subclasses to access and manipulate the weights function.
|
override |
Transform points by a B-spline deformable transformation.
|
protected |
Wrap flat array into images of coefficients.
|
friend |
Definition at line 309 of file itkAdvancedBSplineDeformableTransform.h.
|
protected |
Definition at line 308 of file itkAdvancedBSplineDeformableTransform.h.
|
protected |
Definition at line 309 of file itkAdvancedBSplineDeformableTransform.h.
|
protected |
Pointer to function used to compute B-spline interpolation weights. For each direction we create a different weights function for thread- safety.
Definition at line 307 of file itkAdvancedBSplineDeformableTransform.h.
|
staticconstexpr |
The number of weights.
Definition at line 220 of file itkAdvancedBSplineDeformableTransform.h.
Generated on 2024-07-17 for elastix by 1.11.0 (9b424b03c9833626cd435af22a444888fbbb192d) |