ITK
4.3.0
Insight Segmentation and Registration Toolkit
|
#include <itkBSplineTransform.h>
Deformable transform using a BSpline representation.
This class encapsulates a deformable transform of points from one N-dimensional one space to another N-dimensional space. The deformation field is modelled 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 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 polynomical 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 , 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 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 BSplineTransform<double,2,3> TransformType; * TransformType::Pointer transform = TransformType::New(); * * transform->SetTransformDomainOrigin( origin ); * transform->SetTransformDomainPhysicalDimensions( physicalDimensions ); * transform->SetTransformDomainDirection( direction ); * transform->SetTransformDomainMeshSize( meshSize ); * * // 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 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]; * * // 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 110 of file itkBSplineTransform.h.
Public Types | |
typedef Superclass::CoefficientImageArray | CoefficientImageArray |
typedef SmartPointer< const Self > | ConstPointer |
typedef Superclass::ContinuousIndexType | ContinuousIndexType |
typedef Superclass::DirectionType | DirectionType |
typedef Superclass::ImagePointer | ImagePointer |
typedef Superclass::ImageType | ImageType |
typedef Superclass::IndexType | IndexType |
typedef Superclass::InputCovariantVectorType | InputCovariantVectorType |
typedef Superclass::InputPointType | InputPointType |
typedef Superclass::InputVectorType | InputVectorType |
typedef Superclass::InputVnlVectorType | InputVnlVectorType |
typedef Superclass::JacobianType | JacobianType |
typedef Superclass::MeshSizeType | MeshSizeType |
typedef Superclass::NumberOfParametersType | NumberOfParametersType |
typedef Superclass::OriginType | OriginType |
typedef Superclass::OutputCovariantVectorType | OutputCovariantVectorType |
typedef Superclass::OutputPointType | OutputPointType |
typedef Superclass::OutputVectorType | OutputVectorType |
typedef Superclass::OutputVnlVectorType | OutputVnlVectorType |
typedef Superclass::ParameterIndexArrayType | ParameterIndexArrayType |
typedef Superclass::ParametersType | ParametersType |
typedef Superclass::ParametersValueType | ParametersValueType |
typedef Superclass::SpacingType | PhysicalDimensionsType |
typedef Superclass::PixelType | PixelType |
typedef SmartPointer< Self > | Pointer |
typedef Superclass::RegionType | RegionType |
typedef Superclass::ScalarType | ScalarType |
typedef BSplineTransform | Self |
typedef Superclass::SizeType | SizeType |
typedef Superclass::SpacingType | SpacingType |
typedef BSplineBaseTransform < TScalarType, NDimensions, VSplineOrder > | Superclass |
typedef Superclass::WeightsFunctionType | WeightsFunctionType |
typedef Superclass::WeightsType | WeightsType |
Public Types inherited from itk::BSplineBaseTransform< TScalarType, NDimensions, VSplineOrder > | |
typedef FixedArray < ImagePointer, NDimensions > | CoefficientImageArray |
typedef SmartPointer< const Self > | ConstPointer |
typedef WeightsFunctionType::ContinuousIndexType | ContinuousIndexType |
typedef Superclass::DerivativeType | DerivativeType |
typedef ImageType::DirectionType | DirectionType |
typedef ImageType::Pointer | ImagePointer |
typedef Image < ParametersValueType, itkGetStaticConstMacro(SpaceDimension)> | ImageType |
typedef RegionType::IndexType | IndexType |
typedef vnl_vector_fixed < TScalarType, SpaceDimension > | InputVnlVectorType |
typedef Superclass::JacobianType | JacobianType |
typedef SizeType | MeshSizeType |
typedef Superclass::NumberOfParametersType | NumberOfParametersType |
typedef ImageType::PointType | OriginType |
typedef vnl_vector_fixed < TScalarType, SpaceDimension > | OutputVnlVectorType |
typedef Array< unsigned long > | ParameterIndexArrayType |
typedef Superclass::ParametersType | ParametersType |
typedef ParametersType::ValueType | ParametersValueType |
typedef ImageType::SpacingType | PhysicalDimensionsType |
typedef ImageType::PixelType | PixelType |
typedef SmartPointer< Self > | Pointer |
typedef ImageRegion < itkGetStaticConstMacro(SpaceDimension)> | RegionType |
typedef Superclass::ScalarType | ScalarType |
typedef BSplineBaseTransform | Self |
typedef RegionType::SizeType | SizeType |
typedef ImageType::SpacingType | SpacingType |
typedef Transform< TScalarType, NDimensions, NDimensions > | Superclass |
typedef Superclass::TransformCategoryType | TransformCategoryType |
typedef BSplineInterpolationWeightFunction < ScalarType, itkGetStaticConstMacro(SpaceDimension), itkGetStaticConstMacro(SplineOrder)> | WeightsFunctionType |
typedef WeightsFunctionType::WeightsType | WeightsType |
typedef Vector< TScalarType, itkGetStaticConstMacro(SpaceDimension)> | InputVectorType |
typedef Vector< TScalarType, itkGetStaticConstMacro(SpaceDimension)> | OutputVectorType |
typedef CovariantVector < TScalarType, itkGetStaticConstMacro(SpaceDimension)> | InputCovariantVectorType |
typedef CovariantVector < TScalarType, itkGetStaticConstMacro(SpaceDimension)> | OutputCovariantVectorType |
typedef Point< TScalarType, itkGetStaticConstMacro(SpaceDimension)> | InputPointType |
typedef Point< TScalarType, itkGetStaticConstMacro(SpaceDimension)> | OutputPointType |
Public Types inherited from itk::Transform< TScalarType, NDimensions, NDimensions > | |
typedef SmartPointer< const Self > | ConstPointer |
typedef Array < ParametersValueType > | DerivativeType |
typedef Matrix< double, itkGetStaticConstMacro(OutputSpaceDimension), itkGetStaticConstMacro(InputSpaceDimension)> | DirectionChangeMatrix |
typedef CovariantVector < TScalarType, NInputDimensions > | InputCovariantVectorType |
typedef DiffusionTensor3D < TScalarType > | InputDiffusionTensor3DType |
typedef Matrix< double, itkGetStaticConstMacro(InputSpaceDimension), itkGetStaticConstMacro(InputSpaceDimension)> | InputDirectionMatrix |
typedef Point< TScalarType, NInputDimensions > | InputPointType |
typedef SymmetricSecondRankTensor < TScalarType, NInputDimensions > | InputSymmetricSecondRankTensorType |
typedef VariableLengthVector < TScalarType > | InputVectorPixelType |
typedef Vector< TScalarType, NInputDimensions > | InputVectorType |
typedef vnl_vector_fixed < TScalarType, NInputDimensions > | InputVnlVectorType |
typedef InverseTransformBaseType::Pointer | InverseTransformBasePointer |
typedef Transform< TScalarType, NOutputDimensions, NInputDimensions > | InverseTransformBaseType |
typedef Array2D < ParametersValueType > | JacobianType |
typedef Matrix< TScalarType, itkGetStaticConstMacro(OutputSpaceDimension), itkGetStaticConstMacro(InputSpaceDimension)> | MatrixType |
typedef Superclass::NumberOfParametersType | NumberOfParametersType |
typedef CovariantVector < TScalarType, NOutputDimensions > | OutputCovariantVectorType |
typedef DiffusionTensor3D < TScalarType > | OutputDiffusionTensor3DType |
typedef Matrix< double, itkGetStaticConstMacro(OutputSpaceDimension), itkGetStaticConstMacro(OutputSpaceDimension)> | OutputDirectionMatrix |
typedef Point< TScalarType, NOutputDimensions > | OutputPointType |
typedef SymmetricSecondRankTensor < TScalarType, NOutputDimensions > | OutputSymmetricSecondRankTensorType |
typedef VariableLengthVector < TScalarType > | OutputVectorPixelType |
typedef Vector< TScalarType, NOutputDimensions > | OutputVectorType |
typedef vnl_vector_fixed < TScalarType, NOutputDimensions > | OutputVnlVectorType |
typedef Superclass::ParametersType | ParametersType |
typedef Superclass::ParametersValueType | ParametersValueType |
typedef SmartPointer< Self > | Pointer |
typedef TScalarType | ScalarType |
typedef Transform | Self |
typedef TransformBase | Superclass |
Public Types inherited from itk::TransformBase | |
typedef SmartPointer< const Self > | ConstPointer |
typedef IdentifierType | NumberOfParametersType |
typedef OptimizerParameters < ParametersValueType > | ParametersType |
typedef double | ParametersValueType |
typedef SmartPointer< Self > | Pointer |
typedef TransformBase | Self |
typedef Object | Superclass |
enum | TransformCategoryType { UnknownTransformCategory =0, Linear =1, BSpline =2, Spline =3, DisplacementField =4, VelocityField =5 } |
Public Types inherited from itk::Object | |
typedef SmartPointer< const Self > | ConstPointer |
typedef SmartPointer< Self > | Pointer |
typedef Object | Self |
typedef LightObject | Superclass |
Public Types inherited from itk::LightObject | |
typedef SmartPointer< const Self > | ConstPointer |
typedef SmartPointer< Self > | Pointer |
typedef LightObject | Self |
Static Public Member Functions | |
static Pointer | New () |
Static Public Attributes | |
static const unsigned int | SpaceDimension = NDimensions |
static const unsigned int | SplineOrder = VSplineOrder |
Static Public Attributes inherited from itk::BSplineBaseTransform< TScalarType, NDimensions, VSplineOrder > | |
static const unsigned int | SpaceDimension = NDimensions |
static const unsigned int | SplineOrder = VSplineOrder |
Static Public Attributes inherited from itk::Transform< TScalarType, NDimensions, NDimensions > | |
static const unsigned int | InputSpaceDimension |
static const unsigned int | OutputSpaceDimension |
Private Member Functions | |
BSplineTransform (const Self &) | |
virtual bool | InsideValidRegion (ContinuousIndexType &) const |
void | operator= (const Self &) |
virtual void | SetCoefficientImageInformationFromFixedParameters () |
virtual void | SetFixedParametersGridDirectionFromTransformDomainInformation () const |
virtual void | SetFixedParametersGridOriginFromTransformDomainInformation () const |
virtual void | SetFixedParametersGridSizeFromTransformDomainInformation () const |
virtual void | SetFixedParametersGridSpacingFromTransformDomainInformation () const |
Additional Inherited Members | |
Protected Types inherited from itk::LightObject | |
typedef int | InternalReferenceCountType |
Protected Attributes inherited from itk::BSplineBaseTransform< TScalarType, NDimensions, VSplineOrder > | |
CoefficientImageArray | m_CoefficientImages |
ParametersType | m_InternalParametersBuffer |
WeightsFunctionType::Pointer | m_WeightsFunction |
typedef Superclass::CoefficientImageArray itk::BSplineTransform< TScalarType, NDimensions, VSplineOrder >::CoefficientImageArray |
Definition at line 190 of file itkBSplineTransform.h.
typedef SmartPointer<const Self> itk::BSplineTransform< TScalarType, NDimensions, VSplineOrder >::ConstPointer |
Definition at line 118 of file itkBSplineTransform.h.
typedef Superclass::ContinuousIndexType itk::BSplineTransform< TScalarType, NDimensions, VSplineOrder >::ContinuousIndexType |
Definition at line 218 of file itkBSplineTransform.h.
typedef Superclass::DirectionType itk::BSplineTransform< TScalarType, NDimensions, VSplineOrder >::DirectionType |
Definition at line 211 of file itkBSplineTransform.h.
typedef Superclass::ImagePointer itk::BSplineTransform< TScalarType, NDimensions, VSplineOrder >::ImagePointer |
Definition at line 189 of file itkBSplineTransform.h.
typedef Superclass::ImageType itk::BSplineTransform< TScalarType, NDimensions, VSplineOrder >::ImageType |
Definition at line 188 of file itkBSplineTransform.h.
typedef Superclass::IndexType itk::BSplineTransform< TScalarType, NDimensions, VSplineOrder >::IndexType |
Definition at line 208 of file itkBSplineTransform.h.
typedef Superclass::InputCovariantVectorType itk::BSplineTransform< TScalarType, NDimensions, VSplineOrder >::InputCovariantVectorType |
Standard covariant vector type for this class.
Definition at line 149 of file itkBSplineTransform.h.
typedef Superclass::InputPointType itk::BSplineTransform< TScalarType, NDimensions, VSplineOrder >::InputPointType |
Standard coordinate point type for this class.
Definition at line 157 of file itkBSplineTransform.h.
typedef Superclass::InputVectorType itk::BSplineTransform< TScalarType, NDimensions, VSplineOrder >::InputVectorType |
Standard vector type for this class.
Definition at line 145 of file itkBSplineTransform.h.
typedef Superclass::InputVnlVectorType itk::BSplineTransform< TScalarType, NDimensions, VSplineOrder >::InputVnlVectorType |
Standard vnl_vector type for this class.
Definition at line 153 of file itkBSplineTransform.h.
typedef Superclass::JacobianType itk::BSplineTransform< TScalarType, NDimensions, VSplineOrder >::JacobianType |
Standard Jacobian container.
Definition at line 139 of file itkBSplineTransform.h.
typedef Superclass::MeshSizeType itk::BSplineTransform< TScalarType, NDimensions, VSplineOrder >::MeshSizeType |
Definition at line 247 of file itkBSplineTransform.h.
typedef Superclass::NumberOfParametersType itk::BSplineTransform< TScalarType, NDimensions, VSplineOrder >::NumberOfParametersType |
The number of parameters defininig this transform.
Definition at line 142 of file itkBSplineTransform.h.
typedef Superclass::OriginType itk::BSplineTransform< TScalarType, NDimensions, VSplineOrder >::OriginType |
Definition at line 212 of file itkBSplineTransform.h.
typedef Superclass::OutputCovariantVectorType itk::BSplineTransform< TScalarType, NDimensions, VSplineOrder >::OutputCovariantVectorType |
Definition at line 150 of file itkBSplineTransform.h.
typedef Superclass::OutputPointType itk::BSplineTransform< TScalarType, NDimensions, VSplineOrder >::OutputPointType |
Definition at line 158 of file itkBSplineTransform.h.
typedef Superclass::OutputVectorType itk::BSplineTransform< TScalarType, NDimensions, VSplineOrder >::OutputVectorType |
Definition at line 146 of file itkBSplineTransform.h.
typedef Superclass::OutputVnlVectorType itk::BSplineTransform< TScalarType, NDimensions, VSplineOrder >::OutputVnlVectorType |
Definition at line 154 of file itkBSplineTransform.h.
typedef Superclass::ParameterIndexArrayType itk::BSplineTransform< TScalarType, NDimensions, VSplineOrder >::ParameterIndexArrayType |
Parameter index array type.
Definition at line 221 of file itkBSplineTransform.h.
typedef Superclass::ParametersType itk::BSplineTransform< TScalarType, NDimensions, VSplineOrder >::ParametersType |
Standard parameters container.
Definition at line 136 of file itkBSplineTransform.h.
typedef Superclass::ParametersValueType itk::BSplineTransform< TScalarType, NDimensions, VSplineOrder >::ParametersValueType |
Parameters as SpaceDimension number of images.
Definition at line 187 of file itkBSplineTransform.h.
typedef Superclass::SpacingType itk::BSplineTransform< TScalarType, NDimensions, VSplineOrder >::PhysicalDimensionsType |
Definition at line 244 of file itkBSplineTransform.h.
typedef Superclass::PixelType itk::BSplineTransform< TScalarType, NDimensions, VSplineOrder >::PixelType |
Definition at line 245 of file itkBSplineTransform.h.
typedef SmartPointer<Self> itk::BSplineTransform< TScalarType, NDimensions, VSplineOrder >::Pointer |
Definition at line 117 of file itkBSplineTransform.h.
typedef Superclass::RegionType itk::BSplineTransform< TScalarType, NDimensions, VSplineOrder >::RegionType |
Typedefs for specifying the extent of the grid.
Definition at line 206 of file itkBSplineTransform.h.
typedef Superclass::ScalarType itk::BSplineTransform< TScalarType, NDimensions, VSplineOrder >::ScalarType |
Standard scalar type for this class.
Definition at line 133 of file itkBSplineTransform.h.
typedef BSplineTransform itk::BSplineTransform< TScalarType, NDimensions, VSplineOrder >::Self |
Standard class typedefs.
Definition at line 115 of file itkBSplineTransform.h.
typedef Superclass::SizeType itk::BSplineTransform< TScalarType, NDimensions, VSplineOrder >::SizeType |
Definition at line 209 of file itkBSplineTransform.h.
typedef Superclass::SpacingType itk::BSplineTransform< TScalarType, NDimensions, VSplineOrder >::SpacingType |
Definition at line 210 of file itkBSplineTransform.h.
typedef BSplineBaseTransform<TScalarType,NDimensions,VSplineOrder> itk::BSplineTransform< TScalarType, NDimensions, VSplineOrder >::Superclass |
Definition at line 116 of file itkBSplineTransform.h.
typedef Superclass::WeightsFunctionType itk::BSplineTransform< TScalarType, NDimensions, VSplineOrder >::WeightsFunctionType |
Interpolation weights function type.
Definition at line 215 of file itkBSplineTransform.h.
typedef Superclass::WeightsType itk::BSplineTransform< TScalarType, NDimensions, VSplineOrder >::WeightsType |
Definition at line 217 of file itkBSplineTransform.h.
|
protected |
|
protectedvirtual |
|
private |
|
virtual |
|
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.
|
virtual |
Run-time type information (and related methods).
Reimplemented from itk::BSplineBaseTransform< TScalarType, NDimensions, VSplineOrder >.
|
virtual |
Return the number of parameters that completely define the Transfom
Implements itk::BSplineBaseTransform< TScalarType, NDimensions, VSplineOrder >.
|
virtual |
Return the number of parameters per dimension
Implements itk::BSplineBaseTransform< TScalarType, NDimensions, VSplineOrder >.
|
virtual |
Function to retrieve the transform domain direction.
|
virtual |
Function to retrieve the transform domain mesh size.
|
virtual |
Function to retrieve the transform domain origin.
|
virtual |
Function to retrieve the transform domain physical dimensions.
|
privatevirtual |
Check if a continuous index is inside the valid region.
Implements itk::BSplineBaseTransform< TScalarType, NDimensions, VSplineOrder >.
|
static |
New macro for creation of through the object factory.
|
private |
|
protectedvirtual |
Print contents of an BSplineTransform.
Reimplemented from itk::BSplineBaseTransform< TScalarType, NDimensions, VSplineOrder >.
|
privatevirtual |
Construct control point grid size from transform domain information
Implements itk::BSplineBaseTransform< TScalarType, NDimensions, VSplineOrder >.
|
virtual |
Set the array of coefficient images.
This is an alternative API for setting the BSpline coefficients as an array of SpaceDimension images. The fixed parameters are taken from the first image. It is assumed that the buffered region of all the subsequent images are the same as the first image. Note that no error checking is done.
Warning: use either the SetParameters() or SetCoefficientImages() API. Mixing the two modes may results in unexpected results.
Implements itk::BSplineBaseTransform< TScalarType, NDimensions, VSplineOrder >.
|
virtual |
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< TScalarType, NDimensions, VSplineOrder >.
|
privatevirtual |
Construct control point grid direction from transform domain information
Implements itk::BSplineBaseTransform< TScalarType, NDimensions, VSplineOrder >.
|
privatevirtual |
Construct control point grid origin from transform domain information
Implements itk::BSplineBaseTransform< TScalarType, NDimensions, VSplineOrder >.
|
privatevirtual |
Construct control point grid size from transform domain information
Implements itk::BSplineBaseTransform< TScalarType, NDimensions, VSplineOrder >.
|
privatevirtual |
Construct control point grid spacing from transform domain information
Implements itk::BSplineBaseTransform< TScalarType, NDimensions, VSplineOrder >.
|
virtual |
Function to specify the transform domain direction.
|
virtual |
Function to specify the transform domain mesh size.
|
virtual |
Function to specify the transform domain origin.
|
virtual |
Function to specify the transform domain physical dimensions.
|
virtual |
Transform points by a BSpline deformable transformation. On return, weights contains the interpolation weights used to compute the deformation and indices of the x (zeroth) dimension coefficient parameters in the support region used to compute the deformation. Parameter indices for the i-th dimension can be obtained by adding ( i * this->GetNumberOfParametersPerDimension() ) to the indices array.
Implements itk::BSplineBaseTransform< TScalarType, NDimensions, VSplineOrder >.
|
private |
Definition at line 305 of file itkBSplineTransform.h.
|
private |
Definition at line 306 of file itkBSplineTransform.h.
|
private |
Definition at line 308 of file itkBSplineTransform.h.
|
private |
Definition at line 303 of file itkBSplineTransform.h.
|
private |
Definition at line 304 of file itkBSplineTransform.h.
|
static |
Dimension of the domain space.
Definition at line 127 of file itkBSplineTransform.h.
|
static |
The BSpline order.
Definition at line 130 of file itkBSplineTransform.h.