1 #ifndef VOL_IO_TRANSFORMS_H
2 #define VOL_IO_TRANSFORMS_H
3 
4 /* ----------------------------------------------------------------------------
5 @COPYRIGHT  :
6               Copyright 1993,1994,1995 David MacDonald,
7               McConnell Brain Imaging Centre,
8               Montreal Neurological Institute, McGill University.
9               Permission to use, copy, modify, and distribute this
10               software and its documentation for any purpose and without
11               fee is hereby granted, provided that the above copyright
12               notice appear in all copies.  The author and McGill University
13               make no representations about the suitability of this
14               software for any purpose.  It is provided "as is" without
15               express or implied warranty.
16 @VERSION    : $Header: /private-cvsroot/minc/volume_io/Include/volume_io/transforms.h,v 1.14 2005-05-19 21:19:28 bert Exp $
17 ---------------------------------------------------------------------------- */
18 
19 /* ----------------------------- MNI Header -----------------------------------
20 @NAME       : transforms.h
21 @INPUT      :
22 @OUTPUT     :
23 @RETURNS    :
24 @DESCRIPTION: Types for defining general transforms.
25 @METHOD     :
26 @GLOBALS    :
27 @CALLS      :
28 @CREATED    : 1993            David MacDonald
29 @MODIFIED   :
30 ---------------------------------------------------------------------------- */
31 
32 /* --- the list of supported transform types */
33 
34 typedef enum { LINEAR,
35                THIN_PLATE_SPLINE,
36                USER_TRANSFORM,
37                CONCATENATED_TRANSFORM,
38                GRID_TRANSFORM
39              } VIO_Transform_types;
40 
41 /* --- the user transformation function */
42 
43 typedef  void   (*VIO_User_transform_function)( void  *user_data,
44                                             VIO_Real  x,
45                                             VIO_Real  y,
46                                             VIO_Real  z,
47                                             VIO_Real  *x_trans,
48                                             VIO_Real  *y_trans,
49                                             VIO_Real  *z_trans );
50 
51 /* --- the general transformation type */
52 
53 typedef struct VIO_General_transform
54 {
55     VIO_Transform_types         type;
56     VIO_BOOL                    inverse_flag;
57 
58     /* --- linear transform */
59 
60     VIO_Transform               *linear_transform;
61     VIO_Transform               *inverse_linear_transform;
62 
63     /* --- thin-plate spline transform */
64 
65     int                         n_points;
66     int                         n_dimensions;
67     VIO_Real                    **points;
68     VIO_Real                    **displacements;   /* n_points + n_dim + 1 by */
69                                                    /* n_dim */
70 
71     /* --- grid transform */
72 
73     void                        *displacement_volume;
74     VIO_STR                     displacement_volume_file;
75 
76     /* --- user_defined */
77 
78     void                        *user_data;
79     size_t                      size_user_data;
80     VIO_User_transform_function     user_transform_function;
81     VIO_User_transform_function     user_inverse_transform_function;
82 
83     /* --- concatenated transform */
84 
85     int                         n_transforms;
86     struct VIO_General_transform    *transforms;
87 
88 } VIO_General_transform;
89 
90 #endif
91