Public Member Functions | Protected Member Functions | List of all members
mirtk::BSplineFreeFormTransformationSV Class Reference

#include <BSplineFreeFormTransformationSV.h>

Inheritance diagram for mirtk::BSplineFreeFormTransformationSV:
Inheritance graph
Collaboration diagram for mirtk::BSplineFreeFormTransformationSV:
Collaboration graph

Public Member Functions

virtual double ApproximateAsNew (const ImageAttributes &, const Transformation *, int=1, double=.0)
 Approximate another transformation and return approximation error.
 
virtual double ApproximateAsNew (GenericImage< double > &, int=1, double=.0)
 
virtual double ApproximateAsNew (GenericImage< double > &, bool, int=3, int=8)
 
virtual void ApproximateDOFs (const double *, const double *, const double *, const double *, const double *, const double *, const double *, int)
 
virtual void ApproximateDOFsGradient (const double *, const double *, const double *, const double *, const double *, const double *, const double *, int, double *, double=1.0) const
 
virtual double ApproximateVelocitiesAsNew (GenericImage< double > &)
 
virtual ImageAttributes ApproximationDomain (const ImageAttributes &, const Transformation *)
 
 BSplineFreeFormTransformationSV ()
 Default constructor.
 
 BSplineFreeFormTransformationSV (const ImageAttributes &, double=-1, double=-1, double=-1)
 Construct free-form transformation for given image domain and lattice spacing.
 
 BSplineFreeFormTransformationSV (const BaseImage &, double, double, double)
 Construct free-form transformation for given target image and lattice spacing.
 
 BSplineFreeFormTransformationSV (const GenericImage< double > &, bool=false)
 Construct free-form transformation from existing 3D+t deformation field.
 
 BSplineFreeFormTransformationSV (const BSplineFreeFormTransformationSV &)
 Copy constructor.
 
virtual bool CanRead (TransformationType) const
 Whether this transformation can read a file of specified type (i.e. format)
 
virtual void CombineWith (const Transformation *)
 
virtual void CombineWith (const BSplineFreeFormTransformationSV *)
 
virtual void Displacement (GenericImage< double > &, double, double=NaN, const WorldCoordsImage *=NULL) const
 
virtual void Displacement (GenericImage< float > &, double, double=NaN, const WorldCoordsImage *=NULL) const
 
void Evaluate (double &, double &, double &, double) const
 Evaluates the FFD at a point in lattice coordinates.
 
void EvaluateJacobianDOFs (TransformationJacobian &, double, double) const
 Calculates the Jacobian of the 2D transformation w.r.t. the transformation parameters.
 
void EvaluateJacobianDOFs (TransformationJacobian &, double, double, double) const
 Calculates the Jacobian of the 3D transformation w.r.t. the transformation parameters.
 
void EvaluateJacobianDOFs (TransformationJacobian &, double, double, double, double) const
 Calculates the Jacobian of the transformation w.r.t. the transformation parameters.
 
void EvaluateJacobianWorld (Matrix &, double, double, double, double) const
 
virtual void Initialize (const ImageAttributes &)
 Initialize free-form transformation constructed by default constructor.
 
virtual void Initialize (const ImageAttributes &, double, double, double, const Transformation *)
 Initialize free-form transformation which approximates a given transformation.
 
void IntegrateVelocities (double &, double &, double &, double T=1.0) const
 
virtual void Interpolate (const double *, const double *, const double *)
 
virtual void InterpolateVelocities (const double *, const double *, const double *)
 
virtual int InverseDisplacement (GenericImage< double > &, double, double=NaN, const WorldCoordsImage *=NULL) const
 
virtual int InverseDisplacement (GenericImage< float > &, double, double=NaN, const WorldCoordsImage *=NULL) const
 
virtual void Invert ()
 Invert this transformation.
 
virtual void JacobianDetDerivative (double dJ[3], const Matrix &adj, int cp, double x, double y, double z, double t=0, double t0=NaN, bool wrt_world=true, bool use_spacing=true) const
 
virtual void JacobianDOFs (Matrix &, int, double, double, double, double=0, double=NaN) const
 Calculates the Jacobian of the transformation w.r.t a control point.
 
virtual void JacobianDOFs (double [3], int, double, double, double, double=0, double=NaN) const
 
virtual void JacobianDOFs (TransformationJacobian &, double, double, double, double=0, double=NaN) const
 Calculates the Jacobian of the transformation w.r.t the transformation parameters.
 
virtual void LocalHessian (Matrix [3], double, double, double, double=0, double=NaN) const
 Calculates the Hessian for each component of the local transformation w.r.t world coordinates.
 
virtual bool LocalInverse (double &, double &, double &, double=0, double=NaN) const
 Transforms a single point using the inverse of the local transformation only.
 
virtual void LocalJacobian (Matrix &, double, double, double, double=0, double=NaN) const
 Calculates the Jacobian of the local transformation w.r.t world coordinates.
 
virtual void LocalTransform (double &, double &, double &, double=0, double=NaN) const
 Transforms a single point using the local transformation component only.
 
virtual ParameterList Parameter () const
 Get (non-DoF) parameters as key/value as string map.
 
virtual void ParametricGradient (const GenericImage< double > *, double *, const WorldCoordsImage *, const WorldCoordsImage *, double=-1, double=1) const
 
virtual void ParametricGradient (const PointSet &, const Vector3D< double > *, double *, double=0, double=-1, double=1) const
 
virtual void Print (ostream &, Indent=0) const
 Prints the parameters of the transformation.
 
virtual bool RequiresCachingOfDisplacements () const
 
void ScaleVelocities (double)
 
template<class VoxelType >
void ScalingAndSquaring (GenericImage< VoxelType > *d, double T=1.0, const WorldCoordsImage *wc=NULL) const
 
template<class VoxelType >
void ScalingAndSquaring (const ImageAttributes &attr, GenericImage< VoxelType > *d, GenericImage< VoxelType > *dx, GenericImage< VoxelType > *dj=NULL, GenericImage< VoxelType > *lj=NULL, double T=1.0, const WorldCoordsImage *wc=NULL) const
 
virtual bool Set (const char *, const char *)
 Set named (non-DoF) parameter from value as string.
 
virtual void Subdivide (bool=true, bool=true, bool=true, bool=true)
 Subdivide FFD lattice.
 
double UpperIntegrationLimit (double t, double t0) const
 
void Velocity (GenericImage< float > &) const
 Get stationary velocity field.
 
void Velocity (GenericImage< double > &) const
 Get stationary velocity field.
 
virtual ~BSplineFreeFormTransformationSV ()
 Destructor.
 
- Public Member Functions inherited from mirtk::BSplineFreeFormTransformation3D
void AddApproximateSplineCoefficients (const double *, const double *, const double *, const double *, const double *, const double *, int, double *, double=1., bool=false) const
 
virtual double BendingEnergy (double, double, double, double=0, double=NaN, bool=true) const
 Calculates the bending energy of the transformation.
 
virtual double BendingEnergy (bool=false, bool=true) const
 Approximates the bending energy on the control point lattice.
 
virtual double BendingEnergy (const ImageAttributes &, double=NaN, bool=true) const
 Approximates the bending energy on the specified discrete domain.
 
virtual void BendingEnergyGradient (double *, double=1, bool=false, bool=true, bool=true) const
 
virtual void BoundingBox (int, double &, double &, double &, double &, double &, double &, double=1) const
 
 BSplineFreeFormTransformation3D ()
 Default constructor.
 
 BSplineFreeFormTransformation3D (double, double, double, double, double, double, double, double, double, double *, double *, double *)
 Construct free-form transformation for given image domain and lattice spacing.
 
 BSplineFreeFormTransformation3D (const ImageAttributes &, double=-1, double=-1, double=-1)
 Construct free-form transformation for given image domain and lattice spacing.
 
 BSplineFreeFormTransformation3D (const BaseImage &, double, double, double)
 Construct free-form transformation for given target image and lattice spacing.
 
 BSplineFreeFormTransformation3D (const GenericImage< double > &, bool=false)
 Construct free-form transformation from existing 3D+t deformation field.
 
 BSplineFreeFormTransformation3D (const BSplineFreeFormTransformation3D &)
 Copy Constructor.
 
virtual bool CanModifyDisplacement (int=-1) const
 
virtual void DeriveJacobianWrtDOF (Matrix &, int, double, double, double, double=0, double=NaN) const
 Calculates the derivative of the Jacobian of the transformation (w.r.t. world coordinates) w.r.t. a transformation parameter.
 
virtual void DisplacementAfterDOFChange (int dof, double dv, GenericImage< double > &dx, double t, double t0=-1, const WorldCoordsImage *i2w=NULL) const
 
void Evaluate (double &, double &, double &, int, int) const
 Evaluates the FFD at a lattice point.
 
void Evaluate (double &, double &, double &, int, int, int) const
 Evaluates the FFD at a lattice point.
 
void Evaluate (double &, double &, double &) const
 Evaluates the FFD at a point in lattice coordinates.
 
void EvaluateDerivativeOfJacobianWrtDOF (Matrix &, int, double, double) const
 
void EvaluateDerivativeOfJacobianWrtDOF (Matrix &, int, double, double, double) const
 
void EvaluateHessian (Matrix [3], int, int) const
 Calculates the Hessian of the 2D FFD at a point in lattice coordinates.
 
void EvaluateHessian (Matrix [3], double, double) const
 Calculates the Hessian of the 2D FFD at a point in lattice coordinates.
 
void EvaluateHessian (Matrix [3], int, int, int) const
 Calculates the Hessian of the FFD at a point in lattice coordinates.
 
void EvaluateHessian (Matrix [3], double, double, double) const
 Calculates the Hessian of the FFD at a point in lattice coordinates.
 
void EvaluateInside (double &, double &, double &) const
 Evaluates the FFD at a point in lattice coordinates inside the FFD domain.
 
void EvaluateJacobian (Matrix &, int, int) const
 Calculates the Jacobian of the FFD at a point in lattice coordinates.
 
void EvaluateJacobian (Matrix &, int, int, int) const
 Calculates the Jacobian of the FFD at a point in lattice coordinates.
 
void EvaluateJacobian (Matrix &, double, double) const
 Calculates the Jacobian of the FFD at a point in lattice coordinates.
 
void EvaluateJacobian (Matrix &, double, double, double) const
 Calculates the Jacobian of the FFD at a point in lattice coordinates.
 
void EvaluateJacobianDetDerivative (double dJ[3], const Matrix &adj, double a, double b, double c, bool wrt_world=true, bool use_spacing=true) const
 
void EvaluateJacobianDetDerivative (double dJ[3], const Matrix &adj, int a, int b, int c, bool wrt_world=true, bool use_spacing=true) const
 
void EvaluateJacobianDetDerivative (double dJ[3], const Matrix &adj, int i, int j, int k, double x, double y, double z, bool wrt_world=true, bool use_spacing=true) const
 
void EvaluateJacobianDetDerivative (double dJ[3], const Matrix &adj, int cp, double x, double y, double z, bool wrt_world=true, bool use_spacing=true) const
 
void EvaluateJacobianDOFs (double [3], int, int, double, double) const
 
void EvaluateJacobianDOFs (double [3], int, int, int, double, double, double) const
 
void EvaluateJacobianDOFs (double [3], int, int, int, int, double, double, double, double) const
 
void EvaluateJacobianWorld (Matrix &, double, double) const
 
void EvaluateJacobianWorld (Matrix &, double, double, double) const
 
void EvaluateLaplacian (double [3], int, int, int) const
 Calculates the Laplacian of the FFD at a point in lattice coordinates.
 
void EvaluateLaplacian (double [3], double, double, double) const
 Calculates the Laplacian of the FFD at a point in lattice coordinates.
 
void EvaluateLaplacian (double &, double &, double &) const
 Calculates the Laplacian of the FFD at a point in lattice coordinates.
 
virtual void FFDJacobianDetDerivative (double dJ[3], const Matrix &adj, int cp, double x, double y, double z, double=0, double=NaN, bool wrt_world=true, bool use_spacing=true) const
 
virtual void FFDJacobianWorld (Matrix &, double, double, double, double=0, double=NaN) const
 Calculates the Jacobian of the transformation w.r.t either control point displacements or velocities.
 
virtual int GetTAfterSubdivision () const
 Number of control points in t after subdivision.
 
virtual double GetTSpacingAfterSubdivision () const
 Control point spacing in t after subdivision.
 
virtual int GetXAfterSubdivision () const
 Number of control points in x after subdivision.
 
virtual double GetXSpacingAfterSubdivision () const
 Control point spacing in x after subdivision.
 
virtual int GetYAfterSubdivision () const
 Number of control points in y after subdivision.
 
virtual double GetYSpacingAfterSubdivision () const
 Control point spacing in y after subdivision.
 
virtual int GetZAfterSubdivision () const
 Number of control points in z after subdivision.
 
virtual double GetZSpacingAfterSubdivision () const
 Control point spacing in z after subdivision.
 
virtual void JacobianDOFs (double [3], int, int, int, double, double, double) const
 Calculates the Jacobian of the transformation w.r.t. the parameters of a control point.
 
virtual int KernelSize () const
 Size of support region of the used kernel.
 
virtual ~BSplineFreeFormTransformation3D ()
 Destructor.
 
- Public Member Functions inherited from mirtk::FreeFormTransformation3D
void BoundingBoxCP (int cp, Point &, Point &, double=1) const
 
void BoundingBoxImage (const BaseImage *, int, int &, int &, int &, int &, int &, int &, double=1) const
 
void GetStatusCP (int, int, int, DOFStatus &, DOFStatus &, DOFStatus &) const
 
virtual void JacobianDOFs (Matrix &, int, int, int, double, double, double) const
 Calculates the Jacobian of the transformation w.r.t a control point.
 
void MultiBoundingBoxImage (const BaseImage *, int, int &, int &, int &, int &, int &, int &, double=1) const
 
void PutStatusCP (int, int, int, DOFStatus, DOFStatus, DOFStatus)
 
virtual ~FreeFormTransformation3D ()
 Destructor.
 
- Public Member Functions inherited from mirtk::FreeFormTransformation
int ActualNumberOfDOFs () const
 
virtual double Approximate (const Transformation *, int=1, double=.0)
 
virtual double Approximate (const ImageAttributes &, double *, double *, double *, int=1, double=.0)
 
virtual double Approximate (const double *, const double *, const double *, double *, double *, double *, int, int=1, double=.0)
 
virtual double Approximate (const double *, const double *, const double *, const double *, double *, double *, double *, int, int=1, double=.0)
 
virtual double ApproximateAsNew (const Transformation *, int=1, double=.0)
 Approximate another transformation and return approximation error.
 
virtual double ApproximateAsNew (const ImageAttributes &, double *, double *, double *, int=1, double=.0)
 
const ImageAttributesAttributes () const
 Returns attributes of control point grid.
 
void BoundingBox (double &, double &) const
 Gets the temporal bounding box of the free-form deformation (in ms)
 
void BoundingBox (double &, double &, double &, double &, double &, double &) const
 Gets the spatial bounding box of the free-form deformation (in mm)
 
void BoundingBox (Point &, Point &) const
 Gets the spatial bounding box of the free-form deformation (in mm)
 
void BoundingBox (double &, double &, double &, double &, double &, double &, double &, double &) const
 Gets the spatio-temporal bounding box of the free-form deformation (in mm and ms)
 
void BoundingBox (Point &, double &, Point &, double &) const
 Gets the spatio-temporal bounding box of the free-form deformation (in mm and ms)
 
virtual void BoundingBox (int, double &, double &, double=1) const
 
virtual void BoundingBox (int, double &, double &, double &, double &, double &, double &, double &, double &, double=1) const
 
void BoundingBox (int, Point &, Point &, double=1) const
 
bool BoundingBox (const ImageAttributes &, int, int &, int &, int &, int &, int &, int &, double=1) const
 
bool BoundingBox (const ImageAttributes &, int, int &, int &, int &, int &, int &, int &, int &, int &, double=1) const
 
bool BoundingBox (const Image *, int, int &, int &, int &, int &, int &, int &, double=1) const
 
bool BoundingBox (const Image *, int, int &, int &, int &, int &, int &, int &, int &, int &, double=1) const
 
void ControlPointLocation (int, double &, double &) const
 Gets the location of the given control point (in mm)
 
void ControlPointLocation (int, double &, double &, double &) const
 Gets the location of the given control point (in mm)
 
Point ControlPointLocation (int) const
 Returns the location of the given control point (in mm)
 
virtual bool CopyFrom (const Transformation *)
 
bool CropPadPassiveCPs (int=0, bool=false)
 
virtual bool CropPadPassiveCPs (int, int, int=0, int=0, bool=false)
 
bool DOFBoundingBox (const ImageAttributes &, int, int &, int &, int &, int &, int &, int &, double=1) const
 
bool DOFBoundingBox (const Image *, int, int &, int &, int &, int &, int &, int &, double=1) const
 
virtual double DOFGradientNorm (const double *) const
 Get norm of the gradient vector.
 
int DOFToDimension (int) const
 Get index of dimension corresponding to transformation parameter (DoFs)
 
int DOFToIndex (int) const
 Get index of control point corresponding to transformation parameter (DoFs)
 
double EvaluateRMSError (const Transformation *) const
 Evaluates RMS error of transformation at control points compared to another.
 
virtual void ExtrapolationMode (enum ExtrapolationMode)
 Set extrapolation mode.
 
const CPExtrapolatorExtrapolator () const
 
void Get (int, Vector &) const
 Gets values of the parameters at a control point.
 
void Get (int, double &, double &, double &) const
 Gets values of the parameters at a control point.
 
void Get (int, int, int, double &, double &, double &) const
 Gets values of the parameters at a control point.
 
void Get (int, int, int, int, double &, double &, double &) const
 Gets values of the parameters at a control point.
 
void GetOrientation (double *, double *, double *) const
 Gets the orientation of the free-form deformation lattice.
 
void GetSpacing (double &, double &, double &) const
 Gets the control point spacing (in mm)
 
void GetSpacing (double &, double &, double &, double &) const
 Gets the control point spacing (in mm)
 
void GetStatus (int, CPStatus &) const
 Gets status of the parameters at a control point.
 
void GetStatus (int, int, int, DOFStatus &, DOFStatus &, DOFStatus &) const
 Gets status of the parameters at a control point.
 
void GetStatus (int, int, int, int, DOFStatus &, DOFStatus &, DOFStatus &) const
 Gets status of the parameters at a control point.
 
int GetT () const
 Returns the number of control points in t.
 
double GetTSpacing () const
 Returns the of control point spacing in t.
 
int GetX () const
 Returns the number of control points in x.
 
double GetXSpacing () const
 Returns the of control point spacing in x.
 
int GetY () const
 Returns the number of control points in y.
 
double GetYSpacing () const
 Returns the of control point spacing in y.
 
int GetZ () const
 Returns the number of control points in z.
 
double GetZSpacing () const
 Returns the of control point spacing in z.
 
virtual void GlobalHessian (Matrix [3], double, double, double, double=0, double=NaN) const
 Calculates the Hessian for each component of the global transformation w.r.t world coordinates.
 
virtual void GlobalInverse (double &, double &, double &, double=0, double=NaN) const
 Transforms a single point using the inverse of the global transformation only.
 
virtual void GlobalJacobian (Matrix &, double, double, double, double=0, double=NaN) const
 Calculates the Jacobian of the global transformation w.r.t world coordinates.
 
virtual void GlobalTransform (double &, double &, double &, double=0, double=NaN) const
 Transforms a single point using the global transformation component only.
 
virtual void Hessian (Matrix [3], double, double, double, double=0, double=NaN) const
 Calculates the Hessian for each component of the transformation w.r.t world coordinates.
 
void HessianToWorld (double &, double &, double &) const
 
void HessianToWorld (double &, double &, double &, double &, double &, double &) const
 
void HessianToWorld (Matrix &) const
 
void HessianToWorld (Matrix [3]) const
 
void IndexToDOFs (int, int &, int &) const
 Get indices of transformation parameters (DoFs)
 
void IndexToDOFs (int, int &, int &, int &) const
 Get indices of transformation parameters (DoFs)
 
void IndexToLattice (int, int &, int &) const
 Get control point lattice coordinates from index.
 
void IndexToLattice (int, int &, int &, int &) const
 Get control point lattice coordinates from index.
 
void IndexToLattice (int, int &, int &, int &, int &) const
 Get control point lattice coordinates from index.
 
void IndexToWorld (int, double &, double &) const
 Get world coordinates (in mm) of control point.
 
void IndexToWorld (int, double &, double &, double &) const
 Get world coordinates (in mm) of control point.
 
void IndexToWorld (int, Point &) const
 Get world coordinates (in mm) of control point.
 
Point IndexToWorld (int) const
 Get world coordinates (in mm) of control point.
 
void Initialize (const ImageAttributes &, double, double, double=-1.0, double=-1.0)
 Initialize free-form transformation.
 
void Initialize (const CPImage &, bool=false)
 Initialize transformation from existing vector field.
 
void Initialize (const GenericImage< double > &, bool=false)
 Initialize transformation from existing 3D+t vector field.
 
virtual bool Inverse (double &, double &, double &, double=0, double=NaN) const
 Transforms a single point using the inverse of the transformation.
 
virtual bool IsActive (int) const
 Whether the control point at given lattice index is active.
 
virtual bool IsActive (int, int, int=0, int=0) const
 Whether the control point at given lattice coordinates is active.
 
virtual void Jacobian (Matrix &, double, double, double, double=0, double=NaN) const
 Calculates the Jacobian of the transformation w.r.t world coordinates.
 
void JacobianToWorld (double &, double &) const
 
void JacobianToWorld (double &, double &, double &) const
 
void JacobianToWorld (Matrix &) const
 
void JacobianToWorldOrientation (double &, double &) const
 Reorient 1st order derivatives computed w.r.t 2D lattice coordinates.
 
void JacobianToWorldOrientation (double &, double &, double &) const
 Reorient 1st order derivatives computed w.r.t 2D lattice coordinates.
 
int KernelRadius () const
 Radius of support region of the used kernel.
 
int LatticeToIndex (int, int, int=0, int=0) const
 Get control point index from lattice coordinates.
 
virtual double LatticeToTime (double) const
 Transforms temporal lattice coordinate to time (in ms)
 
virtual void LatticeToWorld (double &, double &) const
 Transforms lattice coordinates to world coordinates (in mm)
 
virtual void LatticeToWorld (double &, double &, double &) const
 Transforms lattice coordinates to world coordinates (in mm)
 
virtual void LatticeToWorld (Point &) const
 Transforms lattice coordinates to world coordinates (in mm)
 
 mirtkPublicAttributeMacro (double, SpeedupFactor)
 Speedup factor for gradient computation.
 
 mirtkReadOnlyAttributeMacro (enum ExtrapolationMode, ExtrapolationMode)
 Mode used for extrapolation of control point image.
 
int NumberOfActiveCPs () const
 Number of active control points.
 
int NumberOfCPs () const
 Number of control points.
 
int NumberOfPassiveCPs () const
 Number of non-active control points.
 
void Put (int, const Vector &)
 Puts values of the parameters at a control point.
 
void Put (int, double, double, double)
 Puts values of the parameters at a control point.
 
void Put (int, int, int, double, double, double)
 Puts values of the parameters at a control point.
 
void Put (int, int, int, int, double, double, double)
 Puts values of the parameters at a control point.
 
void PutBoundingBox (double, double, double, double, double, double)
 Puts the spatial bounding box for the free-form deformation (in mm)
 
void PutBoundingBox (const Point &, const Point &)
 Puts the temporal bounding box for the free-form deformation (in mm)
 
void PutBoundingBox (double, double)
 Puts the temporal bounding box of the free-form deformation (in ms)
 
void PutBoundingBox (double, double, double, double, double, double, double, double)
 Puts the spatio-temporal bounding box for the free-form deformation (in mm)
 
void PutOrientation (double *, double *, double *)
 Puts the orientation of the free-form deformation lattice.
 
void PutStatus (int, const CPStatus &)
 Puts status of the parameters at a control point.
 
void PutStatus (int, int, int, DOFStatus, DOFStatus, DOFStatus)
 Puts status of the parameters at a control point.
 
void PutStatus (int, int, int, int, DOFStatus, DOFStatus, DOFStatus)
 Puts status of the parameters at a control point.
 
void Subdivide2D ()
 Subdivide lattice in first two dimensions.
 
void Subdivide3D ()
 Subdivide lattice in first three dimensions.
 
void Subdivide4D ()
 Subdivide lattice in all four dimensions.
 
int T () const
 Returns the number of control points in t.
 
virtual double TimeToLattice (double) const
 Transforms time (in ms) to temporal lattice coordinate.
 
virtual void Transform (double &, double &, double &, double=0, double=NaN) const
 Transforms a single point.
 
virtual void WorldToLattice (double &, double &) const
 Transforms world coordinates (in mm) to lattice coordinates.
 
virtual void WorldToLattice (double &, double &, double &) const
 Transforms world coordinates (in mm) to lattice coordinates.
 
virtual void WorldToLattice (Point &) const
 Transforms world coordinates (in mm) to lattice coordinates.
 
int X () const
 Returns the number of control points in x.
 
int Y () const
 Returns the number of control points in y.
 
int Z () const
 Returns the number of control points in z.
 
virtual ~FreeFormTransformation ()
 Destructor.
 
- Public Member Functions inherited from mirtk::Transformation
virtual void Add (const DOFValue *)
 Add change to transformation parameters.
 
virtual double Approximate (const ImageAttributes &, const Transformation *, int=1, double=.0)
 Approximate another transformation and return approximation error.
 
virtual double Approximate (GenericImage< double > &, int=1, double=.0)
 
virtual double ApproximateAsNew (const double *, const double *, const double *, double *, double *, double *, int, int=1, double=.0)
 
virtual double ApproximateAsNew (const double *, const double *, const double *, const double *, double *, double *, double *, int, int=1, double=.0)
 
virtual void ApproximateGradient (const ImageAttributes &, const double *, const double *, const double *, double *, double=1.0) const
 
virtual void ApproximateGradient (const double *, const double *, const double *, const double *, const double *, const double *, int, double *, double=1.0) const
 
virtual void ApproximateGradient (const double *, const double *, const double *, const double *, const double *, const double *, const double *, int, double *, double=1.0) const
 
virtual void Displacement (double &, double &, double &, double=0, double=NaN) const
 Calculates the displacement of a single point.
 
virtual void Displacement (const ImageAttributes &, double *, double *, double *) const
 
virtual void Displacement (GenericImage< double > &, double=NaN, const WorldCoordsImage *=NULL) const
 Calculates the displacement vectors for a whole image domain.
 
virtual void Displacement (GenericImage< float > &, double=NaN, const WorldCoordsImage *=NULL) const
 Calculates the displacement vectors for a whole image domain.
 
double EvaluateRMSError (const ImageAttributes &, const Transformation *) const
 Evaluates RMS error of transformation compared to another.
 
double EvaluateRMSError (const ImageAttributes &, double *, double *) const
 
double EvaluateRMSError (const ImageAttributes &, double *, double *, double *) const
 
double EvaluateRMSError (const double *, const double *, const double *, double, double *, double *, double *, int no) const
 Evaluates RMS error of transformation compared to displacement field.
 
double EvaluateRMSError (const double *, const double *, const double *, const double *, double *, double *, double *, int no) const
 Evaluates RMS error of transformation compared to given displacement field.
 
virtual double Get (int) const
 Get value of transformation parameter.
 
virtual void Get (DOFValue *) const
 Get values of transformation parameters.
 
virtual DOFStatus GetStatus (int) const
 Get status of transformation parameter.
 
virtual void GlobalDisplacement (double &, double &, double &, double=0, double=NaN) const
 Calculates the displacement of a single point using the global transformation component only.
 
virtual void GlobalInverseDisplacement (double &, double &, double &, double=0, double=NaN) const
 Calculates the displacement of a single point using the inverse of the global transformation only.
 
virtual double GlobalJacobian (double, double, double, double=0, double=NaN) const
 Calculates the determinant of the Jacobian of the global transformation w.r.t world coordinates.
 
virtual bool HasSameDOFsAs (const Transformation *) const
 Checks whether transformation depends on the same vector of parameters.
 
virtual bool Inverse (Point &, double=0, double=NaN) const
 Transforms a single point using the inverse of the transformation.
 
virtual int Inverse (PointSet &, double=0, double=NaN) const
 
virtual bool InverseDisplacement (double &, double &, double &, double=0, double=NaN) const
 Calculates the displacement of a single point using the inverse of the transformation.
 
virtual int InverseDisplacement (const ImageAttributes &, double *, double *, double *) const
 
virtual int InverseDisplacement (GenericImage< double > &, double=NaN, const WorldCoordsImage *=NULL) const
 
virtual int InverseDisplacement (GenericImage< float > &, double=NaN, const WorldCoordsImage *=NULL) const
 
virtual bool IsIdentity () const
 Checks whether the transformation is an identity mapping.
 
virtual double Jacobian (double, double, double, double=0, double=NaN) const
 Calculates the determinant of the Jacobian of the transformation w.r.t world coordinates.
 
virtual void LocalDisplacement (double &, double &, double &, double=0, double=NaN) const
 Calculates the displacement of a single point using the local transformation component only.
 
virtual bool LocalInverseDisplacement (double &, double &, double &, double=0, double=NaN) const
 Calculates the displacement of a single point using the inverse of the local transformation only.
 
virtual double LocalJacobian (double, double, double, double=0, double=NaN) const
 Calculates the determinant of the Jacobian of the local transformation w.r.t world coordinates.
 
int NumberOfActiveDOFs () const
 Get number of active transformation parameters.
 
virtual int NumberOfDOFs () const
 Get number of transformation parameters.
 
int NumberOfPassiveDOFs () const
 Get number of passive transformation parameters.
 
void ParametricGradient (const GenericImage< double > *, double *, const WorldCoordsImage *, double=NaN, double=1) const
 
void ParametricGradient (const GenericImage< double > *, double *, double=NaN, double=1) const
 
virtual void ParametricGradient (const GenericImage< double > **, int, double *, const WorldCoordsImage *, const WorldCoordsImage *, const double *=NULL, double=1) const
 
void ParametricGradient (const GenericImage< double > **, int, double *, const WorldCoordsImage *, const double *=NULL, double=1) const
 
void ParametricGradient (const GenericImage< double > **, int, double *, const double *=NULL, double=1) const
 
void Print (Indent=0) const
 Prints information about the transformation.
 
virtual void Put (int, double)
 Put value of transformation parameter.
 
virtual void Put (const DOFValue *)
 Put values of transformation parameters.
 
virtual void PutStatus (int, DOFStatus)
 Put status of transformation parameter.
 
virtual void Read (const char *)
 Reads a transformation from a file.
 
virtual CifstreamRead (Cifstream &)
 Reads a transformation from a file stream.
 
virtual void Reset ()
 Reset transformation.
 
virtual void Transform (Point &, double=0, double=NaN) const
 Transforms a single point.
 
virtual void Transform (PointSet &, double=0, double=NaN) const
 Transforms a set of points.
 
virtual void Transform (int, double *, double *, double *, double=0, double=NaN) const
 Transforms a set of points.
 
virtual void Transform (int, double *, double *, double *, const double *, double=NaN) const
 Transforms a set of points.
 
virtual void Transform (WorldCoordsImage &, double=NaN) const
 Transforms world coordinates of image voxels.
 
virtual TransformationType TypeOfClass () const
 Returns type ID of the instantiated transformation class.
 
virtual double Update (const DOFValue *)
 Update transformation parameters given parametric gradient.
 
virtual void Verify ()
 
virtual void Write (const char *) const
 Writes a transformation to a file.
 
virtual CofstreamWrite (Cofstream &) const
 Writes a transformation to a file stream.
 
virtual ~Transformation ()
 Default destructor.
 
- Public Member Functions inherited from mirtk::Observable
void AddObserver (Observer &)
 Add observer.
 
void Broadcast (Event, const void *=NULL)
 Broadcast event to observers.
 
void ClearObservers ()
 Delete all observers.
 
void DeleteObserver (Observer &)
 Delete observer.
 
void NotifyObservers (Event, const void *=NULL)
 Notify all observers about given event if this object has changed.
 
int NumberOfObservers () const
 Number of current observers.
 
virtual ~Observable ()
 Destructor.
 
- Public Member Functions inherited from mirtk::Object
virtual const char * NameOfClass () const =0
 Get name of class, which this object is an instance of.
 
bool Parameter (const ParameterList &)
 Set parameters from name/value pairs.
 
virtual ~Object ()
 Destructor.
 

Protected Member Functions

void EvaluateBCHFormula (int, CPImage &, double, const CPImage &, double, const CPImage &, bool=false) const
 
void InitializeExtrapolator ()
 Initialize extrapolation function.
 
int NumberOfStepsForIntervalLength (double) const
 Get number of integration steps for a given temporal integration interval.
 
void NumberOfStepsForIntervalLength (double, int) const
 Set number of integration steps for a given temporal integration interval.
 
void ParametricGradient (const GenericImage< double > *, double *, const WorldCoordsImage *, const WorldCoordsImage *, double, double, double) const
 
virtual CifstreamReadDOFs (Cifstream &, TransformationType)
 Reads transformation parameters from a file stream.
 
double StepLengthForIntervalLength (double) const
 Get length of steps for a given temporal integration interval.
 
virtual CofstreamWriteDOFs (Cofstream &) const
 Writes transformation parameters to a file stream.
 
- Protected Member Functions inherited from mirtk::BSplineFreeFormTransformation3D
 mirtkPublicAttributeMacro (ParametricGradientType, ParametricGradientCalculation)
 Whether to compute parametric gradient using cubic B-spline convolution.
 
- Protected Member Functions inherited from mirtk::FreeFormTransformation3D
 FreeFormTransformation3D (CPInterpolator &, CPInterpolator *=NULL)
 Default constructor.
 
 FreeFormTransformation3D (const FreeFormTransformation3D &, CPInterpolator &, CPInterpolator *=NULL)
 Copy Constructor.
 
- Protected Member Functions inherited from mirtk::FreeFormTransformation
 FreeFormTransformation (CPInterpolator &, CPInterpolator *=NULL)
 Default constructor.
 
 FreeFormTransformation (const FreeFormTransformation &, CPInterpolator &, CPInterpolator *=NULL)
 Copy constructor.
 
void InitializeCPs (const ImageAttributes &, bool=true)
 Initialize control points.
 
void InitializeCPs (const FreeFormTransformation &, bool=true)
 Copy control points from other transformation.
 
void InitializeInterpolator ()
 Initialize interpolator of control points.
 
void InitializeStatus ()
 Initialize status of control points.
 
CofstreamWriteCPs (Cofstream &) const
 Writes the control point and status information to a file stream.
 
- Protected Member Functions inherited from mirtk::Transformation
void InitializeDOFs (int)
 Initialize transformation parameters.
 
void InitializeDOFs (const Transformation &, int=-1)
 Copy transformation parameters (DoFs) and their status.
 
 Transformation (int=0)
 Default constructor.
 
 Transformation (const Transformation &)
 Copy constructor.
 
 Transformation (const Transformation &, int)
 Copy constructor.
 
- Protected Member Functions inherited from mirtk::Observable
 Observable ()
 Default constructor.
 
 Observable (const Observable &)
 Copy constructor.
 
Observableoperator= (const Observable &)
 Assignment operator.
 
- Protected Member Functions inherited from mirtk::Object
template<typename... Args>
void Throw (ErrorType err, const char *func, Args... args) const
 

Additional Inherited Members

- Public Types inherited from mirtk::BSplineFreeFormTransformation3D
enum  ParametricGradientType { PG_Default, PG_Analytic, PG_Convolution, PG_Approximation }
 Options for parametric gradient calculation. More...
 
- Public Types inherited from mirtk::FreeFormTransformation
typedef GenericExtrapolateImageFunction< CPImageCPExtrapolator
 Base type used for extrapolation of control point data.
 
typedef GenericImage< CPValueCPImage
 Type of image representation of free-form transformation.
 
typedef GenericInterpolateImageFunction< CPImageCPInterpolator
 
typedef Vector3D< DOFStatusCPStatus
 Type of vector storing status of control point coefficients.
 
typedef Vector3D< DOFValueCPValue
 Type of vector storing the coefficients at a control point.
 
typedef CPValue Vector
 
- Public Types inherited from mirtk::Transformation
typedef Status DOFStatus
 Type of transforamtion parameter status.
 
typedef double DOFValue
 Type of transformation parameter value.
 
- Static Public Member Functions inherited from mirtk::FreeFormTransformation3D
static ImageAttributes DefaultAttributes (double, double, double, double, double, double, double, double, double, const double *, const double *, const double *)
 Default attributes of free-form transformation lattice.
 
- Static Public Member Functions inherited from mirtk::FreeFormTransformation
static double Bending3D (const Matrix [3])
 Calculates the bending of the transformation given the 2nd order derivatives.
 
static ImageAttributes DefaultAttributes (const ImageAttributes &attr, double dx=-1.0, double dy=-1.0, double dz=-1.0, double dt=-1.0)
 
static ImageAttributes DefaultAttributes (double, double, double, double, double, double, double, double, double, double, double, double, const double *, const double *, const double *)
 Default attributes of free-form transformation lattice.
 
- Static Public Member Functions inherited from mirtk::Transformation
static bool CheckHeader (const char *)
 Whether magic number in header of given file.
 
static TransformationNew (TransformationType)
 
static TransformationNew (const Transformation *)
 
static TransformationNew (const char *)
 
static TransformationType TypeOfClass (const char *)
 Returns type ID corresponding to transformations of the named class.
 
- Static Public Member Functions inherited from mirtk::Object
static const char * NameOfType ()
 Get name of this class type.
 
- Static Protected Member Functions inherited from mirtk::Object
template<typename... Args>
static void ThrowStatic (ErrorType err, const char *cls, const char *func, Args... args)
 
- Protected Attributes inherited from mirtk::BSplineFreeFormTransformation3D
Interpolator _FFD
 Interpolates control point values at arbitrary lattice locations.
 
Interpolator2D _FFD2D
 
- Protected Attributes inherited from mirtk::FreeFormTransformation
const ImageAttributes_attr
 Control point lattice attributes.
 
CPInterpolator_CPFunc
 
CPImage _CPImage
 
CPStatus **** _CPStatus
 
CPExtrapolator_CPValue
 Infinite discrete representation of free-form transformation coefficients.
 
const double & _dt
 Read-only reference to _dt attribute of _CPImage.
 
const double & _dx
 Read-only reference to _dx attribute of _CPImage.
 
const double & _dy
 Read-only reference to _dy attribute of _CPImage.
 
const double & _dz
 Read-only reference to _dz attribute of _CPImage.
 
const Matrix_matL2W
 Read-only reference to _matI2W of _CPImage.
 
const Matrix_matW2L
 Read-only reference to _matW2I of _CPImage.
 
const int & _t
 Read-only reference to _t attribute of _CPImage.
 
const int & _x
 Read-only reference to _x attribute of _CPImage.
 
const int & _y
 Read-only reference to _y attribute of _CPImage.
 
const int & _z
 Read-only reference to _z attribute of _CPImage.
 
- Protected Attributes inherited from mirtk::Transformation
int _NumberOfDOFs
 Number of transformation parameters.
 
DOFValue_Param
 Value of each transformation parameter.
 
DOFStatus_Status
 Status of each transformation parameter (Active or Passive)
 

Detailed Description

Free-form transformation parameterized by a stationary velocity field.

This class implements a free-form transformation which is represented by a stationary velocity field (2D/3D). The displacement field is obtained by exponentiating the velocity field, resulting in a diffeomorphic transformation. A stationary velocity field can be further approximated from a given displacement field using the group logarithm of diffeomorphisms.

Definition at line 43 of file BSplineFreeFormTransformationSV.h.

Member Function Documentation

§ ApproximateAsNew() [1/2]

virtual double mirtk::BSplineFreeFormTransformationSV::ApproximateAsNew ( GenericImage< double > &  ,
int  = 1,
double  = .0 
)
virtual

Approximate displacements: This function takes a 3D displacement field and finds a stationary velocity field which, when exponentiated, approximates these displacements by computing the group logarithm of diffeomorphisms. The displacements are replaced by the residual displacements of the newly approximated transformation. Returns the approximation error of the resulting FFD.

Reimplemented from mirtk::Transformation.

§ ApproximateAsNew() [2/2]

virtual double mirtk::BSplineFreeFormTransformationSV::ApproximateAsNew ( GenericImage< double > &  ,
bool  ,
int  = 3,
int  = 8 
)
virtual

Approximate displacements: This function takes a 3D displacement field and finds a stationary velocity field which, when exponentiated, approximates these displacements by computing the group logarithm of diffeomorphisms. The displacements are replaced by the residual displacements of the newly approximated transformation. Returns the approximation error of the resulting FFD.

§ ApproximateDOFs()

virtual void mirtk::BSplineFreeFormTransformationSV::ApproximateDOFs ( const double *  ,
const double *  ,
const double *  ,
const double *  ,
const double *  ,
const double *  ,
const double *  ,
int   
)
virtual

Approximate displacements: This function takes a set of points and a set of displacements and finds !new! parameters such that the resulting transformation approximates the displacements as good as possible.

Reimplemented from mirtk::BSplineFreeFormTransformation3D.

§ ApproximateDOFsGradient()

virtual void mirtk::BSplineFreeFormTransformationSV::ApproximateDOFsGradient ( const double *  ,
const double *  ,
const double *  ,
const double *  ,
const double *  ,
const double *  ,
const double *  ,
int  ,
double *  ,
double  = 1.0 
) const
virtual

Finds gradient of approximation error: This function takes a set of points and a set of errors. It finds a gradient w.r.t. the transformation parameters which minimizes the L2 norm of the approximation error and adds it to the input gradient with the given weight.

Reimplemented from mirtk::BSplineFreeFormTransformation3D.

§ ApproximateVelocitiesAsNew()

virtual double mirtk::BSplineFreeFormTransformationSV::ApproximateVelocitiesAsNew ( GenericImage< double > &  )
virtual

Approximate velocities: This function takes a velocity field and initializes the cubic B-spline coefficients of this transformation such that the spline function approximates the given velocity field. Returns the approximation error of the velocity spline function.

§ ApproximationDomain()

virtual ImageAttributes mirtk::BSplineFreeFormTransformationSV::ApproximationDomain ( const ImageAttributes ,
const Transformation  
)
virtual

Get image domain on which this free-form transformation should be defined in order to reduce the error when the given transformation is approximated and applied to resample an image on the specified image grid.

Reimplemented from mirtk::FreeFormTransformation.

§ CombineWith() [1/2]

virtual void mirtk::BSplineFreeFormTransformationSV::CombineWith ( const Transformation )
virtual

Combine transformations: This function takes a transformation and finds a stationary velocity field which, when exponentiated, approximates the composition of this and the given transformation.

§ CombineWith() [2/2]

virtual void mirtk::BSplineFreeFormTransformationSV::CombineWith ( const BSplineFreeFormTransformationSV )
virtual

Combine transformations: This function takes a transformation and finds a stationary velocity field which, when exponentiated, approximates the composition of this and the given transformation.

§ Displacement() [1/2]

virtual void mirtk::BSplineFreeFormTransformationSV::Displacement ( GenericImage< double > &  ,
double  ,
double  = NaN,
const WorldCoordsImage = NULL 
) const
virtual

Calculates the displacement vectors for a whole image domain

Attention
The displacements are computed at the positions after applying the current displacements at each voxel. These displacements are then added to the current displacements. Therefore, set the input displacements to zero if only interested in the displacements of this transformation at the voxel positions.

Reimplemented from mirtk::Transformation.

§ Displacement() [2/2]

virtual void mirtk::BSplineFreeFormTransformationSV::Displacement ( GenericImage< float > &  ,
double  ,
double  = NaN,
const WorldCoordsImage = NULL 
) const
virtual

Calculates the displacement vectors for a whole image domain

Attention
The displacements are computed at the positions after applying the current displacements at each voxel. These displacements are then added to the current displacements. Therefore, set the input displacements to zero if only interested in the displacements of this transformation at the voxel positions.

Reimplemented from mirtk::Transformation.

§ EvaluateBCHFormula()

void mirtk::BSplineFreeFormTransformationSV::EvaluateBCHFormula ( int  ,
CPImage ,
double  ,
const CPImage ,
double  ,
const CPImage ,
bool  = false 
) const
protected

Evaluates the BCH formula s.t. u = log(exp(tau * v) o exp(eta * w))

See also
Bossa, M., Hernandez, M., & Olmos, S. Contributions to 3D diffeomorphic atlas estimation: application to brain images. MICCAI 2007, 10(Pt 1), 667–74.

§ EvaluateJacobianWorld()

void mirtk::BSplineFreeFormTransformationSV::EvaluateJacobianWorld ( Matrix jac,
double  x,
double  y,
double  z,
double   
) const
inline

Calculates the Jacobian of the FFD at a point in lattice coordinates and converts the resulting Jacobian to derivatives w.r.t world coordinates

Definition at line 727 of file BSplineFreeFormTransformationSV.h.

§ IntegrateVelocities()

void mirtk::BSplineFreeFormTransformationSV::IntegrateVelocities ( double &  ,
double &  ,
double &  ,
double  T = 1.0 
) const

Transforms a single point using a Runge-Kutta integration

Parameters
[in]TUpper integration limit, i.e., length of time interval.

§ Interpolate()

virtual void mirtk::BSplineFreeFormTransformationSV::Interpolate ( const double *  ,
const double *  ,
const double *   
)
virtual

Interpolates displacements: This function takes a set of displacements defined at the control points and finds a stationary velocity field such that the resulting transformation interpolates these displacements.

Reimplemented from mirtk::BSplineFreeFormTransformation3D.

§ InterpolateVelocities()

virtual void mirtk::BSplineFreeFormTransformationSV::InterpolateVelocities ( const double *  ,
const double *  ,
const double *   
)
virtual

Interpolates velocities: This function takes a set of velocites defined at the control points and interpolates these velocities.

§ InverseDisplacement() [1/2]

virtual int mirtk::BSplineFreeFormTransformationSV::InverseDisplacement ( GenericImage< double > &  ,
double  ,
double  = NaN,
const WorldCoordsImage = NULL 
) const
virtual

Calculates the inverse displacement vectors for a whole image domain

Attention
The displacements are computed at the positions after applying the current displacements at each voxel. These displacements are then added to the current displacements. Therefore, set the input displacements to zero if only interested in the displacements of this transformation at the voxel positions.
Returns
Always zero.

Reimplemented from mirtk::Transformation.

§ InverseDisplacement() [2/2]

virtual int mirtk::BSplineFreeFormTransformationSV::InverseDisplacement ( GenericImage< float > &  ,
double  ,
double  = NaN,
const WorldCoordsImage = NULL 
) const
virtual

Calculates the inverse displacement vectors for a whole image domain

Attention
The displacements are computed at the positions after applying the current displacements at each voxel. These displacements are then added to the current displacements. Therefore, set the input displacements to zero if only interested in the displacements of this transformation at the voxel positions.
Returns
Always zero.

Reimplemented from mirtk::Transformation.

§ JacobianDetDerivative()

virtual void mirtk::BSplineFreeFormTransformationSV::JacobianDetDerivative ( double  dJ[3],
const Matrix adj,
int  cp,
double  x,
double  y,
double  z,
double  t = 0,
double  t0 = NaN,
bool  wrt_world = true,
bool  use_spacing = true 
) const
virtual

Calculates derivatives of the Jacobian determinant at world point w.r.t. DoFs of a control point

Parameters
[out]dJPartial derivatives of Jacobian determinant at (x, y, z) w.r.t. DoFs of control point.
[in]cpIndex of control point w.r.t. whose DoFs the derivatives are computed.
[in]xWorld coordinate along x axis at which to evaluate derivatives.
[in]yWorld coordinate along y axis at which to evaluate derivatives.
[in]zWorld coordinate along z axis at which to evaluate derivatives.
[in]adjAdjugate of Jacobian matrix evaluated at (x, y, z).

Reimplemented from mirtk::FreeFormTransformation.

§ JacobianDOFs()

virtual void mirtk::BSplineFreeFormTransformationSV::JacobianDOFs ( double  [3],
int  ,
double  ,
double  ,
double  ,
double  = 0,
double  = NaN 
) const
virtual

Calculates the Jacobian of the transformation w.r.t a transformation parameters

Attention
This overriden base class function returns one column of the 3x3 Jacobian matrix, i.e., only the partial derivatives of the transformation w.r.t. the specified transformation parameter (not control point). This is in accordance to the Transformation::JacobianDOFs definition, which is violated, however, by most other FFDs.

Reimplemented from mirtk::FreeFormTransformation3D.

§ ParametricGradient() [1/3]

void mirtk::BSplineFreeFormTransformationSV::ParametricGradient ( const GenericImage< double > *  ,
double *  ,
const WorldCoordsImage ,
const WorldCoordsImage ,
double  ,
double  ,
double   
) const
protected

Applies the chain rule to convert spatial non-parametric gradient to a gradient w.r.t the parameters of this transformation given the temporal interval which the displacement gradient corresponds to

§ ParametricGradient() [2/3]

void mirtk::BSplineFreeFormTransformationSV::ParametricGradient ( const GenericImage< double > *  in,
double *  out,
const WorldCoordsImage i2w,
const WorldCoordsImage wc,
double  t0 = -1,
double  w = 1 
) const
inlinevirtual

Applies the chain rule to convert spatial non-parametric gradient to a gradient w.r.t the parameters of this transformation

Reimplemented from mirtk::BSplineFreeFormTransformation3D.

Definition at line 805 of file BSplineFreeFormTransformationSV.h.

§ ParametricGradient() [3/3]

virtual void mirtk::BSplineFreeFormTransformationSV::ParametricGradient ( const PointSet ,
const Vector3D< double > *  ,
double *  ,
double  = 0,
double  = -1,
double  = 1 
) const
virtual

Applies the chain rule to convert point-wise non-parametric gradient to a gradient w.r.t the parameters of this transformation.

Reimplemented from mirtk::FreeFormTransformation3D.

§ RequiresCachingOfDisplacements()

bool mirtk::BSplineFreeFormTransformationSV::RequiresCachingOfDisplacements ( ) const
inlinevirtual

Whether the caching of the transformation displacements is required (or preferred) by this transformation. For some transformations such as those parameterized by velocities, caching of the displacements for each target voxel results in better performance or is needed for example for the scaling and squaring method.

Reimplemented from mirtk::Transformation.

Definition at line 766 of file BSplineFreeFormTransformationSV.h.

§ ScaleVelocities()

void mirtk::BSplineFreeFormTransformationSV::ScaleVelocities ( double  )

Scale velocities

Alternatively, change integration inveral _T.

§ ScalingAndSquaring() [1/2]

template<class VoxelType >
void mirtk::BSplineFreeFormTransformationSV::ScalingAndSquaring ( GenericImage< VoxelType > *  d,
double  T = 1.0,
const WorldCoordsImage wc = NULL 
) const

Compute displacement field using the scaling and squaring (SS) method

Attention
If an input/output displacement field is provided, the resulting transformation is the composition exp(v) o d.
The scaling and squaring cannot be used to obtain the displacements generated by a 3D velocity field on a 2D slice only. It always must be applied to the entire domain of the velocity field.
Parameters
[in,out]dDisplacement field generated by stationary velocity field.
[in]TUpper integration limit, i.e., length of time interval.
[in]wcPre-computed world coordinates of image voxels.

§ ScalingAndSquaring() [2/2]

template<class VoxelType >
void mirtk::BSplineFreeFormTransformationSV::ScalingAndSquaring ( const ImageAttributes attr,
GenericImage< VoxelType > *  d,
GenericImage< VoxelType > *  dx,
GenericImage< VoxelType > *  dj = NULL,
GenericImage< VoxelType > *  lj = NULL,
double  T = 1.0,
const WorldCoordsImage wc = NULL 
) const

Compute displacement field and derivatives using the scaling and squaring (SS) method

Attention
If an input/output displacement field is provided, the resulting transformation is the composition exp(v) o d.
The scaling and squaring cannot be used to obtain the displacements generated by a 3D velocity field on a 2D slice only. It always must be applied to the entire domain of the velocity field.
Parameters
[in]attrAttributes of output images.
[in,out]dDisplacement field generated by stationary velocity field.
[out]dxPartial derivatives of corresponding transformation w.r.t. x.
[out]djDeterminant of Jacobian w.r.t. x, i.e., det(jac(dx)).
[out]ljLog of determinant of Jacobian w.r.t. x, i.e., log(det(jac(dx))).
[in]TUpper integration limit, i.e., length of time interval.
[in]wcPre-computed world coordinates of image voxels.

§ UpperIntegrationLimit()

double mirtk::BSplineFreeFormTransformationSV::UpperIntegrationLimit ( double  t,
double  t0 
) const
inline

Upper integration limit used given the temporal origin of both target and source images. If both images have the same temporal origin, the value of the member variable T is returned. Note that T may be set to zero in order to force no displacement between images located at the same point in time to be zero. This is especially useful when animating the deformation between two images with successively increasing upper integration limit. Otherwise, if the temporal origin of the two images differs, the signed difference between these is returned, i.e., t - t0, which corresponds to a forward integration of the target point (x, y, z) to the time point of the source image.

Definition at line 772 of file BSplineFreeFormTransformationSV.h.


The documentation for this class was generated from the following file: