1 /* Additional things we define for the NIfTI-1 format.  Some of these
2  * should probably be included in the header files.
3  */
4 
5 /* NIfTI-1 (Analyze 7.5) files can have at most 8 dimensions. This should
6  * be defined in nifti1.h
7  */
8 #define MAX_NII_DIMS 8
9 
10 /* Length of NIfTI-1 description field. Should be defined in nifti1.h
11  */
12 #define MAX_NII_DESCRIP 80
13 
14 /* File types.  These should be part of the nifti1_io.h header.
15  */
16 #define FT_UNSPECIFIED (-1)
17 #define FT_ANALYZE 0
18 #define FT_NIFTI_SINGLE 1
19 #define FT_NIFTI_DUAL 2
20 #define FT_NIFTI_ASCII 3
21 
22 /******
23  * Private stuff we use for mapping NIfTI-1 dimensions onto MINC dimensions.
24  **/
25 /* # spatial dimensions */
26 #define MAX_SPACE_DIMS 3
27 /* World coordinates */
28 #define DIM_X 0
29 #define DIM_Y 1
30 #define DIM_Z 2
31 /* Voxel coordinates */
32 #define DIM_I 0
33 #define DIM_J 1
34 #define DIM_K 2
35 
36 #define DIMORDER_ZYX 0
37 #define DIMORDER_YZX 1
38 #define DIMORDER_XZY 2
39 #define DIMORDER_XYZ 3
40 #define DIMORDER_ZXY 4
41 #define DIMORDER_YXZ 5
42 
43 /* Map dimension index from the actual mapping of the data array to the
44  * "internal header array order".
45  *
46  * In other words, NIfTI-1 seems to store the lengths of dimensions in this
47  * order: X, Y, Z, T, V in the dim[8] entry.
48  * But data is actually stored with the vector dimension varying _slowest_,
49  * with the X dimension varying _fastest_, i.e. as if it were a  C array
50  * declared array[V][T][Z][Y][X];
51  */
52 
53 static const int dimmap[MAX_NII_DIMS] = {
54     4,
55     3,
56     2,
57     1,
58     0,
59     -1,
60     -1,
61     -1
62 };
63 
64 /* Names of MINC spatial dimensions, in our "standard" world ordering.
65  */
66 static const char *mnc_spatial_names[MAX_SPACE_DIMS] = {
67     MIxspace,
68     MIyspace,
69     MIzspace
70 };
71