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) {
char study_description[32]
float well_counter_corr_factor
short int compression_code
short int patient_orientation
char original_file_name[32]
short int angular_compression
short int calibration_units
short int transm_source_type
short int acquisition_type
char user_process_code[10]
short int axial_samp_mode
short int calibration_units_label
short int acquisition_mode
char radiopharmaceutical[32]
float ecat_calibration_factor