1 /** internal minc2 data structures*/
2 #ifndef MINC2_STRUCTS_H
3 #define MINC2_STRUCTS_H
4 
5 #include "H5public.h"
6 
7 /************************************************************************
8  * ENUMS, STRUCTS, and TYPEDEFS
9  ************************************************************************/
10 /* These structure declarations exist to allow the following typedefs to
11  * work.  Since the details of these structures are not meant to be public,
12  * the actual structure definitions are in minc2_private.h
13  */
14 struct mivolprops;
15 struct midimension;
16 struct mivolume;
17 
18 /** \typedef mivolumeprops_t
19  * Opaque pointer to volume properties.
20  */
21 typedef struct mivolprops *mivolumeprops_t;
22 
23 
24 /** \typedef midimhandle_t
25  * Opaque pointer to a MINC dimension object.
26  */
27 typedef struct midimension *midimhandle_t;
28 
29 
30 /** \typedef mihandle_t
31  * The mihandle_t is an opaque type that represents a MINC file object.
32  */
33 typedef struct mivolume *mihandle_t;
34 
35 
36 /** \typedef milisthandle_t
37  * The milisthandle_t is an opaque type that represents a handle
38  * to iterate through various properties of MINC file object.
39  */
40 typedef void *milisthandle_t;
41 
42 /**
43  * This typedef used to represent the type of an individual voxel <b>as
44  * stored</b> by MINC 2.0.
45  */
46 typedef enum {
47   MI_TYPE_ORIGINAL = 0,     /**< MI_ORIGINAL_TYPE */
48   MI_TYPE_BYTE = 1,         /**< 8-bit signed integer */
49   MI_TYPE_SHORT = 3,        /**< 16-bit signed integer */
50   MI_TYPE_INT = 4,          /**< 32-bit signed integer */
51   MI_TYPE_FLOAT = 5,        /**< 32-bit floating point */
52   MI_TYPE_DOUBLE = 6,       /**< 64-bit floating point */
53   MI_TYPE_STRING = 7,       /**< ASCII string */
54   MI_TYPE_UBYTE = 100,      /**< 8-bit unsigned integer */
55   MI_TYPE_USHORT = 101,     /**< 16-bit unsigned integer */
56   MI_TYPE_UINT = 102,       /**< 32-bit unsigned integer */
57   MI_TYPE_SCOMPLEX = 1000,  /**< 16-bit signed integer complex */
58   MI_TYPE_ICOMPLEX = 1001,  /**< 32-bit signed integer complex */
59   MI_TYPE_FCOMPLEX = 1002,  /**< 32-bit floating point complex */
60   MI_TYPE_DCOMPLEX = 1003,  /**< 64-bit floating point complex */
61   MI_TYPE_UNKNOWN  = -1     /**< when the type is a record */
62 } mitype_t;
63 
64 /** \typedef miclass_t
65  * This typedef is used to represent the class of the MINC file.
66  *
67  * The class specifies the data's interpretation rather than its
68  * storage format. For example, a floating point class implies
69  * that the data may be stored as integers but must nonetheless be
70  * scaled into a "real" range before any mathematical operations
71  * are performed.  A label class implies that the values of a voxel
72  * should be considered to represent a symbol, and therefore many
73  * operations on the voxels would be considered meaningless.
74  */
75 typedef enum {
76   MI_CLASS_REAL = 0,            /**< Floating point (default) */
77   MI_CLASS_INT = 1,             /**< Integer */
78   MI_CLASS_LABEL = 2,           /**< Enumerated (named data values) */
79   MI_CLASS_COMPLEX = 3,         /**< Complex (real/imaginary) values */
80   MI_CLASS_UNIFORM_RECORD = 4,  /**< Aggregate datatypes consisting of multiple values of the same underlying type. */
81   MI_CLASS_NON_UNIFORM_RECORD = 5 /**< Aggregate datatypes consisting of multiple values of potentially differing types (not yet implemented). */
82 } miclass_t;
83 
84 /** \typedef midimclass_t
85  * Dimensions be members of one of several classes.  The "MI_DIMCLASS_ANY"
86  * value is never actually assigned to a dimension.  It is used in the
87  * programming interface to specify that an operation should apply to
88  * all dimensions regardless of class.
89  */
90 typedef enum {
91   MI_DIMCLASS_ANY = 0,        /**< Don't care (or unknown) */
92   MI_DIMCLASS_SPATIAL = 1,    /**< Spatial dimensions (x, y, z) */
93   MI_DIMCLASS_TIME = 2,       /**< Time dimension */
94   MI_DIMCLASS_SFREQUENCY = 3, /**< Spatial frequency dimensions */
95   MI_DIMCLASS_TFREQUENCY = 4, /**< Temporal frequency dimensions */
96   MI_DIMCLASS_USER = 5,       /**< Arbitrary user-defined dimension */
97   MI_DIMCLASS_RECORD = 6      /**< Record as dimension */
98 } midimclass_t;
99 
100 /** \typedef miorder_t
101  * Dimension order refers to the idea that data can be structured in
102  * a variety of ways with respect to the dimensions.  For example, a typical
103  * 3D scan could be structured as a transverse (ZYX) or sagittal (XZY) image.
104  * Since it may be convenient to write code which expects a particular
105  * dimension order, a user can specify an alternative ordering by using
106  * miset_apparent_dimension_order().  This will cause most functions
107  * to return data as if the file was in the apparent, rather than the
108  * file (native) order.
109  */
110 typedef enum {
111   MI_DIMORDER_FILE      = 0,
112   MI_DIMORDER_APPARENT  = 1
113 } miorder_t;
114 
115 /** \typedef midimalign_t
116  * Dimension alignment - one of CENTRE, START, END
117  */
118 typedef enum {
119   MI_DIMALIGN_CENTRE = 0,
120   MI_DIMALIGN_START = 1,
121   MI_DIMALIGN_END = 2
122 } midimalign_t;
123 
124 /** \typedef mivoxel_order_t
125  * Voxel order can be either file (native), or apparent, as set by
126  * the function miset_dimension_apparent_voxel_order().
127  */
128 typedef enum {
129   MI_ORDER_FILE      = 0,       /**< File order */
130   MI_ORDER_APPARENT  = 1        /**< Apparent (user) order  */
131 } mivoxel_order_t;
132 
133 /** \typedef miflipping_t
134  * Voxel flipping can be specified to either follow the file's native
135  * order, the opposite of the file's order, or it can be tied to the
136  * value of the dimension's step attribute.  A value of MI_NEGATIVE
137  * implies that the voxel order should be rearranged such that the step
138  * attribute is negative, a value of MI_POSITIVE implies the opposite.
139  */
140 typedef enum {
141   MI_FILE_ORDER         = 0,    /**< no flip */
142   MI_COUNTER_FILE_ORDER = 1,    /**< flip */
143   MI_POSITIVE           = 2,    /**< force step value to be positive */
144   MI_NEGATIVE           = 3     /**< force step value to be negative */
145 } miflipping_t;
146 
147 /** \typedef micompression_t
148  * Compression type
149  */
150 typedef enum {
151   MI_COMPRESS_NONE = 0,         /**< No compression */
152   MI_COMPRESS_ZLIB = 1          /**< GZIP compression */
153 } micompression_t;
154 
155 /** \typedef miboolean_t
156  * Boolean value
157  */
158 typedef int miboolean_t;
159 
160 /** \typedef midimattr_t
161  * Something about dimension attributes
162  */
163 typedef unsigned int midimattr_t;
164 
165 /** \typedef misize_t
166  * size of things
167  */
168 typedef hsize_t misize_t; /*based on HDF5 size*/
169 
170 /**  \typedef miscomplex_t
171  * 16-bit integer complex voxel.
172  */
173 typedef struct {
174   short real;                   /**< Real part */
175   short imag;                   /**< Imaginary part */
176 } miscomplex_t;
177 
178 /** \typedef miicomplex_t
179  * 32-bit integer complex voxel.
180  */
181 typedef struct {
182   int real;                     /**< Real part */
183   int imag;                     /**< Imaginary part */
184 } miicomplex_t;
185 
186 /** \typedef mifcomplex_t
187  * 32-bit floating point complex voxel.
188  */
189 typedef struct {
190   float real;                   /**< Real part */
191   float imag;                   /**< Imaginary part */
192 } mifcomplex_t;
193 
194 /** \typedef midcomplex_t
195  * 64-bit floating point complex voxel.
196  */
197 typedef struct {
198   double real;                  /**< Real part */
199   double imag;                  /**< Imaginary part */
200 } midcomplex_t;
201 
202 #endif //MINC2_STRUCTS_H
203