| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
#include <minc.h> |
| 38 |
|
| 39 |
|
| 40 |
#define SECONDS_PER_MINUTE 60 |
| 41 |
#define MINUTES_PER_HOUR 60 |
| 42 |
#define SECONDS_PER_HOUR (MINUTES_PER_HOUR*SECONDS_PER_MINUTE) |
| 43 |
#define HOURS_PER_DAY 24 |
| 44 |
#define SECONDS_PER_DAY (HOURS_PER_DAY*SECONDS_PER_HOUR) |
| 45 |
#define MS_PER_SECOND 1000 |
| 46 |
#define COORDINATE_EPSILON (100.0*FLT_EPSILON) |
| 47 |
|
| 48 |
|
| 49 |
#define NCOPTS_DEFAULT NC_VERBOSE |
| 50 |
|
| 51 |
|
| 52 |
#define DICOM_ROOT_VAR "dicom_groups" |
| 53 |
|
| 54 |
|
| 55 |
typedef enum { SLICE = 0, ECHO, TIME, PHASE, CHEM_SHIFT, MRI_NDIMS } Mri_Index; |
| 56 |
|
| 57 |
|
| 58 |
typedef enum { XCOORD = 0, YCOORD, ZCOORD, WORLD_NDIMS } World_Index; |
| 59 |
|
| 60 |
|
| 61 |
typedef enum { VSLICE = 0, VROW, VCOLUMN, VOL_NDIMS } Volume_Index; |
| 62 |
|
| 63 |
|
| 64 |
typedef enum {TRANSVERSE = 0, SAGITTAL, CORONAL, NUM_ORIENTATIONS} Orientation; |
| 65 |
|
| 66 |
|
| 67 |
typedef char Cstring[256]; |
| 68 |
|
| 69 |
|
| 70 |
typedef struct { |
| 71 |
int initialized; |
| 72 |
int study_id; |
| 73 |
int acq_id; |
| 74 |
int rec_num; |
| 75 |
int image_type; |
| 76 |
Cstring image_type_string; |
| 77 |
int nrows; |
| 78 |
int ncolumns; |
| 79 |
int default_index[MRI_NDIMS]; |
| 80 |
int size[MRI_NDIMS]; |
| 81 |
int total_size[MRI_NDIMS]; |
| 82 |
int *indices[MRI_NDIMS]; |
| 83 |
|
| 84 |
int search_start[MRI_NDIMS]; |
| 85 |
double *coordinates[MRI_NDIMS]; |
| 86 |
|
| 87 |
int image_index[MRI_NDIMS]; |
| 88 |
World_Index slice_world; |
| 89 |
World_Index row_world; |
| 90 |
World_Index column_world; |
| 91 |
double step[WORLD_NDIMS]; |
| 92 |
double start[WORLD_NDIMS]; |
| 93 |
double dircos[WORLD_NDIMS][WORLD_NDIMS]; |
| 94 |
nc_type datatype; |
| 95 |
int is_signed; |
| 96 |
double pixel_min; |
| 97 |
double pixel_max; |
| 98 |
Cstring units; |
| 99 |
double window_min; |
| 100 |
double window_max; |
| 101 |
struct { |
| 102 |
Cstring name; |
| 103 |
Cstring identification; |
| 104 |
Cstring birth_date; |
| 105 |
Cstring sex; |
| 106 |
double weight; |
| 107 |
} patient; |
| 108 |
struct { |
| 109 |
Cstring start_time; |
| 110 |
Cstring modality; |
| 111 |
Cstring manufacturer; |
| 112 |
Cstring model; |
| 113 |
Cstring institution; |
| 114 |
Cstring station_id; |
| 115 |
Cstring ref_physician; |
| 116 |
Cstring procedure; |
| 117 |
Cstring study_id; |
| 118 |
Cstring acquisition_id; |
| 119 |
} study; |
| 120 |
struct { |
| 121 |
Cstring scan_seq; |
| 122 |
double rep_time; |
| 123 |
double echo_time; |
| 124 |
double inv_time; |
| 125 |
double flip_angle; |
| 126 |
double num_avg; |
| 127 |
double imaging_freq; |
| 128 |
Cstring imaged_nucl; |
| 129 |
Cstring comments; |
| 130 |
} acq; |
| 131 |
Acr_Group group_list; |
| 132 |
} General_Info; |
| 133 |
|
| 134 |
|
| 135 |
typedef struct { |
| 136 |
int valid; |
| 137 |
int bits_alloc; |
| 138 |
int bits_stored; |
| 139 |
int index[MRI_NDIMS]; |
| 140 |
double pixel_max; |
| 141 |
double pixel_min; |
| 142 |
double slice_max; |
| 143 |
double slice_min; |
| 144 |
double window_max; |
| 145 |
double window_min; |
| 146 |
double coordinate[MRI_NDIMS]; |
| 147 |
} File_Info; |
| 148 |
|
| 149 |
|
| 150 |
typedef struct { |
| 151 |
int free; |
| 152 |
int nrows; |
| 153 |
int ncolumns; |
| 154 |
unsigned short *data; |
| 155 |
} Image_Data; |
| 156 |
|
| 157 |
|
| 158 |
typedef struct { |
| 159 |
int identifier; |
| 160 |
int original_index; |
| 161 |
double value; |
| 162 |
} Sort_Element; |