#include <irtkBSplineFreeFormTransformation3D.h>
This class implements 3D free form transformation using B-splines.
For more details about the implementation see Lee, Wolberg and Shin, IEEE Transactions on Visualization and Computer Graphics, Vol. 3, No. 3, 1997.
Definition at line 28 of file irtkBSplineFreeFormTransformation3D.h.
Public Member Functions | |
irtkBSplineFreeFormTransformation3D () | |
Constructor. | |
irtkBSplineFreeFormTransformation3D (irtkBaseImage &, double=1, double=1, double=1) | |
Constructor. | |
irtkBSplineFreeFormTransformation3D (double x1, double y1, double z1, double x2, double y2, double z2, double dx, double dy, double dz, double *xaxis, double *yaxis, double *zaxis) | |
Constructor. | |
irtkBSplineFreeFormTransformation3D (const class irtkBSplineFreeFormTransformation3D &) | |
Copy Constructor. | |
virtual | ~irtkBSplineFreeFormTransformation3D () |
Destructor. | |
virtual double | Approximate (double *, double *, double *, double *, double *, double *, int) |
Approximate displacements: This function takes a set of points and a set of displacements and find a FFD which approximates these displacements. | |
virtual void | Interpolate (double *dxs, double *dys, double *dzs) |
Interpolates displacements: This function takes a set of displacements defined at the control points and finds a FFD which interpolates these displacements. | |
virtual void | Subdivide () |
Subdivide FFD. | |
virtual void | FFD1 (double &, double &, double &) const |
Calculates the FFD (for a point in FFD coordinates) with checks. | |
virtual void | FFD2 (double &, double &, double &) const |
Calculates the FFD (for a point in FFD coordinates) without checks. | |
virtual void | Transform (double &, double &, double &, double=0) |
Transforms a point. | |
virtual void | Transform2 (double &, double &, double &, double=0) |
Transforms a point without checks. | |
virtual void | GlobalTransform (double &, double &, double &, double=0) |
Transforms a point using the global transformation component only. | |
virtual void | LocalTransform (double &, double &, double &, double=0) |
Transforms a point using the local transformation component only. | |
virtual void | GlobalDisplacement (double &, double &, double &, double=0) |
Calculates displacement using the global transformation component only. | |
virtual void | LocalDisplacement (double &, double &, double &, double=0) |
Calculates displacement using the local transformation component only. | |
virtual void | Jacobian (irtkMatrix &, double, double, double, double=0) |
Calculate the Jacobian of the transformation. | |
virtual void | LocalJacobian (irtkMatrix &, double, double, double, double=0) |
Calculate the Jacobian of the local transformation. | |
virtual void | GlobalJacobian (irtkMatrix &, double, double, double, double=0) |
Calculate the Jacobian of the global transformation. | |
virtual double | Bending (double x, double y, double z) |
Calculate the bending energy of the transformation. | |
virtual void | BoundingBox (int, irtkPoint &, irtkPoint &, double=1) const |
Returns the bounding box for a control point (in mm). | |
virtual void | BoundingBox (int, double &, double &, double &, double &, double &, double &, double=1) const |
Returns the bounding box for a control point (in mm). | |
virtual void | BoundingBox (irtkGreyImage *, int, int &, int &, int &, int &, int &, int &, double=1) const |
Returns the bounding box for a control point (in pixels). | |
virtual void | Print () |
Prints the parameters of the transformation. | |
virtual const char * | NameOfClass () |
Returns a string with the name of the instantiated class. | |
virtual irtkCifstream & | Read (irtkCifstream &) |
Reads a transformation from a file. | |
virtual irtkCofstream & | Write (irtkCofstream &) |
Writes a transformation to a file. | |
virtual istream & | Import (istream &) |
Imports a transformation from a file. | |
virtual ostream & | Export (ostream &) |
Exports a transformation to a file. | |
Static Public Member Functions | |
static double | B (int, double) |
Returns the value of the i-th B-spline basis function. | |
static double | B_I (int, double) |
Returns the 1st derivative value of the i-th B-spline basis function. | |
static double | B_II (int, double) |
Returns the 2nd derivative value of the i-th B-spline basis function. | |
static int | CheckHeader (char *) |
Check file header. | |
Protected Member Functions | |
virtual void | Subdivide2D () |
Subdivide FFD in 2D. | |
virtual void | Subdivide3D () |
Subdivide FFD in 3D. | |
void | ComputeCoefficients (double *dxs, double *dys, double *dzs, irtkRealImage &xCoeffs, irtkRealImage &yCoeffs, irtkRealImage &zCoeffs) |
Computes the B-spline coefficients need to interpolate a displacement field. | |
Static Protected Member Functions | |
static double | B0 (double) |
Returns the value of the first B-spline basis function. | |
static double | B1 (double) |
Returns the value of the second B-spline basis function. | |
static double | B2 (double) |
Returns the value of the third B-spline basis function. | |
static double | B3 (double) |
Returns the value of the fourth B-spline basis function. | |
static double | B0_I (double) |
Returns the 1st derivative value of the first B-spline basis function. | |
static double | B1_I (double) |
Returns the 1st derivative value of the second B-spline basis function. | |
static double | B2_I (double) |
Returns the 1st derivative value of the third B-spline basis function. | |
static double | B3_I (double) |
Returns the 1st derivative value of the fourth B-spline basis function. | |
static double | B0_II (double) |
Returns the 2nd derivative value of the first B-spline basis function. | |
static double | B1_II (double) |
Returns the 2nd derivative value of the second B-spline basis function. | |
static double | B2_II (double) |
Returns the 2nd derivative value of the third B-spline basis function. | |
static double | B3_II (double) |
Returns the 2nd derivative value of the fourth B-spline basis function. | |
static double | InitialAntiCausalCoefficient (double *, int, double z) |
Initialize anti-causal coefficients. | |
static double | InitialCausalCoefficient (double *, int, double, double) |
Initialize causal coefficients. | |
static void | ConvertToInterpolationCoefficients (double *c, int DataLength, double *z, int NbPoles, double Tolerance) |
Convert from displacement field values to B-spline coefficient values. | |
Static Protected Attributes | |
static double | LookupTable [FFDLOOKUPTABLESIZE][4] |
Memory for lookup table for B-spline basis function values. | |
static double | LookupTable_I [FFDLOOKUPTABLESIZE][4] |
static double | LookupTable_II [FFDLOOKUPTABLESIZE][4] |
Friends | |
class | irtkLinearFreeFormTransformation |
static void irtkBSplineFreeFormTransformation3D::ConvertToInterpolationCoefficients | ( | double * | c, | |
int | DataLength, | |||
double * | z, | |||
int | NbPoles, | |||
double | Tolerance | |||
) | [static, protected] |
Convert from displacement field values to B-spline coefficient values.
void irtkBSplineFreeFormTransformation3D::ComputeCoefficients | ( | double * | dxs, | |
double * | dys, | |||
double * | dzs, | |||
irtkRealImage & | xCoeffs, | |||
irtkRealImage & | yCoeffs, | |||
irtkRealImage & | zCoeffs | |||
) | [protected] |
Computes the B-spline coefficients need to interpolate a displacement field.
virtual double irtkBSplineFreeFormTransformation3D::Approximate | ( | double * | , | |
double * | , | |||
double * | , | |||
double * | , | |||
double * | , | |||
double * | , | |||
int | ||||
) | [virtual] |
Approximate displacements: This function takes a set of points and a set of displacements and find a FFD which approximates these displacements.
After approximatation the displacements replaced by the residual displacement errors at the points
Implements irtkFreeFormTransformation3D.
virtual void irtkBSplineFreeFormTransformation3D::Interpolate | ( | double * | dxs, | |
double * | dys, | |||
double * | dzs | |||
) | [virtual] |
Interpolates displacements: This function takes a set of displacements defined at the control points and finds a FFD which interpolates these displacements.
dxs | The x-displacements at each control point. | |
dys | The y-displacements at each control point. | |
dzs | The z-displacements at each control point. |
Implements irtkFreeFormTransformation3D.
virtual void irtkBSplineFreeFormTransformation3D::BoundingBox | ( | int | , | |
irtkPoint & | , | |||
irtkPoint & | , | |||
double | = 1 | |||
) | const [virtual] |
Returns the bounding box for a control point (in mm).
The last parameter specifies what fraction of the bounding box to return. The default is 1 which equals 100% of the bounding box.
Implements irtkFreeFormTransformation3D.
virtual void irtkBSplineFreeFormTransformation3D::BoundingBox | ( | int | , | |
double & | , | |||
double & | , | |||
double & | , | |||
double & | , | |||
double & | , | |||
double & | , | |||
double | = 1 | |||
) | const [virtual] |
Returns the bounding box for a control point (in mm).
The last parameter specifies what fraction of the bounding box to return. The default is 1 which equals 100% of the bounding box.
Implements irtkFreeFormTransformation3D.
virtual void irtkBSplineFreeFormTransformation3D::BoundingBox | ( | irtkGreyImage * | , | |
int | , | |||
int & | , | |||
int & | , | |||
int & | , | |||
int & | , | |||
int & | , | |||
int & | , | |||
double | = 1 | |||
) | const [virtual] |
Returns the bounding box for a control point (in pixels).
The last parameter specifies what fraction of the bounding box to return. The default is 1 which equals 100% of the bounding box.
Implements irtkFreeFormTransformation3D.