Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
mirtk::Transformation Class Referenceabstract

#include <Transformation.h>

Inheritance diagram for mirtk::Transformation:
Inheritance graph
Collaboration diagram for mirtk::Transformation:
Collaboration graph

Public Types

typedef Status DOFStatus
 Type of transforamtion parameter status.
 
typedef double DOFValue
 Type of transformation parameter value.
 

Public Member Functions

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 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 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 (const ImageAttributes &, double *, double *, 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 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 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 bool CanModifyDisplacement (int=-1) const
 
virtual bool CanRead (TransformationType) const
 Whether this transformation can read a file of specified type (i.e. format)
 
virtual bool CopyFrom (const Transformation *)
 
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 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.
 
virtual void Displacement (GenericImage< double > &, double, double, const WorldCoordsImage *=NULL) const
 
virtual void Displacement (GenericImage< float > &, double, double, const WorldCoordsImage *=NULL) const
 
virtual void DisplacementAfterDOFChange (int dof, double dv, GenericImage< double > &dx, double t, double t0=NaN, const WorldCoordsImage *i2w=NULL) const
 
virtual 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.
 
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 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 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 void GlobalJacobian (Matrix &, double, double, double, double=0, double=NaN) const
 Calculates the Jacobian of the global transformation w.r.t world coordinates.
 
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 void GlobalTransform (double &, double &, double &, double=0, double=NaN) const =0
 Transforms a single point using the global transformation component only.
 
virtual bool HasSameDOFsAs (const Transformation *) const
 Checks whether transformation depends on the same vector of parameters.
 
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.
 
virtual bool Inverse (double &, double &, double &, double=0, double=NaN) const
 Transforms a single point using the inverse of the transformation.
 
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 int InverseDisplacement (GenericImage< double > &, double, double, const WorldCoordsImage *=NULL) const
 
virtual int InverseDisplacement (GenericImage< float > &, double, double, const WorldCoordsImage *=NULL) const
 
virtual bool IsIdentity () const
 Checks whether the transformation is an identity mapping.
 
virtual void Jacobian (Matrix &, double, double, double, double=0, double=NaN) const
 Calculates the Jacobian of the transformation w.r.t world coordinates.
 
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 JacobianDOFs (double [3], int, double, double, double, double=0, double=NaN) const
 Calculates the Jacobian of the transformation w.r.t a transformation parameter.
 
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 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 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 void LocalJacobian (Matrix &, double, double, double, double=0, double=NaN) const
 Calculates the Jacobian of the local transformation w.r.t world coordinates.
 
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.
 
virtual void LocalTransform (double &, double &, double &, double=0, double=NaN) const =0
 Transforms a single point using the local transformation component only.
 
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.
 
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=NaN, double=1) const
 
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
 
virtual void ParametricGradient (const PointSet &, const Vector3D< double > *, double *, double=0, double=NaN, double=1) const
 
void Print (Indent=0) const
 Prints information about the transformation.
 
virtual void Print (ostream &os, Indent=0) const =0
 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 bool RequiresCachingOfDisplacements () const
 
virtual void Reset ()
 Reset transformation.
 
virtual bool Set (const char *, const char *)
 Set named (non-DoF) parameter from value as string.
 
virtual void Transform (double &, double &, double &, double=0, double=NaN) const =0
 Transforms a single point.
 
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.
 

Static Public Member Functions

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.
 

Protected Member Functions

void InitializeDOFs (int)
 Initialize transformation parameters.
 
void InitializeDOFs (const Transformation &, int=-1)
 Copy transformation parameters (DoFs) and their status.
 
virtual CifstreamReadDOFs (Cifstream &, TransformationType)
 Reads transformation parameters from a file stream.
 
 Transformation (int=0)
 Default constructor.
 
 Transformation (const Transformation &)
 Copy constructor.
 
 Transformation (const Transformation &, int)
 Copy constructor.
 
virtual CofstreamWriteDOFs (Cofstream &) const
 Writes transformation parameters to a file stream.
 
- 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
 

Protected Attributes

int _NumberOfDOFs
 Number of transformation parameters.
 
DOFValue_Param
 Value of each transformation parameter.
 
DOFStatus_Status
 Status of each transformation parameter (Active or Passive)
 

Additional Inherited Members

- Static Protected Member Functions inherited from mirtk::Object
template<typename... Args>
static void ThrowStatic (ErrorType err, const char *cls, const char *func, Args... args)
 

Detailed Description

Abstract base class for general transformations.

This is the abstract base class which defines a common interface for all transformations. Each derived class has to implement at least the abstract methods and some of the virtual ones. Most other methods call these virtual methods and should not be required to be overwritten in subclasses.

The second time argument to the interface methods corresponds to the time of the untransformed source image. It is only considered by some 3D+t transformations, in particular those which parameterize the transformation using a non-stationary velocity field.

Definition at line 62 of file Transformation.h.

Member Function Documentation

§ Approximate() [1/4]

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

Approximate displacements: This function takes a set of points and a set of displacements and finds a transformation which approximates these displacements. After approximation, the displacements are replaced by the residual displacement errors at the points.

§ Approximate() [2/4]

virtual double mirtk::Transformation::Approximate ( const ImageAttributes ,
double *  ,
double *  ,
double *  ,
int  = 1,
double  = .0 
)
virtual

Approximate displacements: This function takes a set of points and a set of displacements and finds a transformation which approximates these displacements. After approximation, the displacements are replaced by the residual displacement errors at the points.

Reimplemented in mirtk::FreeFormTransformation, mirtk::FluidFreeFormTransformation, mirtk::HomogeneousTransformation, mirtk::MultiLevelTransformation, and mirtk::MultiLevelFreeFormTransformation.

§ Approximate() [3/4]

virtual double mirtk::Transformation::Approximate ( const double *  ,
const double *  ,
const double *  ,
double *  ,
double *  ,
double *  ,
int  ,
int  = 1,
double  = .0 
)
virtual

Approximate displacements: This function takes a set of points and a set of displacements and finds a transformation which approximates these displacements. After approximation, the displacements are replaced by the residual displacement errors at the points.

Reimplemented in mirtk::FreeFormTransformation, mirtk::FluidFreeFormTransformation, mirtk::HomogeneousTransformation, mirtk::MultiLevelTransformation, and mirtk::MultiLevelFreeFormTransformation.

§ Approximate() [4/4]

virtual double mirtk::Transformation::Approximate ( const double *  ,
const double *  ,
const double *  ,
const double *  ,
double *  ,
double *  ,
double *  ,
int  ,
int  = 1,
double  = .0 
)
virtual

Approximate displacements: This function takes a set of points and a set of displacements and finds a transformation which approximates these displacements. After approximation, the displacements are replaced by the residual displacement errors at the points.

Reimplemented in mirtk::FreeFormTransformation, mirtk::FluidFreeFormTransformation, mirtk::HomogeneousTransformation, mirtk::MultiLevelTransformation, and mirtk::MultiLevelFreeFormTransformation.

§ ApproximateAsNew() [1/4]

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

Approximate displacements: This function takes a set of points and a set of displacements and finds a !new! transformation which approximates these displacements. After approximation, the displacements are replaced by the residual displacement errors at the points.

Reimplemented in mirtk::BSplineFreeFormTransformationSV.

§ ApproximateAsNew() [2/4]

virtual double mirtk::Transformation::ApproximateAsNew ( const ImageAttributes ,
double *  ,
double *  ,
double *  ,
int  = 1,
double  = .0 
)
virtual

Approximate displacements: This function takes a set of points and a set of displacements and finds a !new! transformation which approximates these displacements. After approximation, the displacements are replaced by the residual displacement errors at the points.

Reimplemented in mirtk::FreeFormTransformation, mirtk::FluidFreeFormTransformation, mirtk::MultiLevelTransformation, and mirtk::MultiLevelFreeFormTransformation.

§ ApproximateAsNew() [3/4]

virtual double mirtk::Transformation::ApproximateAsNew ( const double *  ,
const double *  ,
const double *  ,
double *  ,
double *  ,
double *  ,
int  ,
int  = 1,
double  = .0 
)
virtual

Approximate displacements: This function takes a set of points and a set of displacements and finds a !new! transformation which approximates these displacements. After approximation, the displacements are replaced by the residual displacement errors at the points.

Reimplemented in mirtk::FluidFreeFormTransformation, mirtk::MultiLevelTransformation, and mirtk::MultiLevelFreeFormTransformation.

§ ApproximateAsNew() [4/4]

virtual double mirtk::Transformation::ApproximateAsNew ( const double *  ,
const double *  ,
const double *  ,
const double *  ,
double *  ,
double *  ,
double *  ,
int  ,
int  = 1,
double  = .0 
)
virtual

Approximate displacements: This function takes a set of points and a set of displacements and finds a !new! transformation which approximates these displacements. After approximation, the displacements are replaced by the residual displacement errors at the points.

Reimplemented in mirtk::FluidFreeFormTransformation, mirtk::MultiLevelTransformation, and mirtk::MultiLevelFreeFormTransformation.

§ ApproximateDOFs()

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

§ ApproximateDOFsGradient()

virtual void mirtk::Transformation::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 in mirtk::FluidFreeFormTransformation, mirtk::MultiLevelTransformation, mirtk::MultiLevelFreeFormTransformation, mirtk::BSplineFreeFormTransformationSV, mirtk::BSplineFreeFormTransformation3D, mirtk::LinearFreeFormTransformationTD, mirtk::BSplineFreeFormTransformationTD, mirtk::LinearFreeFormTransformation3D, mirtk::BSplineFreeFormTransformation4D, mirtk::LinearFreeFormTransformation4D, and mirtk::BSplineFreeFormTransformationStatistical.

§ ApproximateGradient() [1/3]

virtual void mirtk::Transformation::ApproximateGradient ( const ImageAttributes ,
const double *  ,
const double *  ,
const double *  ,
double *  ,
double  = 1.0 
) const
virtual

Finds gradient of approximation error: This function takes a set of points and a set of errors and finds a gradient to minimize the L2 norm of the error.

§ ApproximateGradient() [2/3]

virtual void mirtk::Transformation::ApproximateGradient ( 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 and finds a gradient to minimize the L2 norm of the error.

§ ApproximateGradient() [3/3]

virtual void mirtk::Transformation::ApproximateGradient ( 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 and finds a gradient to minimize the L2 norm of the error.

§ CanModifyDisplacement()

virtual bool mirtk::Transformation::CanModifyDisplacement ( int  = -1) const
virtual

Whether this transformation implements a more efficient update of a given displacement field given the desired change of a transformation parameter

Reimplemented in mirtk::BSplineFreeFormTransformation3D, and mirtk::MultiLevelFreeFormTransformation.

§ CopyFrom()

virtual bool mirtk::Transformation::CopyFrom ( const Transformation )
virtual

Copy active transformation parameters (DoFs) from given transformation if possible and return false, otherwise

Reimplemented in mirtk::FreeFormTransformation, mirtk::FluidFreeFormTransformation, mirtk::MultiLevelTransformation, mirtk::HomogeneousTransformation, mirtk::AffineTransformation, and mirtk::SimilarityTransformation.

§ Displacement() [1/3]

virtual void mirtk::Transformation::Displacement ( const ImageAttributes ,
double *  ,
double *  ,
double *   
) const
virtual

Calculates the displacement at specified lattice points

Attention
The displacements are computed at the positions after applying the current displacements at each point. 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 lattice points.

§ Displacement() [2/3]

virtual void mirtk::Transformation::Displacement ( GenericImage< double > &  ,
double  ,
double  ,
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 in mirtk::MultiLevelTransformation, mirtk::BSplineFreeFormTransformationSV, and mirtk::PartialBSplineFreeFormTransformationSV.

§ Displacement() [3/3]

virtual void mirtk::Transformation::Displacement ( GenericImage< float > &  ,
double  ,
double  ,
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 in mirtk::MultiLevelTransformation, mirtk::BSplineFreeFormTransformationSV, and mirtk::PartialBSplineFreeFormTransformationSV.

§ DisplacementAfterDOFChange()

virtual void mirtk::Transformation::DisplacementAfterDOFChange ( int  dof,
double  dv,
GenericImage< double > &  dx,
double  t,
double  t0 = NaN,
const WorldCoordsImage i2w = NULL 
) const
virtual

Updates the displacement vectors for a whole image domain

Parameters
[in]dofTransformation parameter.
[in]dvChange of transformation parameter value.
[in,out]dxDisplacement field to be updated.
[in]tTime point of start point.
[in]t0Time point of end point.
[in]i2wPre-computed world coordinates.

Reimplemented in mirtk::BSplineFreeFormTransformation3D, and mirtk::MultiLevelFreeFormTransformation.

§ DOFBoundingBox()

bool mirtk::Transformation::DOFBoundingBox ( const Image image,
int  ,
int &  i1,
int &  j1,
int &  k1,
int &  i2,
int &  j2,
int &  k2,
double  fraction = 1 
) const
inlinevirtual

Gets the spatial bounding box for a transformation parameter in image coordinates. The last parameter specifies what fraction of the bounding box to return. The default is 1 which equals 100% of the bounding box.

Reimplemented in mirtk::FreeFormTransformation, mirtk::FluidFreeFormTransformation, and mirtk::MultiLevelFreeFormTransformation.

Definition at line 780 of file Transformation.h.

§ EvaluateRMSError() [1/2]

double mirtk::Transformation::EvaluateRMSError ( const ImageAttributes ,
double *  ,
double *   
) const

Evaluates RMS error of transformation compared to given displacement field

This overloaded version of EvaluateRMSError is recommended for displacement fields defined on a regular lattice. It does not require memory for the explicit storage of the locations of each displacement vector. Moreover, if this transformation requires the caching of the displacements, the other overloads are either very slow or cannot be used.

§ EvaluateRMSError() [2/2]

double mirtk::Transformation::EvaluateRMSError ( const ImageAttributes ,
double *  ,
double *  ,
double *   
) const

Evaluates RMS error of transformation compared to given displacement field

This overloaded version of EvaluateRMSError is recommended for displacement fields defined on a regular lattice. It does not require memory for the explicit storage of the locations of each displacement vector. Moreover, if this transformation requires the caching of the displacements, the other overloads are either very slow or cannot be used.

§ Inverse()

int mirtk::Transformation::Inverse ( PointSet pset,
double  t = 0,
double  t0 = NaN 
) const
inlinevirtual

Transforms a set of points using the inverse of the transformation

Returns
Number of points at which transformation is non-invertible.

Definition at line 817 of file Transformation.h.

§ InverseDisplacement() [1/5]

virtual int mirtk::Transformation::InverseDisplacement ( const ImageAttributes ,
double *  ,
double *  ,
double *   
) const
virtual

Calculates the inverse displacement at specified lattice points

Attention
The displacements are computed at the positions after applying the current displacements at each point. 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 lattice points.
Returns
Number of points at which transformation is non-invertible.

§ InverseDisplacement() [2/5]

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

Calculates the inverse displacement vectors for a whole image domain

Returns
Number of points at which transformation is non-invertible.

§ InverseDisplacement() [3/5]

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

Calculates the inverse displacement vectors for a whole image domain

Returns
Number of points at which transformation is non-invertible.

§ InverseDisplacement() [4/5]

virtual int mirtk::Transformation::InverseDisplacement ( GenericImage< double > &  ,
double  ,
double  ,
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
Number of points at which transformation is non-invertible.

Reimplemented in mirtk::MultiLevelTransformation, mirtk::BSplineFreeFormTransformationSV, and mirtk::PartialBSplineFreeFormTransformationSV.

§ InverseDisplacement() [5/5]

virtual int mirtk::Transformation::InverseDisplacement ( GenericImage< float > &  ,
double  ,
double  ,
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
Number of points at which transformation is non-invertible.

Reimplemented in mirtk::MultiLevelTransformation, mirtk::BSplineFreeFormTransformationSV, and mirtk::PartialBSplineFreeFormTransformationSV.

§ New() [1/3]

static Transformation* mirtk::Transformation::New ( TransformationType  )
static

Static constructor. This function returns a pointer to a concrete new transformation of the specified type (e.g., TRANSFORMATION_RIGID).

§ New() [2/3]

static Transformation* mirtk::Transformation::New ( const Transformation )
static

Static constructor. This function returns a pointer to a concrete transformation by copying the transformation passed to it.

§ New() [3/3]

static Transformation* mirtk::Transformation::New ( const char *  )
static

Static constructor. This function returns a pointer to a concrete transformation by reading the transformation parameters from a file and creating the appropriate transformation.

§ ParametricGradient() [1/7]

virtual void mirtk::Transformation::ParametricGradient ( const GenericImage< double > *  ,
double *  ,
const WorldCoordsImage ,
const WorldCoordsImage ,
double  = NaN,
double  = 1 
) const
virtual

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

If the transformation itself is non-parametric, the gradient will be passed through unchanged. The default implementation uses the full Jacobian matrix computed for each DoF separately (i.e., calls JacobianDOFs for each DoF).

For 4D transformations, the temporal coordinate t used for the computation of the Jacobian of the transformation w.r.t the transformation parameters for all spatial (x, y, z) voxel coordinates in world units, is assumed to correspond to the temporal origin of the given gradient image. For 4D transformations parameterized by velocities, a second time for the upper integration bound can be provided as last argument to this method. This last argument is ignored by transformations parameterized by displacements.

See also
ImageSimilarityMetric::EvaluateGradient

Reimplemented in mirtk::FreeFormTransformation, mirtk::BSplineFreeFormTransformationSV, mirtk::BSplineFreeFormTransformation3D, mirtk::FluidFreeFormTransformation, mirtk::MultiLevelStationaryVelocityTransformation, mirtk::MultiLevelFreeFormTransformation, mirtk::BSplineFreeFormTransformation4D, mirtk::PartialMultiLevelStationaryVelocityTransformation, mirtk::PartialBSplineFreeFormTransformationSV, mirtk::BSplineFreeFormTransformationTD, mirtk::BSplineFreeFormTransformationStatistical, mirtk::PartialAffineTransformation, mirtk::FreeFormTransformation3D, and mirtk::FreeFormTransformation4D.

§ ParametricGradient() [2/7]

void mirtk::Transformation::ParametricGradient ( const GenericImage< double > *  in,
double *  out,
const WorldCoordsImage i2w,
double  t0 = NaN,
double  w = 1 
) const
inline

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

Definition at line 1000 of file Transformation.h.

§ ParametricGradient() [3/7]

void mirtk::Transformation::ParametricGradient ( const GenericImage< double > *  in,
double *  out,
double  t0 = NaN,
double  w = 1 
) const
inline

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

Definition at line 1008 of file Transformation.h.

§ ParametricGradient() [4/7]

void mirtk::Transformation::ParametricGradient ( const GenericImage< double > **  in,
int  n,
double *  out,
const WorldCoordsImage i2w,
const WorldCoordsImage wc,
const double *  t0 = NULL,
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 in mirtk::PartialMultiLevelStationaryVelocityTransformation, and mirtk::PartialBSplineFreeFormTransformationSV.

Definition at line 1015 of file Transformation.h.

§ ParametricGradient() [5/7]

void mirtk::Transformation::ParametricGradient ( const GenericImage< double > **  in,
int  n,
double *  out,
const WorldCoordsImage i2w,
const double *  t0 = NULL,
double  w = 1 
) const
inline

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

Definition at line 1026 of file Transformation.h.

§ ParametricGradient() [6/7]

void mirtk::Transformation::ParametricGradient ( const GenericImage< double > **  in,
int  n,
double *  out,
const double *  t0 = NULL,
double  w = 1 
) const
inline

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

Definition at line 1034 of file Transformation.h.

§ ParametricGradient() [7/7]

virtual void mirtk::Transformation::ParametricGradient ( const PointSet ,
const Vector3D< double > *  ,
double *  ,
double  = 0,
double  = NaN,
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 in mirtk::FreeFormTransformation, mirtk::BSplineFreeFormTransformationSV, mirtk::FluidFreeFormTransformation, mirtk::MultiLevelFreeFormTransformation, mirtk::BSplineFreeFormTransformationTD, and mirtk::FreeFormTransformation3D.

§ RequiresCachingOfDisplacements()

bool mirtk::Transformation::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 in mirtk::BSplineFreeFormTransformationSV, mirtk::MultiLevelTransformation, mirtk::PartialMultiLevelStationaryVelocityTransformation, mirtk::MultiLevelStationaryVelocityTransformation, and mirtk::PartialBSplineFreeFormTransformationSV.

Definition at line 793 of file Transformation.h.

§ Verify()

virtual void mirtk::Transformation::Verify ( )
virtual

Verifies that the transformation is well constructed according to class-specific rules

Reimplemented in mirtk::BSplineFreeFormTransformationStatistical.


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