#include <itkBSplineDeformableTransform.h>
Inheritance diagram for itk::BSplineDeformableTransform< TScalarType, NDimensions, VSplineOrder >:


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 BSpline 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 BSplineDeformableTransform<double,2,3> TransformType; * TransformType::Pointer 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 SetCoefficientImage() 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 111 of file itkBSplineDeformableTransform.h.
Public Types | |
| typedef BulkTransformType::ConstPointer | BulkTransformPointer |
| typedef SmartPointer< const Self > | ConstPointer |
| typedef WeightsFunctionType::ContinuousIndexType | ContinuousIndexType |
| typedef ImageType::Pointer | ImagePointer |
| typedef Image< PixelType, itkGetStaticConstMacro(SpaceDimension) | ImageType ) |
| typedef RegionType::IndexType | IndexType |
| typedef Superclass::JacobianType | JacobianType |
| typedef ImageType::PointType | OriginType |
| typedef CovariantVector< TScalarType, itkGetStaticConstMacro(SpaceDimension) | OutputCovariantVectorType ) |
| typedef Point< TScalarType, itkGetStaticConstMacro(SpaceDimension) | OutputPointType ) |
| typedef Vector< TScalarType, itkGetStaticConstMacro(SpaceDimension) | OutputVectorType ) |
| typedef vnl_vector_fixed< TScalarType, itkGetStaticConstMacro(SpaceDimension) | OutputVnlVectorType ) |
| typedef Array< unsigned long > | ParameterIndexArrayType |
| typedef Superclass::ParametersType | ParametersType |
| typedef ParametersType::ValueType | PixelType |
| typedef SmartPointer< Self > | Pointer |
| typedef ImageRegion< itkGetStaticConstMacro(SpaceDimension) | RegionType ) |
| typedef Superclass::ScalarType | ScalarType |
| typedef BSplineDeformableTransform | Self |
| typedef RegionType::SizeType | SizeType |
| typedef ImageType::SpacingType | SpacingType |
| typedef Transform< TScalarType, NDimensions, NDimensions > | Superclass |
| typedef WeightsFunctionType::WeightsType | WeightsType |
Public Member Functions | |
| virtual LightObject::Pointer | CreateAnother () const |
| virtual void | DebugOff () const |
| virtual void | DebugOn () const |
| virtual void | Delete () |
| virtual const BulkTransformType * | GetBulkTransform () |
| virtual ImagePointer * | GetCoefficientImage () |
| Command * | GetCommand (unsigned long tag) |
| bool | GetDebug () const |
| virtual const ParametersType & | GetFixedParameters (void) const |
| virtual OriginType | GetGridOrigin () const |
| virtual OriginType | GetGridOrigin () |
| virtual RegionType | GetGridRegion () const |
| virtual RegionType | GetGridRegion () |
| virtual SpacingType | GetGridSpacing () const |
| virtual SpacingType | GetGridSpacing () |
| unsigned int | GetInputSpaceDimension (void) const |
| bool | GetInverse (Self *) const |
| virtual const JacobianType & | GetJacobian (const InputPointType &point) const |
| const MetaDataDictionary & | GetMetaDataDictionary (void) const |
| MetaDataDictionary & | GetMetaDataDictionary (void) |
| virtual unsigned long | GetMTime () const |
| virtual const char * | GetNameOfClass () const |
| virtual unsigned int | GetNumberOfParameters (void) const |
| unsigned int | GetNumberOfParametersPerDimension (void) const |
| unsigned long | GetNumberOfWeights () const |
| unsigned int | GetOutputSpaceDimension (void) const |
| virtual const ParametersType & | GetParameters (void) const |
| virtual int | GetReferenceCount () const |
| virtual std::string | GetTransformTypeAsString () const |
| virtual const RegionType & | GetValidRegion () |
| bool | HasObserver (const EventObject &event) const |
| void | InvokeEvent (const EventObject &) const |
| void | InvokeEvent (const EventObject &) |
| itkStaticConstMacro (OutputSpaceDimension, unsigned int, NOutputDimensions) | |
| Dimension of the domain space * | itkStaticConstMacro (InputSpaceDimension, unsigned int, NInputDimensions) |
| itkStaticConstMacro (SplineOrder, unsigned int, VSplineOrder) | |
| itkStaticConstMacro (SpaceDimension, unsigned int, NDimensions) | |
| virtual void | Modified () const |
| void | Print (std::ostream &os, Indent indent=0) const |
| virtual void | Register () const |
| void | RemoveAllObservers () |
| void | RemoveObserver (unsigned long tag) |
| This method specifies the bulk transform to be applied *The default is the identity transform *virtual void | SetBulkTransform (const BulkTransformType *_arg) |
| virtual void | SetCoefficientImage (ImagePointer images[]) |
| void | SetDebug (bool debugFlag) const |
| **This function was added to allow the transform to work with the *itkTransformReader Writer I O filters **void | SetFixedParameters (const ParametersType ¶meters) |
| This method specifies the grid origin *virtual void | SetGridOrigin (const OriginType &origin) |
| *transform | SetGridOrigin (origin) |
| This method specifies the region over which the grid resides *virtual void | SetGridRegion (const RegionType ®ion) |
| *transform | SetGridRegion (bsplineRegion) |
| This method specifies the grid spacing or resolution *virtual void | SetGridSpacing (const SpacingType &spacing) |
| void | SetIdentity () |
| void | SetMetaDataDictionary (const MetaDataDictionary &rhs) |
| void | SetParameters (const ParametersType ¶meters) |
| void | SetParametersByValue (const ParametersType ¶meters) |
| virtual void | SetReferenceCount (int) |
| Method to transform a CovariantVector *not applicable for this type of transform *virtual OutputCovariantVectorType | TransformCovariantVector (const InputCovariantVectorType &) const |
| virtual void | TransformPoint (const InputPointType &inputPoint, OutputPointType &outputPoint, WeightsType &weights, ParameterIndexArrayType &indices, bool &inside) const |
| OutputPointType | TransformPoint (const InputPointType &point) const |
| Method to transform a vnl_vector *not applicable for this type of transform *virtual OutputVnlVectorType | TransformVector (const InputVnlVectorType &) const |
| Method to transform a vector *not applicable for this type of transform *virtual OutputVectorType | TransformVector (const InputVectorType &) const |
| virtual void | UnRegister () const |
Static Public Member Functions | |
| static void | BreakOnError () |
| static bool | GetGlobalWarningDisplay () |
| static void | GlobalWarningDisplayOff () |
| static void | GlobalWarningDisplayOn () |
| static Pointer | New () |
| This is a global flag that controls whether any warning *or error messages are displayed *static void | SetGlobalWarningDisplay (bool flag) |
Public Attributes | |
| Allow people to add remove invoke observers(callbacks) to any ITK *object.This is an implementation of the subject/observer design *pattern.An observer is added by specifying an event to respond to *and an itk unsigned lon | AddObserver )(const EventObject &event, Command *) const |
| Typedef of the bulk transform *typedef Transform< ScalarType, itkGetStaticConstMacro(SpaceDimension), itkGetStaticConstMacro(SpaceDimension) | BulkTransformType ) |
| This method sets the fixed parameters of the transform *For a BSpline deformation the parameters are the Grid and Grid Spacing **The fixed parameters are the three times the size of the templated *dimensions *This function has the effect of make the following | calls: * transform->SetGridSpacing( spacing ) |
| This is a global flag that controls whether any | debug |
| This method sets the fixed parameters of the transform *For a BSpline deformation the parameters are the | following: * Grid Size |
| Standard covariant vector type for this class *typedef CovariantVector< TScalarType, itkGetStaticConstMacro(SpaceDimension) | InputCovariantVectorType ) |
| Standard coordinate point type for this class *typedef Point< TScalarType, itkGetStaticConstMacro(SpaceDimension) | InputPointType ) |
| Standard vector type for this class *typedef Vector< TScalarType, itkGetStaticConstMacro(SpaceDimension) | InputVectorType ) |
| Standard vnl_vector type for this class *typedef vnl_vector_fixed< TScalarType, itkGetStaticConstMacro(SpaceDimension) | InputVnlVectorType ) |
| return | m_Jacobian |
| This method sets the fixed parameters of the transform *For a BSpline deformation the parameters are the Grid | Origin |
| This method sets the fixed parameters of the transform *For a BSpline deformation | transform |
| Interpolation weights function type *typedef BSplineInterpolationWeightFunction< ScalarType, itkGetStaticConstMacro(SpaceDimension), itkGetStaticConstMacro(SplineOrder) | WeightsFunctionType ) |
Protected Member Functions | |
| BSplineDeformableTransform () | |
| virtual WeightsFunctionType * | GetWeightsFunction () |
| bool | PrintObservers (std::ostream &os, Indent indent) const |
| void | PrintSelf (std::ostream &os, Indent indent) const |
| virtual void | PrintTrailer (std::ostream &os, Indent indent) const |
| Allow subclasses to access and manipulate the weights function *virtual void | SetWeightsFunction (WeightsFunctionType *_arg) |
| Transform (unsigned int Dimension, unsigned int NumberOfParameters) | |
| Transform () | |
| void | WrapAsImages () |
| virtual | ~BSplineDeformableTransform () |
Protected Attributes | |
| ParametersType | m_FixedParameters |
| JacobianType | m_Jacobian |
| ParametersType | m_Parameters |
| int | m_ReferenceCount |
| SimpleFastMutexLock | m_ReferenceCountLock |
| Methods invoked by virtual Print() to print information about the object *including superclasses.Typically not called by the user(use Print()*instead) but used in the hierarchical print process to combine the *output of several classes.*/virtual void PrintSelf(std voi | PrintHeader )(std::ostream &os, Indent indent) const |
|
|||||
|
Definition at line 296 of file itkBSplineDeformableTransform.h. |
|
|||||
|
Reimplemented from itk::Transform< TScalarType, NDimensions, NDimensions >. Definition at line 119 of file itkBSplineDeformableTransform.h. |
|
|||||
|
Definition at line 315 of file itkBSplineDeformableTransform.h. |
|
|||||
|
Definition at line 247 of file itkBSplineDeformableTransform.h. |
|
|||||
|
Definition at line 246 of file itkBSplineDeformableTransform.h. |
|
|||||
|
Definition at line 270 of file itkBSplineDeformableTransform.h. |
|
|||||
|
Standard Jacobian container. Reimplemented from itk::Transform< TScalarType, NDimensions, NDimensions >. Definition at line 140 of file itkBSplineDeformableTransform.h. |
|
|||||
|
Definition at line 273 of file itkBSplineDeformableTransform.h. |
|
|||||
|
Reimplemented from itk::Transform< TScalarType, NDimensions, NDimensions >. Definition at line 153 of file itkBSplineDeformableTransform.h. |
|
|||||
|
Reimplemented from itk::Transform< TScalarType, NDimensions, NDimensions >. Definition at line 167 of file itkBSplineDeformableTransform.h. |
|
|||||
|
Reimplemented from itk::Transform< TScalarType, NDimensions, NDimensions >. Definition at line 146 of file itkBSplineDeformableTransform.h. |
|
|||||
|
Reimplemented from itk::Transform< TScalarType, NDimensions, NDimensions >. Definition at line 160 of file itkBSplineDeformableTransform.h. |
|
|||||
|
Parameter index array type. Definition at line 319 of file itkBSplineDeformableTransform.h. |
|
|||||
|
Standard parameters container. Reimplemented from itk::Transform< TScalarType, NDimensions, NDimensions >. Definition at line 137 of file itkBSplineDeformableTransform.h. |
|
|||||
|
Parameters as SpaceDimension number of images. Definition at line 245 of file itkBSplineDeformableTransform.h. |
|
|||||
|
Reimplemented from itk::Transform< TScalarType, NDimensions, NDimensions >. Definition at line 118 of file itkBSplineDeformableTransform.h. |
|
|||||
|
Typedefs for specifying the extend to the grid. Definition at line 268 of file itkBSplineDeformableTransform.h. |
|
|||||
|
Standard scalar type for this class. Reimplemented from itk::Transform< TScalarType, NDimensions, NDimensions >. Definition at line 134 of file itkBSplineDeformableTransform.h. |
|
|||||
|
Standard class typedefs. Reimplemented from itk::Transform< TScalarType, NDimensions, NDimensions >. Definition at line 116 of file itkBSplineDeformableTransform.h. |
|
|||||
|
Definition at line 271 of file itkBSplineDeformableTransform.h. |
|
|||||
|
Definition at line 272 of file itkBSplineDeformableTransform.h. |
|
|||||
|
Reimplemented from itk::Transform< TScalarType, NDimensions, NDimensions >. Definition at line 117 of file itkBSplineDeformableTransform.h. |
|
|||||
|
Definition at line 313 of file itkBSplineDeformableTransform.h. |
|
|||||||||
|
|
|
|||||||||
|
|
|
|
This method is called when itkExceptionMacro executes. It allows the debugger to break on error. |
|
|
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::LightObject. |
|
|
Turn debugging output off. |
|
|
Turn debugging output on. |
|
|
Delete an itk object. This method should always be used to delete an object when the new operator was used to create it. Using the C delete method will not work with reference counting. |
|
|||||||||
|
|
|
|||||||||
|
Get the array of coefficient images. Definition at line 250 of file itkBSplineDeformableTransform.h. |
|
|
Get the command associated with the given tag. NOTE: This returns a pointer to a Command, but it is safe to asign this to a Command::Pointer. Since Command inherits from LightObject, at this point in the code, only a pointer or a reference to the Command can be used. |
|
|
Get the value of the debug flag. |
|
||||||||||
|
Get the Transformation Fixed Parameters. Reimplemented from itk::Transform< TScalarType, NDimensions, NDimensions >. |
|
|
|
|
|||||||||
|
|
|
|||||||||
|
|
|
|||||||||
|
|
|
|||||||||
|
|
|
|||||||||
|
|
|
|||||||||
|
|
|
|
Get the size of the input space Implements itk::TransformBase. Definition at line 87 of file itkTransform.h. |
|
|
Return the inverse of the transform. The inverse is recomputed if it has been modified Reimplemented in itk::ScaleTransform< TScalarType, NDimensions >, and itk::TranslationTransform< TScalarType, NDimensions >. Definition at line 209 of file itkTransform.h. |
|
||||||||||
|
Compute the Jacobian Matrix of the transformation at one point |
|
|
|
|
|
|
|
|
|||||||||
|
Run-time type information (and related methods). Reimplemented from itk::Transform< TScalarType, NDimensions, NDimensions >. |
|
||||||||||
|
Return the number of parameters that completely define the Transfom Reimplemented from itk::Transform< TScalarType, NDimensions, NDimensions >. |
|
||||||||||
|
Return the number of parameters per dimension |
|
|||||||||
|
Get number of weights. Definition at line 335 of file itkBSplineDeformableTransform.h. |
|
|
Get the size of the output space Implements itk::TransformBase. Definition at line 90 of file itkTransform.h. |
|
||||||||||
|
Get the Transformation Parameters. Reimplemented from itk::Transform< TScalarType, NDimensions, NDimensions >. |
|
|
Gets the reference count on this object. Definition at line 98 of file itkLightObject.h. |
|
|
Generate a platform independant name Implements itk::TransformBase. |
|
|||||||||
|
Return the region of the grid wholly within the support region |
|
|||||||||
|
|
|
|
Definition at line 100 of file itkObject.h. References itk::Object::SetGlobalWarningDisplay(). |
|
|
Definition at line 98 of file itkObject.h. References itk::Object::SetGlobalWarningDisplay(). |
|
|
Return true if an observer is registered for this event. |
|
|
Call Execute on all the Commands observing this event id. The actions triggered by this call doesn't modify this object. |
|
|
Call Execute on all the Commands observing this event id. |
|
||||||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||||||||||
|
The BSpline order. |
|
||||||||||||||||||||
|
Dimension of the domain space. |
|
|
|||||||||
|
New macro for creation of through the object factory. Reimplemented from itk::Transform< TScalarType, NDimensions, NDimensions >. |
|
||||||||||||
|
Cause the object to print itself out. |
|
||||||||||||
|
|
|
||||||||||||||||
|
Print contents of an BSplineDeformableTransform. Reimplemented from itk::Object. |
|
||||||||||||
|
|
|
|
Increase the reference count (mark as used by another object). Reimplemented from itk::LightObject. |
|
|
Remove all observers . |
|
|
Remove the observer with this tag value. |
|
||||||||||
|
|
|
||||||||||
|
Set the array of coefficient images. This is an alternative API for setting the BSpline coefficients as an array of SpaceDimension images. The grid region spacing and origin is taken from the first image. It is assume 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 SetCoefficientImage() API. Mixing the two modes may results in unexpected results. |
|
|
Set the value of the debug flag. A non-zero value turns debugging on. |
|
||||||||||
|
Set the fixed parameters and update internal transformation. Reimplemented from itk::Transform< TScalarType, NDimensions, NDimensions >. |
|
|
Referenced by itk::Object::GlobalWarningDisplayOff(), and itk::Object::GlobalWarningDisplayOn(). |
|
||||||||||
|
|
|
||||||||||
|
|
|
||||||||||
|
|
|
||||||||||
|
|
|
||||||||||
|
|
|
|||||||||
|
This method can ONLY be invoked AFTER calling SetParameters(). This restriction is due to the fact that the BSplineDeformableTransform does not copy the array of paramters internally, instead it keeps a pointer to the user-provided array of parameters. This method is also in violation of the const-correctness of the parameters since the parameter array has been passed to the transform on a 'const' basis but the values get modified when the user invokes SetIdentity(). |
|
|
|
|
||||||||||
|
This method sets the parameters of the transform. For a BSpline deformation transform, the parameters are the BSpline coefficients on a sparse grid. The parameters are N number of N-D grid of coefficients. Each N-D grid is represented as a flat array of doubles (in the same configuration as an itk::Image). The N arrays are then concatenated to form one parameter array. For efficiency, this transform does not make a copy of the parameters. It only keeps a pointer to the input parameters. It assumes that the memory is managed by the caller. Use SetParametersByValue to force the transform to call copy the parameters. This method wraps each grid as itk::Image's using the user specified grid region, spacing and origin. NOTE: The grid region, spacing and origin must be set first. Reimplemented from itk::Transform< TScalarType, NDimensions, NDimensions >. |
|
||||||||||
|
This method sets the parameters of the transform. For a BSpline deformation transform, the parameters are the BSpline coefficients on a sparse grid. The parameters are N number of N-D grid of coefficients. Each N-D grid is represented as a flat array of doubles (in the same configuration as an itk::Image). The N arrays are then concatenated to form one parameter array. This methods makes a copy of the parameters while for efficiency the SetParameters method does not. This method wraps each grid as itk::Image's using the user specified grid region, spacing and origin. NOTE: The grid region, spacing and origin must be set first. Reimplemented from itk::Transform< TScalarType, NDimensions, NDimensions >. |
|
|
Sets the reference count (use with care) Reimplemented from itk::LightObject. |
|
||||||||||
|
|
|
||||||||||||
|
|
|
|
|
|
||||||||||
|
Method to transform a CovariantVector. Reimplemented from itk::Transform< TScalarType, NDimensions, NDimensions >. Definition at line 358 of file itkBSplineDeformableTransform.h. References itkExceptionMacro. |
|
||||||||||||||||||||||||||||
|
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. |
|
||||||||||
|
Transform points by a BSpline deformable transformation. Reimplemented from itk::Transform< TScalarType, NDimensions, NDimensions >. |
|
||||||||||
|
Method to transform a vnl_vector. Reimplemented from itk::Transform< TScalarType, NDimensions, NDimensions >. Definition at line 349 of file itkBSplineDeformableTransform.h. References itkExceptionMacro. |
|
||||||||||
|
Method to transform a vector. Reimplemented from itk::Transform< TScalarType, NDimensions, NDimensions >. Definition at line 340 of file itkBSplineDeformableTransform.h. References itkExceptionMacro. |
|
|
Decrease the reference count (release by another object). Reimplemented from itk::LightObject. |
|
|||||||||
|
Wrap flat array into images of coefficients. |
|
|
|
|
|||||
|
Definition at line 290 of file itkBSplineDeformableTransform.h. |
|
|||||
|
Definition at line 192 of file itkBSplineDeformableTransform.h. |
|
|
Definition at line 94 of file itkObject.h. |
|
|||||
|
Definition at line 192 of file itkBSplineDeformableTransform.h. |
|
|||||
|
Standard covariant vector type for this class Reimplemented from itk::Transform< TScalarType, NDimensions, NDimensions >. Definition at line 151 of file itkBSplineDeformableTransform.h. |
|
|||||
|
Standard coordinate point type for this class Reimplemented from itk::Transform< TScalarType, NDimensions, NDimensions >. Definition at line 165 of file itkBSplineDeformableTransform.h. |
|
|||||
|
Standard vector type for this class. Reimplemented from itk::Transform< TScalarType, NDimensions, NDimensions >. Definition at line 144 of file itkBSplineDeformableTransform.h. |
|
|||||
|
Standard vnl_vector type for this class. Reimplemented from itk::Transform< TScalarType, NDimensions, NDimensions >. Definition at line 158 of file itkBSplineDeformableTransform.h. |
|
|
Definition at line 221 of file itkTransform.h. |
|
|
Reimplemented in itk::IdentityTransform< TScalarType, NDimensions >. Definition at line 222 of file itkTransform.h. |
|
|
Reimplemented in itk::IdentityTransform< TScalarType, NDimensions >. Definition at line 199 of file itkTransform.h. |
|
|
Definition at line 217 of file itkTransform.h. |
|
|
Number of uses of this object by other objects. Definition at line 119 of file itkLightObject.h. |
|
|
Mutex lock to protect modification to the reference count Definition at line 122 of file itkLightObject.h. |
|
|||||
|
Definition at line 192 of file itkBSplineDeformableTransform.h. |
|
|
|
|
|||||
|
Reimplemented from itk::Transform< TScalarType, NDimensions, NDimensions >. Definition at line 192 of file itkBSplineDeformableTransform.h. |
|
|||||
|
Definition at line 312 of file itkBSplineDeformableTransform.h. |
1.4.2 written by Dimitri van Heesch,
© 1997-2000