| 1 |
/* dbh.h - Analyze 7.5 header file */ |
| 2 |
/* */ |
| 3 |
/* Compiled by Andrew Janke ([email protected]) */ |
| 4 |
/* from http://www.mayo.edu/bir/analyze/AnalyzeFileInfo.html */ |
| 5 |
/* http://homepage2.nifty.com/peco/gpetview/gpetview.html */ |
| 6 |
/* Chris Rorden - [email protected] */ |
| 7 |
/* Matthew Brett - [email protected] */ |
| 8 |
|
| 9 |
|
| 10 |
#define DT_NONE 0 /* No data type */ |
| 11 |
#define DT_UNKNOWN 0 /* Unknown data type */ |
| 12 |
#define DT_BINARY 1 /* Binary ( 1 bit per voxel) */ |
| 13 |
#define DT_UNSIGNED_CHAR 2 /* Unsigned character ( 8 bits per voxel) */ |
| 14 |
#define DT_SIGNED_SHORT 4 /* Signed short (16 bits per voxel) */ |
| 15 |
#define DT_SIGNED_INT 8 /* Signed integer (32 bits per voxel) */ |
| 16 |
#define DT_FLOAT 16 /* Floating point (32 bits per voxel) */ |
| 17 |
#define DT_COMPLEX 32 /* Complex (64 bits per voxel; 2 floating points) */ |
| 18 |
#define DT_DOUBLE 64 /* Double precision (64 bits per voxel) */ |
| 19 |
#define DT_RGB 128 /* Uchar x 3 (24 bits per voxel) */ |
| 20 |
#define DT_ALL 255 /* */ |
| 21 |
|
| 22 |
struct header_key{ /* off + size */ |
| 23 |
int sizeof_hdr; /* 0 + 4 - the byte size of the header file */ |
| 24 |
char data_type[10]; /* 4 + 10 - the data type of the file */ |
| 25 |
char db_name[18]; /* 14 + 18 - */ |
| 26 |
int extents; /* 32 + 4 - should be 16384 */ |
| 27 |
short int session_error; /* 36 + 2 - */ |
| 28 |
char regular; /* 38 + 1 - 'r' indicating all images/volumes are the same size */ |
| 29 |
char hkey_un0; /* 39 + 1 - */ |
| 30 |
}; /* total=40 bytes */ |
| 31 |
|
| 32 |
struct image_dimension{ /* off + size */ |
| 33 |
short int dim[8]; /* 0 + 16 - array of the image dimensions */ |
| 34 |
/* dim[0] # of dimensions in database; usually 4 */ |
| 35 |
/* dim[1] X dim - pixels in an image row */ |
| 36 |
/* dim[2] Y dim - pixel rows in slice */ |
| 37 |
/* dim[3] Z dim - slices in a volume */ |
| 38 |
/* dim[4] Time dim - volumes in database */ |
| 39 |
char vox_units[4]; /* 16 + 4 - specifies the spatial units of measure for a voxel */ |
| 40 |
char cal_units[8]; /* 20 + 8 - specifies the name of the calibration unit */ |
| 41 |
short int unused1; /* 28 + 2 */ |
| 42 |
short int datatype; /* 30 + 2 - datatype for this image set */ |
| 43 |
short int bitpix; /* 32 + 2 - # of bits per pixel 1, 8, 16, 32, or 64. */ |
| 44 |
short int dim_un0; /* 34 + 2 - */ |
| 45 |
float pixdim[8]; /* 36 + 32 - pixdim[] specifies the voxel dimensions: */ |
| 46 |
/* pixdim[1] - voxel width */ |
| 47 |
/* pixdim[2] - voxel height */ |
| 48 |
/* pixdim[3] - interslice distance */ |
| 49 |
/* ..etc */ |
| 50 |
float vox_offset; /* 68 + 4 - byte offset in the .img file at which voxels start. */ |
| 51 |
/* This value can be negative to specify that the */ |
| 52 |
/* absolute value is applied for every image */ |
| 53 |
float scale_factor; /* 72 + 4 = funused1; scale factor used by SPM; non standard */ |
| 54 |
float funused1; /* 76 + 4 */ |
| 55 |
float funused2; /* 80 + 4 */ |
| 56 |
float cal_max, cal_min; /* 84 + 8 - calibrated max and min: */ |
| 57 |
/* www.mailbase.ac.uk/lists/spm/2000-09/0099.html */ |
| 58 |
float compressed; /* 92 + 4 */ |
| 59 |
float verified; /* 96 + 4 */ |
| 60 |
int glmax, glmin; /* 100 + 8 - global max and min pixel values (entire database) */ |
| 61 |
}; /* total=108 bytes */ |
| 62 |
|
| 63 |
struct data_history{ /* off + size */ |
| 64 |
char descrip[80]; /* 0 + 80 */ |
| 65 |
char aux_file[24]; /* 80 + 24 */ |
| 66 |
char orient; /* 104 + 1 - slice orientation for this database | */ |
| 67 |
/* 0 transverse unflipped | */ |
| 68 |
/* 1 coronal unflipped | disregarded */ |
| 69 |
/* 2 sagittal unflipped | by SPM */ |
| 70 |
/* 3 transverse flipped | */ |
| 71 |
/* 4 coronal flipped | */ |
| 72 |
/* 5 sagittal flipped | */ |
| 73 |
short int originator[5]; /* 105 + 10 - origin | */ |
| 74 |
/* originator[0] x-origin | non standard */ |
| 75 |
/* originator[1] y-origin | SPM use only */ |
| 76 |
/* originator[2] z-origin | */ |
| 77 |
char generated[10]; /* 115 + 10 */ |
| 78 |
char scannum[10]; /* 125 + 10 */ |
| 79 |
char patient_id[10]; /* 135 + 10 */ |
| 80 |
char exp_date[10]; /* 145 + 10 */ |
| 81 |
char exp_time[10]; /* 155 + 10 */ |
| 82 |
char hist_un0[3]; /* 165 + 3 */ |
| 83 |
int views; /* 168 + 4 */ |
| 84 |
int vols_added; /* 172 + 4 */ |
| 85 |
int start_field; /* 176 + 4 */ |
| 86 |
int field_skip; /* 180 + 4 */ |
| 87 |
int omax, omin; /* 184 + 8 */ |
| 88 |
int smax, smin; /* 192 + 8 */ |
| 89 |
}; /* total=200 bytes */ |
| 90 |
|
| 91 |
struct dsr{ |
| 92 |
struct header_key hk; /* 0 + 40 */ |
| 93 |
struct image_dimension dime; /* 40 + 108 */ |
| 94 |
struct data_history hist; /* 148 + 200 */ |
| 95 |
}; /* total= 348 bytes */ |
| 96 |
|
| 97 |
typedef struct{ |
| 98 |
float real; |
| 99 |
float imag; |
| 100 |
} COMPLEX; |