template<typename TParametersValueType = double, unsigned int VDimension = 3, unsigned int VSplineOrder = 3>
class itk::BSplineTransform< TParametersValueType, VDimension, VSplineOrder >
Deformable transform using a BSpline representation.
This class encapsulates a deformable transform of points from one N-dimensional 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 \( \vec{\lambda}_j \) and is varied by defining a deformation \( \vec{g}(\vec{\lambda}_j) \) of each control point. The deformation \( D(\vec{x}) \) at any point \( \vec{x} \) is obtained by using a B-spline interpolation kernel.
The deformation field grid is defined by a user specified transform domain (origin, physical dimensions, direction) and B-spline mesh size where the mesh size is the number of polynomial patches comprising the finite domain of support. The relationship between the mesh size ( number of polynomial pieces) and the number of control points in any given dimension is
mesh size = number of control points - spline order
Each grid/control point has associated with it N deformation coefficients \( \vec{\delta}_j \), representing the N directional components of the deformation. Deformation outside the grid plus support region for the BSpline interpolation is assumed to be zero.
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 concatenated together to form a single array.
The following illustrates the typical usage of this class:
using TransformType = BSplineTransform<double,2,3>;
transform->SetTransformDomainOrigin( origin );
transform->SetTransformDomainPhysicalDimensions( physicalDimensions );
transform->SetTransformDomainDirection( direction );
transform->SetTransformDomainMeshSize( meshSize );
TransformType::ParametersType parameters( transform->GetNumberOfParameters() );
transform->SetParameters( parameters )
outputPoint = transform->TransformPoint( inputPoint );
An alternative way to set the B-spline coefficients is via array of images. The fixed parameters of the transform are 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];
transform->SetCoefficientImages(
images );
outputPoint = transform->TransformPoint( inputPoint );
*par Constraints *The filter image with at least two dimensions and a vector *length of at least The theory supports extension to scalar images
- 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.
- Examples
- Examples/IO/TransformReadWrite.cxx, Examples/RegistrationITKv4/BSplineWarping1.cxx, Examples/RegistrationITKv4/BSplineWarping2.cxx, Examples/RegistrationITKv4/DeformableRegistration12.cxx, Examples/RegistrationITKv4/DeformableRegistration13.cxx, Examples/RegistrationITKv4/DeformableRegistration14.cxx, Examples/RegistrationITKv4/DeformableRegistration15.cxx, Examples/RegistrationITKv4/DeformableRegistration4.cxx, Examples/RegistrationITKv4/DeformableRegistration6.cxx, Examples/RegistrationITKv4/DeformableRegistration7.cxx, and Examples/RegistrationITKv4/DeformableRegistration8.cxx.
Definition at line 103 of file itkBSplineTransform.h.
|
using | ConstPointer = SmartPointer< const Self > |
|
using | PhysicalDimensionsType = typename Superclass::SpacingType |
|
using | Pointer = SmartPointer< Self > |
|
using | Self = BSplineTransform |
|
using | Superclass = BSplineBaseTransform< TParametersValueType, VDimension, VSplineOrder > |
|
using | CoefficientImageArray = FixedArray< ImagePointer, VDimension > |
|
using | ConstPointer = SmartPointer< const Self > |
|
using | ContinuousIndexType = typename WeightsFunctionType::ContinuousIndexType |
|
using | DirectionType = typename ImageType::DirectionType |
|
using | ImagePointer = typename ImageType::Pointer |
|
using | ImageType = Image< ParametersValueType, Self::SpaceDimension > |
|
using | IndexType = typename RegionType::IndexType |
|
using | InputCovariantVectorType = CovariantVector< double, Self::SpaceDimension > |
|
using | InputPointType = Point< double, Self::SpaceDimension > |
|
using | InputVectorType = Vector< double, Self::SpaceDimension > |
|
using | InputVnlVectorType = vnl_vector_fixed< double, SpaceDimension > |
|
using | MeshSizeType = SizeType |
|
using | OriginType = typename ImageType::PointType |
|
using | OutputCovariantVectorType = CovariantVector< double, Self::SpaceDimension > |
|
using | OutputPointType = Point< double, Self::SpaceDimension > |
|
using | OutputVectorType = Vector< double, Self::SpaceDimension > |
|
using | OutputVnlVectorType = vnl_vector_fixed< double, SpaceDimension > |
|
using | ParameterIndexArrayType = FixedArray< unsigned long, NumberOfWeights > |
|
using | ParametersValueType = typename ParametersType::ValueType |
|
using | PhysicalDimensionsType = typename ImageType::SpacingType |
|
using | PixelType = typename ImageType::PixelType |
|
using | Pointer = SmartPointer< Self > |
|
using | RegionType = ImageRegion< Self::SpaceDimension > |
|
using | Self = BSplineBaseTransform |
|
using | SizeType = typename RegionType::SizeType |
|
using | SpacingType = typename ImageType::SpacingType |
|
using | Superclass = Transform< double, VDimension, VDimension > |
|
using | WeightsFunctionType = BSplineInterpolationWeightFunction< ScalarType, Self::SpaceDimension, Self::SplineOrder > |
|
using | WeightsType = typename WeightsFunctionType::WeightsType |
|
using | ConstPointer = SmartPointer< const Self > |
|
using | DerivativeType = Array< ParametersValueType > |
|
using | DirectionChangeMatrix = Matrix< double, Self::OutputSpaceDimension, Self::InputSpaceDimension > |
|
using | InputCovariantVectorType = CovariantVector< double, VInputDimension > |
|
using | InputDiffusionTensor3DType = DiffusionTensor3D< double > |
|
using | InputDirectionMatrix = Matrix< double, Self::InputSpaceDimension, Self::InputSpaceDimension > |
|
using | InputPointType = Point< double, VInputDimension > |
|
using | InputSymmetricSecondRankTensorType = SymmetricSecondRankTensor< double, VInputDimension > |
|
using | InputVectorPixelType = VariableLengthVector< double > |
|
using | InputVectorType = Vector< double, VInputDimension > |
|
using | InputVnlVectorType = vnl_vector_fixed< double, VInputDimension > |
|
using | InverseJacobianPositionType = vnl_matrix_fixed< ParametersValueType, VInputDimension, VOutputDimension > |
|
using | InverseTransformBasePointer = typename InverseTransformBaseType::Pointer |
|
using | InverseTransformBaseType = Transform< double, VOutputDimension, VInputDimension > |
|
using | JacobianPositionType = vnl_matrix_fixed< ParametersValueType, VOutputDimension, VInputDimension > |
|
using | JacobianType = Array2D< ParametersValueType > |
|
using | MatrixType = Matrix< double, Self::OutputSpaceDimension, Self::InputSpaceDimension > |
|
using | OutputCovariantVectorType = CovariantVector< double, VOutputDimension > |
|
using | OutputDiffusionTensor3DType = DiffusionTensor3D< double > |
|
using | OutputDirectionMatrix = Matrix< double, Self::OutputSpaceDimension, Self::OutputSpaceDimension > |
|
using | OutputPointType = Point< double, VOutputDimension > |
|
using | OutputSymmetricSecondRankTensorType = SymmetricSecondRankTensor< double, VOutputDimension > |
|
using | OutputVectorPixelType = VariableLengthVector< double > |
|
using | OutputVectorType = Vector< double, VOutputDimension > |
|
using | OutputVnlVectorType = vnl_vector_fixed< double, VOutputDimension > |
|
using | Pointer = SmartPointer< Self > |
|
using | ScalarType = ParametersValueType |
|
using | Self = Transform |
|
using | Superclass = TransformBaseTemplate< double > |
|
using | ConstPointer = SmartPointer< const Self > |
|
using | FixedParametersType = OptimizerParameters< FixedParametersValueType > |
|
using | FixedParametersValueType = double |
|
using | NumberOfParametersType = IdentifierType |
|
using | ParametersType = OptimizerParameters< ParametersValueType > |
|
using | ParametersValueType = double |
|
using | Pointer = SmartPointer< Self > |
|
using | Self = TransformBaseTemplate |
|
using | Superclass = Object |
|
using | TransformCategoryEnum = TransformBaseTemplateEnums::TransformCategory |
|
using | ConstPointer = SmartPointer< const Self > |
|
using | Pointer = SmartPointer< Self > |
|
using | Self = Object |
|
using | Superclass = LightObject |
|
using | ConstPointer = SmartPointer< const Self > |
|
using | Pointer = SmartPointer< Self > |
|
using | Self = LightObject |
|
|
void | ComputeJacobianWithRespectToParameters (const InputPointType &, JacobianType &) const override |
|
const char * | GetNameOfClass () const override |
|
NumberOfParametersType | GetNumberOfParameters () const override |
|
NumberOfParametersType | GetNumberOfParametersPerDimension () const override |
|
virtual DirectionType | GetTransformDomainDirection () const |
|
virtual MeshSizeType | GetTransformDomainMeshSize () const |
|
virtual OriginType | GetTransformDomainOrigin () const |
|
virtual PhysicalDimensionsType | GetTransformDomainPhysicalDimensions () const |
|
std::string | GetTransformTypeAsString () const override |
|
void | SetCoefficientImages (const CoefficientImageArray &images) override |
|
virtual void | SetTransformDomainDirection (const DirectionType &) |
|
virtual void | SetTransformDomainMeshSize (const MeshSizeType &) |
|
virtual void | SetTransformDomainOrigin (const OriginType &) |
|
virtual void | SetTransformDomainPhysicalDimensions (const PhysicalDimensionsType &) |
|
|
void | SetFixedParameters (const FixedParametersType &passedParameters) override |
|
|
void | TransformPoint (const InputPointType &point, OutputPointType &outputPoint, WeightsType &weights, ParameterIndexArrayType &indices, bool &inside) const override |
|
void | ComputeJacobianFromBSplineWeightsWithRespectToPosition (const InputPointType &, WeightsType &, ParameterIndexArrayType &) const |
|
void | ComputeJacobianWithRespectToParameters (const InputPointType &, JacobianType &) const override=0 |
|
void | ComputeJacobianWithRespectToPosition (const InputPointType &, JacobianPositionType &) const override |
|
const CoefficientImageArray | GetCoefficientImages () const |
|
const FixedParametersType & | GetFixedParameters () const override |
|
const char * | GetNameOfClass () const override |
|
unsigned int | GetNumberOfAffectedWeights () const |
|
NumberOfParametersType | GetNumberOfLocalParameters () const override |
|
NumberOfParametersType | GetNumberOfParameters () const override=0 |
|
virtual NumberOfParametersType | GetNumberOfParametersPerDimension () const=0 |
|
const ParametersType & | GetParameters () const override |
|
TransformCategoryEnum | GetTransformCategory () const override |
|
| itkCloneMacro (Self) |
|
virtual void | SetCoefficientImages (const CoefficientImageArray &images)=0 |
|
void | SetIdentity () |
|
void | SetParameters (const ParametersType ¶meters) override |
|
void | SetParametersByValue (const ParametersType ¶meters) override |
|
virtual void | TransformPoint (const InputPointType &inputPoint, OutputPointType &outputPoint, WeightsType &weights, ParameterIndexArrayType &indices, bool &inside) const=0 |
|
OutputPointType | TransformPoint (const InputPointType &point) const override |
|
OutputVnlVectorType | TransformVector (const InputVnlVectorType &) const override |
|
void | UpdateTransformParameters (const DerivativeType &update, double factor=1.0) override |
|
OutputVectorType | TransformVector (const InputVectorType &) const override |
|
OutputCovariantVectorType | TransformCovariantVector (const InputCovariantVectorType &) const override |
|
virtual void | ComputeJacobianWithRespectToParametersCachedTemporaries (const InputPointType &p, JacobianType &jacobian, JacobianType &) const |
|
void | CopyInFixedParameters (const FixedParametersValueType *const begin, const FixedParametersValueType *const end) override |
|
void | CopyInParameters (const ParametersValueType *const begin, const ParametersValueType *const end) override |
|
const FixedParametersType & | GetFixedParameters () const override |
|
unsigned int | GetInputSpaceDimension () const override |
|
virtual const std::string & | GetInputSpaceName () const |
|
bool | GetInverse (Self *) const |
|
virtual InverseTransformBasePointer | GetInverseTransform () const |
|
const char * | GetNameOfClass () const override |
|
virtual NumberOfParametersType | GetNumberOfFixedParameters () const |
|
virtual NumberOfParametersType | GetNumberOfLocalParameters () const |
|
NumberOfParametersType | GetNumberOfParameters () const override |
|
unsigned int | GetOutputSpaceDimension () const override |
|
virtual const std::string & | GetOutputSpaceName () const |
|
const ParametersType & | GetParameters () const override |
|
TransformCategoryEnum | GetTransformCategory () const override |
|
std::string | GetTransformTypeAsString () const override |
|
virtual bool | IsLinear () const |
|
| itkCloneMacro (Self) |
|
void | SetFixedParameters (const FixedParametersType &) override=0 |
|
virtual void | SetInputSpaceName (std::string _arg) |
|
virtual void | SetOutputSpaceName (std::string _arg) |
|
void | SetParameters (const ParametersType &) override=0 |
|
void | SetParametersByValue (const ParametersType &p) override |
|
virtual OutputCovariantVectorType | TransformCovariantVector (const InputCovariantVectorType &) const |
|
virtual OutputCovariantVectorType | TransformCovariantVector (const InputCovariantVectorType &vector, const InputPointType &point) const |
|
virtual OutputVectorPixelType | TransformCovariantVector (const InputVectorPixelType &) const |
|
virtual OutputVectorPixelType | TransformCovariantVector (const InputVectorPixelType &vector, const InputPointType &point) const |
|
virtual OutputDiffusionTensor3DType | TransformDiffusionTensor3D (const InputDiffusionTensor3DType &) const |
|
virtual OutputDiffusionTensor3DType | TransformDiffusionTensor3D (const InputDiffusionTensor3DType &inputTensor, const InputPointType &point) const |
|
virtual OutputVectorPixelType | TransformDiffusionTensor3D (const InputVectorPixelType &) const |
|
virtual OutputVectorPixelType | TransformDiffusionTensor3D (const InputVectorPixelType &inputTensor, const InputPointType &point) const |
|
virtual OutputPointType | TransformPoint (const InputPointType &) const=0 |
|
virtual OutputSymmetricSecondRankTensorType | TransformSymmetricSecondRankTensor (const InputSymmetricSecondRankTensorType &) const |
|
virtual OutputSymmetricSecondRankTensorType | TransformSymmetricSecondRankTensor (const InputSymmetricSecondRankTensorType &inputTensor, const InputPointType &point) const |
|
virtual OutputVectorPixelType | TransformSymmetricSecondRankTensor (const InputVectorPixelType &) const |
|
virtual OutputVectorPixelType | TransformSymmetricSecondRankTensor (const InputVectorPixelType &inputTensor, const InputPointType &point) const |
|
virtual OutputVectorPixelType | TransformVector (const InputVectorPixelType &) const |
|
virtual OutputVectorPixelType | TransformVector (const InputVectorPixelType &vector, const InputPointType &point) const |
|
virtual OutputVectorType | TransformVector (const InputVectorType &) const |
|
virtual OutputVectorType | TransformVector (const InputVectorType &vector, const InputPointType &point) const |
|
virtual OutputVnlVectorType | TransformVector (const InputVnlVectorType &) const |
|
virtual OutputVnlVectorType | TransformVector (const InputVnlVectorType &vector, const InputPointType &point) const |
|
virtual void | UpdateTransformParameters (const DerivativeType &update, ParametersValueType factor=1.0) |
|
virtual void | ComputeJacobianWithRespectToParameters (const InputPointType &, JacobianType &) const=0 |
|
virtual void | ComputeJacobianWithRespectToPosition (const InputPointType &, JacobianPositionType &) const |
|
| itkLegacyMacro (virtual void ComputeJacobianWithRespectToPosition(const InputPointType &x, JacobianType &jacobian) const) |
|
| itkLegacyMacro (virtual void ComputeInverseJacobianWithRespectToPosition(const InputPointType &x, JacobianType &jacobian) const) |
|
virtual void | ComputeInverseJacobianWithRespectToPosition (const InputPointType &pnt, InverseJacobianPositionType &jacobian) const |
|
std::enable_if_t< TImage::ImageDimension==VInputDimension &&TImage::ImageDimension==VOutputDimension, void > | ApplyToImageMetadata (TImage *image) const |
|
std::enable_if_t< TImage::ImageDimension==VInputDimension &&TImage::ImageDimension==VOutputDimension, void > | ApplyToImageMetadata (SmartPointer< TImage > image) const |
|
virtual void | CopyInFixedParameters (const FixedParametersValueType *const begin, const FixedParametersValueType *const end)=0 |
|
virtual void | CopyInParameters (const ParametersValueType *const begin, const ParametersValueType *const end)=0 |
|
virtual const FixedParametersType & | GetFixedParameters () const=0 |
|
virtual unsigned int | GetInputSpaceDimension () const=0 |
|
const char * | GetNameOfClass () const override |
|
virtual NumberOfParametersType | GetNumberOfParameters () const=0 |
|
virtual unsigned int | GetOutputSpaceDimension () const=0 |
|
virtual const ParametersType & | GetParameters () const=0 |
|
virtual TransformCategoryEnum | GetTransformCategory () const=0 |
|
virtual std::string | GetTransformTypeAsString () const=0 |
|
virtual void | SetFixedParameters (const FixedParametersType &)=0 |
|
virtual void | SetParameters (const ParametersType &)=0 |
|
virtual void | SetParametersByValue (const ParametersType &p)=0 |
|
unsigned long | AddObserver (const EventObject &event, Command *) |
|
unsigned long | AddObserver (const EventObject &event, Command *) const |
|
unsigned long | AddObserver (const EventObject &event, std::function< void(const EventObject &)> function) const |
|
LightObject::Pointer | CreateAnother () const override |
|
virtual void | DebugOff () const |
|
virtual void | DebugOn () const |
|
Command * | GetCommand (unsigned long tag) |
|
bool | GetDebug () const |
|
MetaDataDictionary & | GetMetaDataDictionary () |
|
const MetaDataDictionary & | GetMetaDataDictionary () const |
|
virtual ModifiedTimeType | GetMTime () const |
|
const char * | GetNameOfClass () const override |
|
virtual const TimeStamp & | GetTimeStamp () const |
|
bool | HasObserver (const EventObject &event) const |
|
void | InvokeEvent (const EventObject &) |
|
void | InvokeEvent (const EventObject &) const |
|
virtual void | Modified () const |
|
void | Register () const override |
|
void | RemoveAllObservers () |
|
void | RemoveObserver (unsigned long tag) |
|
void | SetDebug (bool debugFlag) const |
|
void | SetReferenceCount (int) override |
|
void | UnRegister () const noexcept override |
|
void | SetMetaDataDictionary (const MetaDataDictionary &rhs) |
|
void | SetMetaDataDictionary (MetaDataDictionary &&rrhs) |
|
virtual void | SetObjectName (std::string _arg) |
|
virtual const std::string & | GetObjectName () const |
|
Pointer | Clone () const |
|
virtual Pointer | CreateAnother () const |
|
virtual void | Delete () |
|
virtual const char * | GetNameOfClass () const |
|
virtual int | GetReferenceCount () const |
|
void | Print (std::ostream &os, Indent indent=0) const |
|
virtual void | Register () const |
|
virtual void | SetReferenceCount (int) |
|
virtual void | UnRegister () const noexcept |
|
template<typename TParametersValueType = double, unsigned int VDimension = 3, unsigned int VSplineOrder = 3>
This method sets the fixed parameters of the transform. For a BSpline deformation transform, the fixed parameters are the following: grid size, grid origin, grid spacing, and grid direction. However, all of these are set via the much more intuitive SetTransformDomainXXX() functions
The fixed parameters are the three times the size of the templated dimensions. This function has the effect of make the following non- existing functional calls: transform->SetGridSpacing( spacing ); transform->SetGridOrigin( origin ); transform->SetGridDirection( direction ); transform->SetGridRegion( bsplineRegion );
With recent updates to this transform, however, all these parameters are set indirectly by setting the transform domain parameters unless the user sets them with SetFixedParameters().
This function was added to allow the transform to work with the itkTransformReader/Writer I/O filters.
Implements itk::BSplineBaseTransform< double, 3, 3 >.