Classes | Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | Friends

cmtk::SplineWarpXform Class Reference
[cmtkBase Library]

B-spline-based local deformation. More...

#include <cmtkSplineWarpXform.h>

Inheritance diagram for cmtk::SplineWarpXform:
Inheritance graph
[legend]
Collaboration diagram for cmtk::SplineWarpXform:
Collaboration graph
[legend]

List of all members.

Classes

struct  JacobianConstraintThreadInfo
 Thread parameter block for volume resampling. More...

Public Types

typedef SplineWarpXform Self
 This class.
typedef WarpXform Superclass
 Parent class.
typedef SmartPointer< SelfSmartPtr
 Smart pointer to SplineWarpXform.
typedef SmartConstPointer< SelfSmartConstPtr
 Smart pointer to const SplineWarpXform.

Public Member Functions

 SplineWarpXform ()
 Construct empty new warp.
 SplineWarpXform (const FixedVector< 3, Types::Coordinate > &domain, const Types::Coordinate delta, const AffineXform *initialXform=NULL, const bool exactDelta=false)
 Construct new warp from volume size and control grid density.
void Init (const Self::SpaceVectorType &domain, const Types::Coordinate delta, const AffineXform *initialXform=NULL, const bool exactDelta=false)
 Initialize warp from volume size and control grid density.
 SplineWarpXform (const FixedVector< 3, Types::Coordinate > &domain, const Self::IndexType &dims, CoordinateVector::SmartPtr &parameters, const AffineXform *initialXform=NULL)
 Construct new warp from volume size, grid dimensions and parameters.
Self::SmartPtr Clone () const
 Clone and return smart pointer.
void InitControlPoints (const AffineXform *affineXform=NULL)
 Initialize control point positions, potentially with affine displacement.
virtual void Update (const bool exactDelta=false)
 Update internal representation.
virtual SplineWarpXformMakeInverse () const
 Create inverse transformation.
virtual void Refine ()
 Refine control point grid by a factor of two, but maintain transformation exactly.
virtual Types::Coordinate GetGridEnergy () const
 Return grid bending energy.
virtual Types::Coordinate GetGridEnergy (const Types::Coordinate *cp) const
 Return grid bending energy at one control point.
virtual Types::Coordinate GetGridEnergy (const Self::SpaceVectorType &v) const
 Return grid bending energy at arbitrary location.
virtual void GetGridEnergyDerivative (double &lower, double &upper, const int param, const Types::Coordinate step) const
 Return derivative of grid energy with respect to one parameter.
virtual Types::Coordinate GetJacobianDeterminant (const Self::SpaceVectorType &v) const
 Compute Jacobian determinant at a certain location.
virtual Types::Coordinate GetJacobianDeterminant (const int x, const int y, const int z) const
 Compute Jacobian determinant at a certain reference image pixel.
virtual void GetJacobianDeterminantRow (double *const values, const int x, const int y, const int z, const size_t numberOfPoints=1) const
 Compute sequence of Jacobian determinants from given grid location.
Types::Coordinate JacobianDeterminant (const Types::Coordinate *cp) const
 Compute Jacobian determinant at a certain control point.
virtual Types::Coordinate GetJacobianConstraint () const
 Return Jacobian constraint of the current transformation grid.
virtual Types::Coordinate GetJacobianFoldingConstraint () const
 Return Jacobian folding constraint of the current transformation grid.
virtual void RelaxToUnfold ()
 Relax the deformation to unfold areas with negative Jacobian at the current image sampling.
virtual Types::Coordinate GetRigidityConstraint () const
 Return rigidity constraint of the current transformation grid.
virtual Types::Coordinate GetRigidityConstraint (const DataGrid *weightMap) const
 Return rigidity constraint of the current transformation grid with local weights.
virtual Types::Coordinate GetJacobianConstraintSparse () const
 Return sparse Jacobian constraint of the current transformation grid.
virtual Types::Coordinate GetRigidityConstraintSparse () const
 Return sparse rigidity constraint of the current transformation grid.
virtual void GetJacobianConstraintDerivative (double &lower, double &upper, const int param, const UniformVolume::RegionType &, const Types::Coordinate step) const
 Return derivative of Jacobian constraint with respect to one parameter.
virtual void GetJacobianFoldingConstraintDerivative (double &lower, double &upper, const int param, const UniformVolume::RegionType &, const Types::Coordinate step) const
 Return derivative of Jacobian constraint with respect to one parameter.
virtual void GetJacobianConstraintDerivative (double &lower, double &upper, const int param, const Types::Coordinate step) const
 Return derivative of Jacobian constraint with respect to one parameter.
virtual void GetRigidityConstraintDerivative (double &lower, double &upper, const int param, const UniformVolume::RegionType &, const Types::Coordinate step) const
 Return derivative of rigidity constraint with respect to one parameter.
virtual void GetRigidityConstraintDerivative (double &lower, double &upper, const int param, const UniformVolume::RegionType &, const Types::Coordinate step, const DataGrid *weightMap) const
 Return derivative of rigidity constraint with respect to one parameter.
virtual void GetRigidityConstraintDerivative (double &lower, double &upper, const int param, const Types::Coordinate step) const
 Return derivative of rigidity constraint with respect to one parameter.
virtual Types::Coordinate GetInverseConsistencyError (const WarpXform *inverse, const UniformVolume *volume, const UniformVolume::RegionType *voi=NULL) const
 Return inverse consistency.
virtual bool ApplyInverse (const Self::SpaceVectorType &v, Self::SpaceVectorType &u, const Types::Coordinate accuracy=0.01) const
 Return origin of warped vector.
virtual bool ApplyInverseInPlace (Self::SpaceVectorType &v, const Types::Coordinate accuracy=0.01) const
 Return origin of warped vector.
virtual bool ApplyInverseInPlaceWithInitial (Self::SpaceVectorType &v, const Self::SpaceVectorType &initial, const Types::Coordinate accuracy=0.01) const
 Return origin of warped vector.
virtual void ApplyInPlace (Self::SpaceVectorType &v) const
 Replace existing vector with transformed location.
virtual void GetVolumeOfInfluence (const size_t idx, const Self::SpaceVectorType &, const Self::SpaceVectorType &, Self::SpaceVectorType &, Self::SpaceVectorType &, const int=-1) const
 Get volume influenced by one parameter.
void RegisterVolume (const UniformVolume *volume)
 Register the grid points of the deformed uniform or non-uniform volume.
void UnRegisterVolume ()
 Unegister axes points, ie free all internal data structures.
void GetTransformedGrid (Self::SpaceVectorType &v, const int idxX, const int idxY, const int idxZ) const
 Get a grid point from the deformed grid.
void GetTransformedGridRow (const int numPoints, Self::SpaceVectorType *const v, const int idxX, const int idxY, const int idxZ) const
 Get a sequence of grid points from the deformed grid.
virtual Types::Coordinate GetParamStep (const size_t idx, const Self::SpaceVectorType &volSize, const Types::Coordinate mmStep=1) const
 Get parameter stepping.
virtual Self::SpaceVectorTypeGetDeformedControlPointPosition (Self::SpaceVectorType &, const int, const int, const int) const
 Get the deformed position of a transformation control point.
Types::CoordinateGetPureDeformation (const bool includeScale=false) const
 Return array of pre deformation vectors.
virtual CoordinateMatrix3x3 GetJacobian (const Self::SpaceVectorType &v) const
 Get local Jacobian.
virtual void GetJacobian (const Self::SpaceVectorType &v, CoordinateMatrix3x3 &J) const
 Get local Jacobian into existing matrix.
virtual void GetJacobianAtControlPoint (const Types::Coordinate *cp, CoordinateMatrix3x3 &J) const
 Get local Jacobian at control point into existing matrix.
virtual void GetJacobianRow (CoordinateMatrix3x3 *const array, const int x, const int y, const int z, const size_t numberOfPoints) const
 Get sequence of Jacobians for pixel row.

Protected Member Functions

virtual SplineWarpXformCloneVirtual () const
 Clone transformation.
void Init ()
 Initialize internal data structures.
void FindClosestControlPoint (const Self::SpaceVectorType &v, Self::SpaceVectorType &cp) const
 Find nearest (after deformation) control point.

Static Protected Member Functions

static void GetJacobianConstraintThread (void *const args, const size_t taskIdx, const size_t taskCnt, const size_t, const size_t)
 Thread function for SMP Jacobian constraint computation.
static void GetJacobianFoldingConstraintThread (void *const args, const size_t taskIdx, const size_t taskCnt, const size_t, const size_t)
 Thread function for SMP Jacobian folding constraint computation.

Protected Attributes

DataGrid::IndexType VolumeDims
 Dimensions of the volume image linked to this transformation.
int GridPointOffset [48]
 Relative offsets of all control points in a 4 x 4 x 4 neighborhood.
Precomputed grid indices.

These arrays hold the precomputed grid indices of the deformed grid's voxels with respect to the control point grid of this deformation.

std::vector< int > gX
 x-axis.
std::vector< int > gY
 y-axis.
std::vector< int > gZ
 z-axis.
Precomputed spline coefficients.

These arrays hold the precomputed spline coefficients for deforming the voxel locations in the associated deformed grid.

std::vector< Types::CoordinatesplineX
 x-axis.
std::vector< Types::CoordinatesplineY
 y-axis.
std::vector< Types::CoordinatesplineZ
 z-axis.
Precomputed derivative spline coefficients.

These arrays hold the precomputed derivatives of the spline coefficients.

This allows for rapid evaluation of the Jacobian determinant.

std::vector< Types::CoordinatedsplineX
 x-axis.
std::vector< Types::CoordinatedsplineY
 y-axis.
std::vector< Types::CoordinatedsplineZ
 z-axis.

Private Member Functions

void RegisterVolumePoints (const DataGrid::IndexType &, const Self::SpaceVectorType &)
 Register axes points of the volume to be deformed.
void RegisterVolumePoints (const DataGrid::IndexType &, const Self::SpaceVectorType &, const Self::SpaceVectorType &)
 Register axes points of the volume to be deformed.
void RegisterVolumeAxis (const DataGrid::IndexType::ValueType, const Types::Coordinate delta, const Types::Coordinate origin, const int, const Types::Coordinate, std::vector< int > &g, std::vector< Types::Coordinate > &spline, std::vector< Types::Coordinate > &dspline)
 Register a single axis of the uniform volume to be deformed.
Types::Coordinate GetRigidityConstraint (const CoordinateMatrix3x3 &J) const
 Return rigidity constraint based on given Jacobian matrix.

Friends

class SplineWarpXformUniformVolume
 Friend declaration.

Detailed Description

B-spline-based local deformation.

Definition at line 59 of file cmtkSplineWarpXform.h.


Member Typedef Documentation

This class.

Reimplemented from cmtk::WarpXform.

Definition at line 65 of file cmtkSplineWarpXform.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines