General transforms can represent linear transforms, non-linear
(via thin-plate splines) transforms, user defined transforms, and
concatenations of these. All functions dealing with general
transforms involve objects of type ** General_transform**.

public void create_linear_transform( General_transform *transform, Transform *linear_transform )

- Creates a general transform consisting of a single linear
transform, specified by
. If a`linear_transform`is passed as the argument`NULL`, then an identity transform is created.`linear_transform`

public void create_thin_plate_transform( General_transform *transform, int n_dimensions, int n_points, float **points, float **displacements )

- Creates a general transform consisting of a thin plate spline,
which provides a smooth non-linear mapping of a multidimensional
space. The
argument is an array of size`points`by`n_points`, representing a set of points. The`n_dimensions`is a (`displacements`+`n_points`+ 1) by`n_dimensions`array, which is created by the following function:`n_dimensions`

public void get_nonlinear_warp( float **transformed_points, float **original_points, float **displacements, int n_points, int n_dimensions )

- Fills in the
array with the appropriate values to achieve a thin-plate spline transformation. The mapping will provide a smooth transformation of space such that each point in the`displacements`array maps exactly to the corresponding point in the`original_points`array. These displacements are then fed into the function`transformed_points`to create the general transform.`create_thin_plane_transform`

typedef void (*User_transform_function)( void *user_data, Real x, Real y, Real z, Real *x_trans, Real *y_trans, Real *z_trans ); public void create_user_transform( General_transform *transform, void *user_data, size_t size_user_data, User_transform_function transform_function, User_transform_function inverse_transform_function )

- Creates a user defined transformation, by copying the user data
(
bytes of data starting at`size_user_data`). Two function pointers are also required, to specify the method of transforming points and inversely transforming points. These functions are of the type`user_data`, which is specified above.`User_transform_function`

public void delete_general_transform( General_transform *transform )

- Frees up the memory stored in the general transform structure.

public Transform_types get_transform_type( General_transform *transform )

- Returns the general transform type, one of
,`LINEAR`,`THIN_PLATE_SPLINE`, or`USER_TRANSFORM`.`CONCATENATED_TRANSFORM`

public Transform *get_linear_transform_ptr( General_transform *transform )

- If the general transform is of type
, then returns a pointer to the linear transform (of type`LINEAR`), for use with the routines specific to linear transforms, described earlier. Otherwise prints an error message.`Transform`

public void concat_general_transforms( General_transform *first, General_transform *second, General_transform *result )

- Concatenates two general transforms. If both transforms are of
type
, then the result is also of this type, being the matrix product of the two. Otherwise, the resulting transform is simply the concatenation of the two transforms.`LINEAR`

public int get_n_concated_transforms( General_transform *transform )

- Returns the number of concatenated transforms in the given
transform. If the type of the transform is
, then the number returned is the number of transforms, otherwise it is one.`CONCATENATED_TRANSFORM`

public General_transform *get_nth_general_transform( General_transform *transform, int n )

- If the transform is of type
, then a pointer to the`CONCATENATED_TRANSFORM`'th transform is returned, where`n`is greater than or equal to zero and less than the number of transforms in the concatenated transform.`n`

Fri Feb 17 15:37:42 EST 1995