Programmer's Reference for the BIC Volume IO Library | ||
---|---|---|
<<< Previous | Next >>> |
In dealing with such tasks as inter- and intra-subject registration both within and across imaging modalities, the concept of transformations between different coordinate systems arises. A module is provided to handle both linear (affine) and non-linear transformations, and to provide input and output in a standardized Brain Imaging Centre format, usually to filenames with the extension .xfm.
To support these functions, two structure types are provided. The first (Transform) is a four by four linear (affine) transform, which facilitates rigid transformations, consisting of scaling, rotation, translation, and shearing. The second is a higher level transform (General_transform), which represents either a linear transform, a non-linear transform (thin-plate spline), a smoothly interpolated grid transform, a user definable transform, or a concatenation of two or more of these.
The linear transform functions all deal with objects whose type is Transform.
#define Transform_elem( transform, i, j ) |
Is used to set or retrieve the value of the i'th row and j'th column of the transform, where 0<=i, j<=3
public void make_identity_transform( Transform *transform ) |
Creates a four by four identity transform.
public void transform_point( Transform *transform, Real x, Real y, Real z, Real *x_trans, Real *y_trans, Real *z_trans ) |
Transforms a three dimensional point by the given transform, passing back the three transformed coordinates.
public void transform_vector( Transform *transform, Real x, Real y, Real z, Real *x_trans, Real *y_trans, Real *z_trans ) |
Transforms a three dimensional vector by the given transform, passing back the three transformed coordinates. The only difference between transforming a point and a vector is that transforming a vector does not involve the translational component of the transform.
public void inverse_transform_point( Transform *transform, Real x, Real y, Real z, Real *x_trans, Real *y_trans, Real *z_trans ) |
Assuming the transform is an orthogonal transform (no shear components), the point is transformed by the inverse of the transform.
public void inverse_transform_vector( Transform *transform, Real x, Real y, Real z, Real *x_trans, Real *y_trans, Real *z_trans ) |
Assuming the transform is an orthogonal transform (no shear components), the vector is transformed by the inverse of the transform.
public void concat_transforms( Transform *result, Transform *t1, Transform *t2 ) |
Multiplies the transform t2 by the transform t1, storing the product in result. Transforming a point by result is equivalent to transforming the point by t1, then transforming the result by t2.
<<< Previous | Home | Next >>> |
Tag Points | General Transforms |