38 int ii, yy, mm, dd, ho, mi, se;
44 si=atoi(value); ii=atoi(value); f=atof(value);
45 if(strcmp(field,
"magic_number")==0) {
47 }
else if(strcmp(field,
"original_file_name")==0) {
49 }
else if(strcmp(field,
"sw_version")==0) {
51 }
else if(strcmp(field,
"system_type")==0) {
53 }
else if(strcmp(field,
"file_type")==0) {
55 }
else if(strcmp(field,
"serial_number")==0) {
57 }
else if(strcmp(field,
"scan_start_time")==0) {
58 timet=time(NULL); st=localtime(&timet);
59 if(sscanf(value,
"%d-%d-%d %d:%d:%d", &yy, &mm, &dd, &ho, &mi, &se)!=6)
61 st->tm_mday=dd; st->tm_mon=mm-1; st->tm_year=yy-1900;
62 st->tm_hour=ho; st->tm_min=mi; st->tm_sec=se; st->tm_isdst=-1;
64 }
else if(strcmp(field,
"isotope_name")==0) {
66 }
else if(strcmp(field,
"isotope_halflife")==0) {
68 }
else if(strcmp(field,
"radiopharmaceutical")==0) {
70 }
else if(strcmp(field,
"gantry_tilt")==0) {
72 }
else if(strcmp(field,
"gantry_rotation")==0) {
74 }
else if(strcmp(field,
"bed_elevation")==0) {
76 }
else if(strcmp(field,
"intrinsic_tilt")==0) {
78 }
else if(strcmp(field,
"wobble_speed")==0) {
80 }
else if(strcmp(field,
"transm_source_type")==0) {
82 }
else if(strcmp(field,
"distance_scanned")==0) {
84 }
else if(strcmp(field,
"transaxial_fov")==0) {
86 }
else if(strcmp(field,
"angular_compression")==0) {
88 }
else if(strcmp(field,
"coin_samp_mode")==0) {
90 }
else if(strcmp(field,
"axial_samp_mode")==0) {
92 }
else if(strcmp(field,
"ecat_calibration_factor")==0) {
94 }
else if(strcmp(field,
"calibration_units")==0) {
96 }
else if(strcmp(field,
"calibration_units_label")==0) {
98 }
else if(strcmp(field,
"compression_code")==0) {
100 }
else if(strcmp(field,
"study_type")==0) {
102 }
else if(strcmp(field,
"patient_id")==0) {
104 }
else if(strcmp(field,
"patient_name")==0) {
106 }
else if(strcmp(field,
"patient_sex")==0) {
108 }
else if(strcmp(field,
"patient_dexterity")==0) {
110 }
else if(strcmp(field,
"patient_age")==0) {
112 }
else if(strcmp(field,
"patient_height")==0) {
114 }
else if(strcmp(field,
"patient_weight")==0) {
116 }
else if(strcmp(field,
"patient_birth_date")==0) {
117 timet=time(NULL); st=localtime(&timet);
118 if(sscanf(value,
"%d-%d-%d", &yy, &mm, &dd)!=3)
return(2);
119 st->tm_mday=dd; st->tm_mon=mm-1; st->tm_year=yy-1900;
120 st->tm_hour=0; st->tm_min=0; st->tm_sec=0; st->tm_isdst=-1;
122 }
else if(strcmp(field,
"physician_name")==0) {
124 }
else if(strcmp(field,
"operator_name")==0) {
126 }
else if(strcmp(field,
"study_description")==0) {
128 }
else if(strcmp(field,
"acquisition_type")==0) {
130 }
else if(strcmp(field,
"patient_orientation")==0) {
132 }
else if(strcmp(field,
"facility_name")==0) {
134 }
else if(strcmp(field,
"num_planes")==0) {
136 }
else if(strcmp(field,
"num_frames")==0) {
138 }
else if(strcmp(field,
"num_gates")==0) {
140 }
else if(strcmp(field,
"num_bed_pos")==0) {
142 }
else if(strcmp(field,
"init_bed_position")==0) {
144 }
else if(strcmp(field,
"bed_position")==0) {
145 sscanf(value,
"%f %f %f %f %f %f %f %f %f %f %f %f %f %f %f",
152 }
else if(strcmp(field,
"plane_separation")==0) {
154 }
else if(strcmp(field,
"lwr_sctr_thres")==0) {
156 }
else if(strcmp(field,
"lwr_true_thres")==0) {
158 }
else if(strcmp(field,
"upr_true_thres")==0) {
160 }
else if(strcmp(field,
"user_process_code")==0) {
162 }
else if(strcmp(field,
"acquisition_mode")==0) {
164 }
else if(strcmp(field,
"bin_size")==0) {
166 }
else if(strcmp(field,
"branching_fraction")==0) {
168 }
else if(strcmp(field,
"dose_start_time")==0) {
169 timet=time(NULL); st=localtime(&timet);
170 if(sscanf(value,
"%d-%d-%d %d:%d:%d", &yy, &mm, &dd, &ho, &mi, &se)!=6)
172 st->tm_mday=dd; st->tm_mon=mm-1; st->tm_year=yy-1900;
173 st->tm_hour=ho; st->tm_min=mi; st->tm_sec=se; st->tm_isdst=-1;
175 }
else if(strcmp(field,
"dosage")==0) {
177 }
else if(strcmp(field,
"well_counter_corr_factor")==0) {
179 }
else if(strcmp(field,
"data_units")==0) {
181 }
else if(strcmp(field,
"septa_state")==0) {
208 si=atoi(value); ii=atoi(value); f=atof(value);
210 if(strcasecmp(field,
"DATA_TYPE")==0) {
212 }
else if(strcasecmp(field,
"NUM_DIMENSIONS")==0) {
214 }
else if(strcasecmp(field,
"NUM_R_ELEMENTS")==0) {
216 }
else if(strcasecmp(field,
"NUM_ANGLES")==0) {
218 }
else if(strcasecmp(field,
"CORRECTIONS_APPLIED")==0) {
220 }
else if(strncasecmp(field,
"NUM_Z_ELEMENTS", 14)==0) {
221 cptr=strtok(value,
" \t,;\n\r");
222 for(i=0; i<64; i++) {
223 if(cptr==NULL)
break;
225 cptr=strtok(NULL,
" \t,;\n\r");
227 }
else if(strcasecmp(field,
"RING_DIFFERENCE")==0) {
229 }
else if(strcasecmp(field,
"STORAGE_ORDER")==0) {
231 }
else if(strcasecmp(field,
"AXIAL_COMPRESSION")==0) {
233 }
else if(strcasecmp(field,
"X_RESOLUTION")==0) {
235 }
else if(strcasecmp(field,
"V_RESOLUTION")==0) {
237 }
else if(strcasecmp(field,
"Z_RESOLUTION")==0) {
239 }
else if(strcasecmp(field,
"W_RESOLUTION")==0) {
241 }
else if(strncasecmp(field,
"FILL_GATE", 9)==0) {
242 cptr=strtok(value,
" \t,;\n\r");
244 if(cptr==NULL)
break;
246 cptr=strtok(NULL,
" \t,;\n\r");
248 }
else if(strcasecmp(field,
"GATE_DURATION")==0) {
250 }
else if(strcasecmp(field,
"R_WAVE_OFFSET")==0) {
252 }
else if(strcasecmp(field,
"NUM_ACCEPTED_BEATS")==0) {
254 }
else if(strcasecmp(field,
"SCALE_FACTOR")==0) {
256 }
else if(strcasecmp(field,
"SCAN_MIN")==0) {
258 }
else if(strcasecmp(field,
"SCAN_MAX")==0) {
260 }
else if(strcasecmp(field,
"PROMPTS")==0) {
262 }
else if(strcasecmp(field,
"DELAYED")==0) {
264 }
else if(strcasecmp(field,
"MULTIPLES")==0) {
266 }
else if(strcasecmp(field,
"NET_TRUES")==0) {
268 }
else if(strcasecmp(field,
"TOT_AVG_COR")==0) {
270 }
else if(strcasecmp(field,
"TOT_AVG_UNCOR")==0) {
272 }
else if(strcasecmp(field,
"TOTAL_COIN_RATE")==0) {
274 }
else if(strcasecmp(field,
"FRAME_START_TIME")==0) {
276 }
else if(strcasecmp(field,
"FRAME_DURATION")==0) {
278 }
else if(strcasecmp(field,
"DEADTIME_CORRECTION_FACTOR")==0) {
280 }
else if(strncasecmp(field,
"FILL_CTI", 8)==0) {
281 cptr=strtok(value,
" \t,;\n\r");
282 for(i=0; i<90; i++) {
283 if(cptr==NULL)
break;
284 h->
fill_cti[i]=(
short int)atoi(cptr);
285 cptr=strtok(NULL,
" \t,;\n\r");
287 }
else if(strncasecmp(field,
"FILL_USER", 9)==0) {
288 cptr=strtok(value,
" \t,;\n\r");
289 for(i=0; i<50; i++) {
290 if(cptr==NULL)
break;
292 cptr=strtok(NULL,
" \t,;\n\r");
294 }
else if(strncasecmp(field,
"UNCOR_SINGLES", 13)==0) {
295 cptr=strtok(value,
" \t,;\n\r");
296 for(i=0; i<128; i++) {
297 if(cptr==NULL)
break;
299 cptr=strtok(NULL,
" \t,;\n\r");
324 si=atoi(value); ii=atoi(value); f=atof(value);
326 if(strcasecmp(field,
"DATA_TYPE")==0) {
328 }
else if(strcasecmp(field,
"NUM_DIMENSIONS")==0) {
330 }
else if(strcasecmp(field,
"X_DIMENSION")==0) {
332 }
else if(strcasecmp(field,
"Y_DIMENSION")==0) {
334 }
else if(strcasecmp(field,
"Z_DIMENSION")==0) {
336 }
else if(strcasecmp(field,
"X_OFFSET")==0) {
338 }
else if(strcasecmp(field,
"Y_OFFSET")==0) {
340 }
else if(strcasecmp(field,
"Z_OFFSET")==0) {
342 }
else if(strcasecmp(field,
"RECON_ZOOM")==0) {
344 }
else if(strcasecmp(field,
"SCALE_FACTOR")==0) {
346 }
else if(strcasecmp(field,
"IMAGE_MIN")==0) {
348 }
else if(strcasecmp(field,
"IMAGE_MAX")==0) {
350 }
else if(strcasecmp(field,
"X_PIXEL_SIZE")==0) {
352 }
else if(strcasecmp(field,
"Y_PIXEL_SIZE")==0) {
354 }
else if(strcasecmp(field,
"Z_PIXEL_SIZE")==0) {
356 }
else if(strcasecmp(field,
"FRAME_DURATION")==0) {
358 }
else if(strcasecmp(field,
"FRAME_START_TIME")==0) {
360 }
else if(strcasecmp(field,
"FILTER_CODE")==0) {
362 }
else if(strcasecmp(field,
"X_RESOLUTION")==0) {
364 }
else if(strcasecmp(field,
"Y_RESOLUTION")==0) {
366 }
else if(strcasecmp(field,
"Z_RESOLUTION")==0) {
368 }
else if(strcasecmp(field,
"NUM_R_ELEMENTS")==0) {
370 }
else if(strcasecmp(field,
"NUM_ANGLES")==0) {
372 }
else if(strcasecmp(field,
"Z_ROTATION_ANGLES")==0) {
374 }
else if(strcasecmp(field,
"DECAY_CORR_FCTR")==0) {
376 }
else if(strcasecmp(field,
"PROCESSING_CODE")==0) {
378 }
else if(strcasecmp(field,
"GATE_DURATIONR")==0) {
380 }
else if(strcasecmp(field,
"R_WAVE_OFFSET")==0) {
382 }
else if(strcasecmp(field,
"NUM_ACCEPTED_BEATS")==0) {
384 }
else if(strcasecmp(field,
"FILTER_CUTOFF_FREQUENCY")==0) {
386 }
else if(strcasecmp(field,
"FILTER_RESOLUTION")==0) {
388 }
else if(strcasecmp(field,
"FILTER_RAMP_SLOPE")==0) {
390 }
else if(strcasecmp(field,
"FILTER_ORDER")==0) {
392 }
else if(strcasecmp(field,
"FILTER_SCATTER_FRACTION")==0) {
394 }
else if(strcasecmp(field,
"FILTER_SCATTER_SLOPE")==0) {
396 }
else if(strcasecmp(field,
"ANNOTATION")==0) {
398 }
else if(strcasecmp(field,
"MT_1_1")==0) {
400 }
else if(strcasecmp(field,
"MT_1_2")==0) {
402 }
else if(strcasecmp(field,
"MT_1_3")==0) {
404 }
else if(strcasecmp(field,
"MT_2_1")==0) {
406 }
else if(strcasecmp(field,
"MT_2_2")==0) {
408 }
else if(strcasecmp(field,
"MT_2_3")==0) {
410 }
else if(strcasecmp(field,
"MT_3_1")==0) {
412 }
else if(strcasecmp(field,
"MT_3_2")==0) {
414 }
else if(strcasecmp(field,
"MT_3_3")==0) {
416 }
else if(strcasecmp(field,
"RFILTER_CUTOFF")==0) {
418 }
else if(strcasecmp(field,
"RFILTER_RESOLUTION")==0) {
420 }
else if(strcasecmp(field,
"RFILTER_CODE")==0) {
422 }
else if(strcasecmp(field,
"RFILTER_ORDER")==0) {
424 }
else if(strcasecmp(field,
"ZFILTER_CUTOFF")==0) {
426 }
else if(strcasecmp(field,
"ZFILTER_RESOLUTION")==0) {
428 }
else if(strcasecmp(field,
"ZFILTER_CODE")==0) {
430 }
else if(strcasecmp(field,
"ZFILTER_ORDER")==0) {
432 }
else if(strcasecmp(field,
"MT_1_4")==0) {
434 }
else if(strcasecmp(field,
"MT_2_4")==0) {
436 }
else if(strcasecmp(field,
"MT_3_4")==0) {
438 }
else if(strcasecmp(field,
"SCATTER_TYPE")==0) {
440 }
else if(strcasecmp(field,
"RECON_TYPE")==0) {
442 }
else if(strcasecmp(field,
"RECON_VIEWS")==0) {
short int calibration_units_label
float well_counter_corr_factor
int ecat7EditVHeader(ECAT7_imageheader *h, char *field, char *value)
short int compression_code
int ecat7EditSHeader(ECAT7_scanheader *h, char *field, char *value)
float ecat_calibration_factor
short int patient_orientation
char original_file_name[32]
short int angular_compression
short int calibration_units
short int acquisition_mode
char user_process_code[10]
short int transm_source_type
short int acquisition_type
char study_description[32]
short int axial_samp_mode
int ecat7EditMHeader(ECAT7_mainheader *h, char *field, char *value)
char radiopharmaceutical[32]