#include <PartialAffineTransformation.h>
Public Member Functions | |
virtual bool | HasSameDOFsAs (const class Transformation *) const |
Checks whether transformation depends on the same vector of parameters. | |
virtual void | ParametricGradient (const GenericImage< double > *, double *, const WorldCoordsImage *=NULL, const WorldCoordsImage *=NULL, double=0, double=1) const |
PartialAffineTransformation (HomogeneousTransformation *=NULL, double=1.0) | |
Constructor. | |
void | Transformation (HomogeneousTransformation *) |
Set decorated rigid, similarity, or affine transformation. | |
virtual | ~PartialAffineTransformation () |
Destructor. | |
Public Member Functions inherited from mirtk::AffineTransformation | |
AffineTransformation () | |
Default constructor. | |
AffineTransformation (const RigidTransformation &) | |
Copy constructor. | |
AffineTransformation (const SimilarityTransformation &) | |
Copy constructor. | |
AffineTransformation (const AffineTransformation &) | |
Copy constructor. | |
void | AllowRotations (bool) |
Set status of rotation parameters to active/passive. | |
bool | AllowRotations () const |
Whether all rotation parameters are active. | |
void | AllowScaling (bool) |
Set status of scaling parameters to active/passive. | |
bool | AllowScaling () const |
Whether all scaling parameters are active. | |
void | AllowShearing (bool) |
Set status of shearing parameters to active/passive. | |
bool | AllowShearing () const |
Whether all shearing parameters are active. | |
void | AllowTranslations (bool) |
Set status of translation parameters to active/passive. | |
bool | AllowTranslations () const |
Whether all translation parameters are active. | |
virtual void | ApproximateDOFs (const double *, const double *, const double *, const double *, const double *, const double *, const double *, int) |
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=-1) const |
Calculates the derivative of the Jacobian of the transformation (w.r.t. world coordinates) w.r.t. a transformation parameter. | |
double | GetScale () const |
Not supported for affine transformation! | |
double | GetScaleX () const |
Gets scaling factor along the x-axis. | |
double | GetScaleY () const |
Gets scaling factor along the y-axis. | |
double | GetScaleZ () const |
Gets scaling factor along the z-axis. | |
double | GetShearXY () const |
Gets y-dependent skewing angle in the x direction (in degrees) | |
double | GetShearXZ () const |
Gets z-dependent skewing angle in the x direction (in degrees) | |
double | GetShearYZ () const |
Gets z-dependent skewing angle in the y direction (in degrees) | |
virtual void | JacobianDOFs (double [3], int, double, double, double, double=0, double=-1) const |
Calculates the Jacobian of the transformation w.r.t the parameters. | |
virtual ParameterList | Parameter () const |
Get (non-DoF) parameters as key/value as string map. | |
virtual void | Print (ostream &, Indent=0) const |
Prints the parameters of the transformation. | |
void | PutScale (double) |
Puts global scaling factor. | |
void | PutScaleX (double) |
Puts scaling factor along the x-axis. | |
void | PutScaleY (double) |
Puts scaling factor along the y-axis. | |
void | PutScaleZ (double) |
Puts scaling factor along the z-axis. | |
void | PutShearXY (double) |
Puts y-dependent skewing angle in the x direction (in degrees) | |
void | PutShearXZ (double) |
Puts z-dependent skewing angle in the x direction (in degrees) | |
void | PutShearYZ (double) |
Puts z-dependent skewing angle in the y direction (in degrees) | |
virtual bool | Set (const char *, const char *) |
Set named (non-DoF) parameter from value as string. | |
virtual void | UpdateDOFs () |
Update transformation parameters after change of matrix. | |
virtual void | UpdateMatrix () |
Update transformation matrix after change of parameter. | |
virtual Cofstream & | Write (Cofstream &) const |
Writes a transformation to a file stream. | |
virtual | ~AffineTransformation () |
Destructor. | |
Public Member Functions inherited from mirtk::SimilarityTransformation | |
SimilarityTransformation () | |
Default constructor. | |
SimilarityTransformation (const RigidTransformation &) | |
Copy constructor. | |
SimilarityTransformation (const SimilarityTransformation &) | |
Copy constructor. | |
virtual | ~SimilarityTransformation () |
Destructor. | |
Public Member Functions inherited from mirtk::RigidTransformation | |
double | GetRotationX () const |
Gets rotation angle around the x-axis. | |
double | GetRotationY () const |
Gets rotation angle around the y-axis. | |
double | GetRotationZ () const |
Gets rotation angle around the z-axis. | |
double | GetTranslationX () const |
Gets translation along the x-axis. | |
double | GetTranslationY () const |
Gets translation along the y-axis. | |
double | GetTranslationZ () const |
Gets translation along the z-axis. | |
void | PutRotationX (double) |
Puts rotation angle around the x-axis (transformation matrix is updated) | |
void | PutRotationY (double) |
Puts rotation angle around the y-axis (transformation matrix is updated) | |
void | PutRotationZ (double) |
Puts rotation angle around the z-axis (transformation matrix is updated) | |
void | PutTranslationX (double) |
Puts translation along the x-axis (transformation matrix is updated) | |
void | PutTranslationY (double) |
Puts translation along the y-axis (transformation matrix is updated) | |
void | PutTranslationZ (double) |
Puts translation along the z-axis (transformation matrix is updated) | |
RigidTransformation () | |
Default constructor. | |
RigidTransformation (const RigidTransformation &) | |
Copy constructor. | |
virtual void | Rotate (double &x, double &y, double &z) const |
Transforms a single point by the rotation part of the rigid transformation. | |
void | SetParameters (double *params) |
virtual void | Translate (double &x, double &y, double &z) const |
Transforms a single point by the translation part of the rigid transformation. | |
virtual | ~RigidTransformation () |
Destructor. | |
Public Member Functions inherited from mirtk::HomogeneousTransformation | |
virtual void | Add (const DOFValue *) |
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 | Approximate (const Matrix &) |
Approximate given homogeneous coordinate transformation matrix. | |
virtual double | ApproximateAsNew (const Matrix &) |
Approximate given homogeneous coordinate transformation matrix. | |
const Matrix & | GetInverseMatrix () const |
Gets the inverse transformation matrix. | |
const Matrix & | GetMatrix () const |
Gets the transformation matrix. | |
virtual void | GlobalInverse (double &, double &, double &, double=0, double=-1) const |
Transforms a single point using the inverse of the global transformation only. | |
virtual void | GlobalJacobian (Matrix &, double, double, double, double=0, double=-1) const |
Calculates the Jacobian of the global transformation w.r.t world coordinates. | |
virtual void | GlobalTransform (double &, double &, double &, double=0, double=-1) const |
Transforms a single point using the global transformation component only. | |
HomogeneousTransformation () | |
Default constructor. | |
HomogeneousTransformation (const Matrix &) | |
Construct from 4x4 transformation matrix (without checks) | |
HomogeneousTransformation (const HomogeneousTransformation &) | |
Copy Constructor. | |
virtual bool | Inverse (double &, double &, double &, double=0, double=-1) const |
Transforms a single point using the inverse of the transformation. | |
void | Invert () |
Inverts the transformation. | |
virtual bool | IsIdentity () const |
Checks whether transformation is an identity mapping. | |
virtual void | Jacobian (Matrix &, double, double, double, double=0, double=-1) const |
Calculates the Jacobian of the transformation w.r.t world coordinates. | |
virtual bool | LocalInverse (double &, double &, double &, double=0, double=-1) const |
Transforms a single point using the inverse of the local transformation only. | |
virtual void | LocalJacobian (Matrix &, double, double, double, double=0, double=-1) const |
Calculates the Jacobian of the local transformation w.r.t world coordinates. | |
virtual void | LocalTransform (double &, double &, double &, double=0, double=-1) const |
Transforms a single point using the local transformation component only. | |
virtual void | Put (int, DOFValue) |
Puts a transformation parameter. | |
virtual void | Put (const DOFValue *) |
Puts transformation parameters. | |
void | PutMatrix (const Matrix &) |
virtual void | Reset () |
Reset transformation. | |
virtual void | Transform (double &, double &, double &, double=0, double=-1) const |
Transforms a single point. | |
virtual double | Update (const DOFValue *) |
void | UpdateParameter () |
virtual | ~HomogeneousTransformation () |
Destructor. | |
Public Member Functions inherited from mirtk::Transformation | |
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 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 | 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 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 | 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 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 (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 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 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 | 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 |
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 | PutStatus (int, DOFStatus) |
Put status of transformation parameter. | |
virtual void | Read (const char *) |
Reads a transformation from a file. | |
virtual Cifstream & | Read (Cifstream &) |
Reads a transformation from a file stream. | |
virtual bool | RequiresCachingOfDisplacements () const |
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 void | Verify () |
virtual void | Write (const char *) const |
Writes a transformation to a file. | |
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. | |
Additional Inherited Members | |
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::AffineTransformation | |
static Matrix | DOFs2Matrix (const double *) |
Construct transformation matrix based on parameters. | |
static void | Matrix2DOFs (const Matrix &, double *) |
Extract parameters from transformation matrix. | |
Static Public Member Functions inherited from mirtk::SimilarityTransformation | |
static Matrix | DOFs2Matrix (const double *) |
Construct a matrix based on parameters passed in the array. | |
Static Public Member Functions inherited from mirtk::RigidTransformation | |
static Matrix | DOFs2Matrix (const double *) |
Construct a matrix based on parameters passed in the array. | |
static void | Matrix2DOFs (const Matrix &, double *) |
Return an array with parameters corresponding to a given matrix. | |
Static Public Member Functions inherited from mirtk::Transformation | |
static bool | CheckHeader (const char *) |
Whether magic number in header of given file. | |
static Transformation * | New (TransformationType) |
static Transformation * | New (const Transformation *) |
static Transformation * | New (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 inherited from mirtk::AffineTransformation | |
AffineTransformation (int) | |
Default constructor with given number of parameters. | |
AffineTransformation (const RigidTransformation &, int) | |
Copy constructor with given number of parameters. | |
AffineTransformation (const SimilarityTransformation &, int) | |
Copy constructor with given number of parameters. | |
AffineTransformation (const AffineTransformation &, int) | |
Copy constructor with given number of parameters. | |
virtual Cifstream & | ReadDOFs (Cifstream &, TransformationType) |
Reads a transformation from a file stream. | |
void | UpdateShearingTangent () |
Update cached tangents of shearing angles. | |
Protected Member Functions inherited from mirtk::SimilarityTransformation | |
SimilarityTransformation (int) | |
Default constructor with given number of parameters. | |
SimilarityTransformation (const RigidTransformation &, int) | |
Copy constructor with given number of parameters. | |
SimilarityTransformation (const SimilarityTransformation &, int) | |
Copy constructor with given number of parameters. | |
Protected Member Functions inherited from mirtk::RigidTransformation | |
RigidTransformation (int) | |
Default constructor with given number of parameters. | |
RigidTransformation (const RigidTransformation &, int) | |
Copy constructor with given number of parameters. | |
void | UpdateRotationSineCosine () |
Update cached sine and cosine of rotation angles. | |
Protected Member Functions inherited from mirtk::HomogeneousTransformation | |
HomogeneousTransformation (int) | |
Default constructor with given number of parameters. | |
HomogeneousTransformation (const HomogeneousTransformation &, int) | |
Copy constructor with given number of parameters. | |
void | Update (AttributeSelector) |
Update transformation parameters and/or matrices. | |
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. | |
virtual Cofstream & | WriteDOFs (Cofstream &) const |
Writes transformation parameters to a file stream. | |
Protected Member Functions inherited from mirtk::Observable | |
Observable () | |
Default constructor. | |
Observable (const Observable &) | |
Copy constructor. | |
Observable & | operator= (const Observable &) |
Assignment operator. | |
Protected Member Functions inherited from mirtk::Object | |
template<typename... Args> | |
void | Throw (ErrorType err, const char *func, Args... args) const |
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::AffineTransformation | |
double | _tansxy |
Tangent of shear angle sxy. | |
double | _tansxz |
Tangent of shear angle sxz. | |
double | _tansyz |
Tangent of shear angle syz. | |
Protected Attributes inherited from mirtk::RigidTransformation | |
double | _cosrx |
Cosine of rotation angle rx. | |
double | _cosry |
Cosine of rotation angle ry. | |
double | _cosrz |
Cosine of rotation angle rz. | |
double | _sinrx |
Sine of rotation angle rx. | |
double | _sinry |
Sine of rotation angle ry. | |
double | _sinrz |
Sine of rotation angle rz. | |
Protected Attributes inherited from mirtk::HomogeneousTransformation | |
Matrix | _inverse |
Inverse 4x4 transformation matrix for homogeneous coordinates. | |
Matrix | _matrix |
4x4 transformation matrix for homogeneous coordinates | |
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) | |
Class for partial linear transformation.
An instance of this class decorates either a rigid, similarity, or an affine transformation and represents only a fraction of this transformation, i.e., T(x) = A^t x = exp(t * log(A)) x. A negative fraction corresponds to the inverse transformation. The ParametricGradient function computes the update of the parameters of the decorated transformation. Instances of this class are used by the image registration filter for an inverse consistent and symmetric linear registration.
Note: For a symmetric inverse consistent linear registration, the use of AffineTransformation and InverseAffineTransformation is more efficient then two PartialAffineTransformation instances. For example, use the ireg
energy function setting "-NMI(I1 o T^-1, I2 o T)" instead of "-NMI(I1 o T^-0.5, I2 o T^0.5)". The resulting transformation has to be squared, i.e., applied twice to obtain the full transformation between I1 and I2, however.
Definition at line 51 of file PartialAffineTransformation.h.
|
virtual |
Applies the chain rule to convert spatial non-parametric gradient to a gradient w.r.t the parameters of this transformation
Reimplemented from mirtk::Transformation.