template<class
TScalarType = double, unsigned
int NDimensions = 3, unsigned
int VSplineOrder = 3>
class itk::AdvancedBSplineDeformableTransform< TScalarType, NDimensions, VSplineOrder >
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 .
using ConstPointer = SmartPointer< const Self >
using ContinuousIndexType = typename WeightsFunctionType::ContinuousIndexType
using DerivativeWeightsFunctionPointer = typename DerivativeWeightsFunctionType::Pointer
using DerivativeWeightsFunctionType = BSplineInterpolationDerivativeWeightFunction < ScalarType, Self::SpaceDimension, VSplineOrder >
using DirectionType = typename ImageType::DirectionType
using GridOffsetType = IndexType
using ImagePointer = typename ImageType::Pointer
using ImageType = Image < PixelType, Self::SpaceDimension >
using IndexType = typename RegionType::IndexType
using OriginType = typename ImageType::PointType
using ParameterIndexArrayType = Array< unsigned long >
using Pointer = SmartPointer< Self >
using RegionType = ImageRegion< Self::SpaceDimension >
using Self = AdvancedBSplineDeformableTransform
using SizeType = typename RegionType::SizeType
using SODerivativeWeightsFunctionPointer = typename SODerivativeWeightsFunctionType::Pointer
using SODerivativeWeightsFunctionType = BSplineInterpolationSecondOrderDerivativeWeightFunction < ScalarType, Self::SpaceDimension, VSplineOrder >
using SpacingType = typename ImageType::SpacingType
using Superclass = AdvancedBSplineDeformableTransformBase < TScalarType , NDimensions >
using WeightsFunctionPointer = typename WeightsFunctionType::Pointer
using WeightsFunctionType = BSplineInterpolationWeightFunction2 < ScalarType, Self::SpaceDimension, VSplineOrder >
using WeightsType = typename WeightsFunctionType::WeightsType
using ConstPointer = SmartPointer< const Self >
using ContinuousIndexType = ContinuousIndex< ScalarType, SpaceDimension >
using DirectionType = typename ImageType::DirectionType
using GridOffsetType = IndexType
using ImagePointer = typename ImageType::Pointer
using ImageType = Image < PixelType, Self::SpaceDimension >
using IndexType = typename RegionType::IndexType
using OriginType = typename ImageType::PointType
using ParameterIndexArrayType = Array< unsigned long >
using Pointer = SmartPointer< Self >
using RegionType = ImageRegion< Self::SpaceDimension >
using Self = AdvancedBSplineDeformableTransformBase
using SizeType = typename RegionType::SizeType
using SpacingType = typename ImageType::SpacingType
using Superclass = AdvancedTransform < TScalarType , NDimensions, NDimensions >
using ConstPointer = SmartPointer< const Self >
using InternalMatrixType = typename SpatialJacobianType::InternalMatrixType
using InverseTransformBaseType = typename Superclass::InverseTransformBaseType
using JacobianOfSpatialHessianType = std::vector< SpatialHessianType >
using JacobianOfSpatialJacobianType = std::vector< SpatialJacobianType >
using MovingImageGradientType = OutputCovariantVectorType
using MovingImageGradientValueType = typename MovingImageGradientType::ValueType
using NonZeroJacobianIndicesType = std::vector< unsigned long >
using Pointer = SmartPointer< Self >
using Self = AdvancedTransform
using SpatialHessianType = FixedArray< Matrix< ScalarType, InputSpaceDimension, InputSpaceDimension >, OutputSpaceDimension >
using SpatialJacobianType = Matrix< ScalarType, OutputSpaceDimension, InputSpaceDimension >
using Superclass = Transform< TScalarType , NInputDimensions, NOutputDimensions >
using TransformType = Transform< TScalarType , NInputDimensions, NOutputDimensions >
using TransformTypeConstPointer = typename TransformType::ConstPointer
using TransformTypePointer = typename TransformType::Pointer
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
unsigned long GetNumberOfWeights () const
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
virtual const char * GetClassName () const
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
virtual unsigned int GetNumberOfAffectedWeights () const =0
NumberOfParametersType GetNumberOfNonZeroJacobianIndices () const override=0
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 SetGridRegion (const RegionType ®ion)=0
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
void ComputeJacobianWithRespectToParameters (const InputPointType &, JacobianType &) const override
virtual void EvaluateJacobianWithImageGradientProduct (const InputPointType &inputPoint, const MovingImageGradientType &movingImageGradient, DerivativeType &imageJacobian, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const
virtual const char * GetClassName () const
virtual bool GetHasNonZeroJacobianOfSpatialHessian () const
virtual bool GetHasNonZeroSpatialHessian () const
virtual void GetJacobian (const InputPointType &inputPoint, JacobianType &j, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const =0
virtual void GetJacobianOfSpatialHessian (const InputPointType &inputPoint, JacobianOfSpatialHessianType &jsh, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const =0
virtual void GetJacobianOfSpatialHessian (const InputPointType &inputPoint, SpatialHessianType &sh, JacobianOfSpatialHessianType &jsh, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const =0
virtual void GetJacobianOfSpatialJacobian (const InputPointType &inputPoint, JacobianOfSpatialJacobianType &jsj, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const =0
virtual void GetJacobianOfSpatialJacobian (const InputPointType &inputPoint, SpatialJacobianType &sj, JacobianOfSpatialJacobianType &jsj, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const =0
virtual NumberOfParametersType GetNumberOfNonZeroJacobianIndices () const
virtual void GetSpatialHessian (const InputPointType &inputPoint, SpatialHessianType &sh) const =0
virtual void GetSpatialJacobian (const InputPointType &inputPoint, SpatialJacobianType &sj) const =0
ITK_DISALLOW_COPY_AND_MOVE (AdvancedTransform )
itkStaticConstMacro (InputSpaceDimension, unsigned int , NInputDimensions)
itkStaticConstMacro (OutputSpaceDimension, unsigned int , NOutputDimensions)