My Project
ecat7p.c
Go to the documentation of this file.
1 /******************************************************************************
2 
3  ecat7p.c (c) 2003-2007 by Turku PET Centre
4 
5  Procedures for printing ECAT 7.x (header) contents.
6 
7 
8  Version:
9  2003-07-17 Vesa Oikonen
10  2004-05-23 VO
11  Added ecat7datatype(short int data_type), and used too.
12  Added some units etc.
13  2004-08-15 VO
14  Main header sex and dexterity are checked printed as space instead of
15  (char)0.
16  2004-09-20 VO
17  Doxygen style comments are corrected.
18  2007-03-21 VO
19  strftime() call changed so that even Mingw can understand it.
20  2007-17-07 Harri Merisaari
21  fixed for ANSI
22  2007-09-10 VO
23  Return value of localtime() is checked.
24  2008-07-24 VO
25  Added ecat7PrintSubheader().
26 
27 ******************************************************************************/
28 #include <locale.h>
29 #include <stdio.h>
30 #include <stdlib.h>
31 #include <math.h>
32 #include <ctype.h>
33 #include <string.h>
34 #include <unistd.h>
35 #include <time.h>
36 /*****************************************************************************/
37 #include <swap.h>
38 #include <datetime.h>
39 #include "include/ecat7.h"
40 /*****************************************************************************/
41 
42 /*****************************************************************************/
50  int i;
51  char tmp[64];
52  struct tm *st;
53  time_t lt;
54 
55  if(ECAT7_TEST) fprintf(stdout, "ecat7PrintMainheader()\n");
56  fprintf(fp, "magic_number := %.14s\n", h->magic_number);
57  fprintf(fp, "original_file_name := %.32s\n", h->original_file_name);
58  fprintf(fp, "sw_version := %d\n", h->sw_version);
59  fprintf(fp, "system_type := %d\n", h->system_type);
60  fprintf(fp, "file_type := %d (%s)\n", h->file_type, ecat7filetype(h->file_type) );
61  fprintf(fp, "serial_number := %.10s\n", h->serial_number);
62  lt=(time_t)h->scan_start_time; st=localtime(&lt);
63  if(st!=NULL) strftime(tmp, 32, "%Y-%m-%d %H:%M:%S", st); /* %T did not work with Mingw */
64  else strcpy(tmp, "1900-01-01 00:00:00");
65  fprintf(fp, "scan_start_time := %s\n", tmp);
66  fprintf(fp, "isotope_name := %.8s\n", h->isotope_name);
67  fprintf(fp, "isotope_halflife := %E sec\n", h->isotope_halflife);
68  fprintf(fp, "radiopharmaceutical := %.32s\n", h->radiopharmaceutical);
69  fprintf(fp, "gantry_tilt := %g\n", h->gantry_tilt);
70  fprintf(fp, "gantry_rotation := %g\n", h->gantry_rotation);
71  fprintf(fp, "bed_elevation := %g\n", h->bed_elevation);
72  fprintf(fp, "intrinsic_tilt := %g\n", h->intrinsic_tilt);
73  fprintf(fp, "wobble_speed := %d\n", h->wobble_speed);
74  fprintf(fp, "transm_source_type := %d\n", h->transm_source_type);
75  fprintf(fp, "distance_scanned := %g\n", h->distance_scanned);
76  fprintf(fp, "transaxial_fov := %g\n", h->transaxial_fov);
77  fprintf(fp, "angular_compression := %d\n", h->angular_compression);
78  fprintf(fp, "coin_samp_mode := %d\n", h->coin_samp_mode);
79  fprintf(fp, "axial_samp_mode := %d\n", h->axial_samp_mode);
80  fprintf(fp, "ecat_calibration_factor := %E\n", h->ecat_calibration_factor);
81  fprintf(fp, "calibration_units := %d\n", h->calibration_units);
82  fprintf(fp, "calibration_units_label := %d\n", h->calibration_units_label);
83  fprintf(fp, "compression_code := %d\n", h->compression_code);
84  fprintf(fp, "study_type := %.12s\n", h->study_type);
85  fprintf(fp, "patient_id := %.16s\n", h->patient_id);
86  fprintf(fp, "patient_name := %.32s\n", h->patient_name);
87  fprintf(fp, "patient_sex := %c\n", (h->patient_sex!=0)?h->patient_sex:(char)32);
88  fprintf(fp, "patient_dexterity := %c\n", (h->patient_dexterity!=0)?h->patient_dexterity:(char)32 );
89  fprintf(fp, "patient_age := %g\n", h->patient_age);
90  fprintf(fp, "patient_height := %g\n", h->patient_height);
91  fprintf(fp, "patient_weight := %g\n", h->patient_weight);
92  fprintf(fp, "patient_birth_date := %d\n", h->patient_birth_date);
93  fprintf(fp, "physician_name := %.32s\n", h->physician_name);
94  fprintf(fp, "operator_name := %.32s\n", h->operator_name);
95  fprintf(fp, "study_description := %.32s\n", h->study_description);
96  fprintf(fp, "acquisition_type := %d (%s)\n", h->acquisition_type,
98  fprintf(fp, "patient_orientation := %d\n", h->patient_orientation);
99  fprintf(fp, "facility_name := %.20s\n", h->facility_name);
100  fprintf(fp, "num_planes := %d\n", h->num_planes);
101  fprintf(fp, "num_frames := %d\n", h->num_frames);
102  fprintf(fp, "num_gates := %d\n", h->num_gates);
103  fprintf(fp, "num_bed_pos := %d\n", h->num_bed_pos);
104  fprintf(fp, "init_bed_position := %g\n", h->init_bed_position);
105  fprintf(fp, "bed_position :=");
106  for(i=0; i<15; i++) fprintf(fp, " %g", h->bed_position[i]);
107  fprintf(fp, "\n");
108  fprintf(fp, "plane_separation := %g cm\n", h->plane_separation);
109  fprintf(fp, "lwr_sctr_thres := %d\n", h->lwr_sctr_thres);
110  fprintf(fp, "lwr_true_thres := %d\n", h->lwr_true_thres);
111  fprintf(fp, "upr_true_thres := %d\n", h->upr_true_thres);
112  fprintf(fp, "user_process_code := %.10s\n", h->user_process_code);
113  fprintf(fp, "acquisition_mode := %d\n", h->acquisition_mode);
114  fprintf(fp, "bin_size := %g cm\n", h->bin_size);
115  fprintf(fp, "branching_fraction := %g\n", h->branching_fraction);
116  lt=(time_t)h->dose_start_time; st=localtime(&lt);
117  if(st!=NULL) strftime(tmp, 32, "%Y-%m-%d %H:%M:%S", st); /* %T did not work with Mingw */
118  else strcpy(tmp, "1900-01-01 00:00:00");
119  fprintf(fp, "dose_start_time := %s\n", tmp);
120  fprintf(fp, "dosage := %g\n", h->dosage);
121  fprintf(fp, "well_counter_corr_factor := %E\n", h->well_counter_corr_factor);
122  fprintf(fp, "data_units := %.32s\n", h->data_units);
123  fprintf(fp, "septa_state := %d\n", h->septa_state);
124  fprintf(fp, "fill_cti :=");
125  for(i=0; i<6; i++) fprintf(fp, " %d", h->fill_cti[i]);
126  fprintf(fp, "\n");
127 }
128 /*****************************************************************************/
129 
130 /*****************************************************************************/
138  int i;
139 
140  if(ECAT7_TEST) fprintf(stdout, "ecat7PrintImageheader()\n");
141  fprintf(fp, "data_type := %d (%s)\n", h->data_type,
142  ecat7datatype(h->data_type) );
143  fprintf(fp, "num_dimensions := %d\n", h->num_dimensions);
144  fprintf(fp, "x_dimension := %d\n", h->x_dimension);
145  fprintf(fp, "y_dimension := %d\n", h->y_dimension);
146  fprintf(fp, "z_dimension := %d\n", h->z_dimension);
147  fprintf(fp, "x_offset := %g\n", h->x_offset);
148  fprintf(fp, "y_offset := %g\n", h->y_offset);
149  fprintf(fp, "z_offset := %g\n", h->z_offset);
150  fprintf(fp, "recon_zoom := %g\n", h->recon_zoom);
151  fprintf(fp, "scale_factor := %E\n", h->scale_factor);
152  fprintf(fp, "image_min := %d\n", h->image_min);
153  fprintf(fp, "image_max := %d\n", h->image_max);
154  fprintf(fp, "x_pixel_size := %g\n", h->x_pixel_size);
155  fprintf(fp, "y_pixel_size := %g\n", h->y_pixel_size);
156  fprintf(fp, "z_pixel_size := %g\n", h->z_pixel_size);
157  fprintf(fp, "frame_duration := %d\n", h->frame_duration);
158  fprintf(fp, "frame_start_time := %d\n", h->frame_start_time);
159  fprintf(fp, "filter_code := %d\n", h->filter_code);
160  fprintf(fp, "x_resolution := %g\n", h->x_resolution);
161  fprintf(fp, "y_resolution := %g\n", h->y_resolution);
162  fprintf(fp, "z_resolution := %g\n", h->z_resolution);
163  fprintf(fp, "num_r_elements := %g\n", h->num_r_elements);
164  fprintf(fp, "num_angles := %g\n", h->num_angles);
165  fprintf(fp, "z_rotation_angle := %g\n", h->z_rotation_angle);
166  fprintf(fp, "decay_corr_fctr := %g\n", h->decay_corr_fctr);
167  fprintf(fp, "processing_code := %d\n", h->processing_code);
168  fprintf(fp, "gate_duration := %d\n", h->gate_duration);
169  fprintf(fp, "r_wave_offset := %d\n", h->r_wave_offset);
170  fprintf(fp, "num_accepted_beats := %d\n", h->num_accepted_beats);
171  fprintf(fp, "filter_cutoff_frequency := %E\n", h->filter_cutoff_frequency);
172  fprintf(fp, "filter_resolution := %E\n", h->filter_resolution);
173  fprintf(fp, "filter_ramp_slope := %E\n", h->filter_ramp_slope);
174  fprintf(fp, "filter_order := %d\n", h->filter_order);
175  fprintf(fp, "filter_scatter_fraction := %E\n", h->filter_scatter_fraction);
176  fprintf(fp, "filter_scatter_slope := %E\n", h->filter_scatter_slope);
177  fprintf(fp, "annotation := %.40s\n", h->annotation);
178  fprintf(fp, "mt_1_1 := %g\n", h->mt_1_1);
179  fprintf(fp, "mt_1_2 := %g\n", h->mt_1_2);
180  fprintf(fp, "mt_1_3 := %g\n", h->mt_1_3);
181  fprintf(fp, "mt_2_1 := %g\n", h->mt_2_1);
182  fprintf(fp, "mt_2_2 := %g\n", h->mt_2_2);
183  fprintf(fp, "mt_2_3 := %g\n", h->mt_2_3);
184  fprintf(fp, "mt_3_1 := %g\n", h->mt_3_1);
185  fprintf(fp, "mt_3_2 := %g\n", h->mt_3_2);
186  fprintf(fp, "mt_3_3 := %g\n", h->mt_3_3);
187  fprintf(fp, "rfilter_cutoff := %g\n", h->rfilter_cutoff);
188  fprintf(fp, "rfilter_resolution := %g\n", h->rfilter_resolution);
189  fprintf(fp, "rfilter_code := %d\n", h->rfilter_code);
190  fprintf(fp, "rfilter_order := %d\n", h->rfilter_order);
191  fprintf(fp, "zfilter_cutoff := %g\n", h->zfilter_cutoff);
192  fprintf(fp, "zfilter_resolution := %g\n", h->zfilter_resolution);
193  fprintf(fp, "zfilter_code := %d\n", h->zfilter_code);
194  fprintf(fp, "zfilter_order := %d\n", h->zfilter_order);
195  fprintf(fp, "mt_1_4 := %g\n", h->mt_1_4);
196  fprintf(fp, "mt_2_4 := %g\n", h->mt_2_4);
197  fprintf(fp, "mt_3_4 := %g\n", h->mt_3_4);
198  fprintf(fp, "scatter_type := %d\n", h->scatter_type);
199  fprintf(fp, "recon_type := %d\n", h->recon_type);
200  fprintf(fp, "recon_views := %d\n", h->recon_views);
201  fprintf(fp, "fill_cti :=");
202  for(i=0; i<87; i++) fprintf(fp, " %d", h->fill_cti[i]); fprintf(fp, "\n");
203  fprintf(fp, "fill_user :=");
204  for(i=0; i<49; i++) fprintf(fp, " %d", h->fill_user[i]); fprintf(fp, "\n");
205 }
206 /*****************************************************************************/
207 
208 /*****************************************************************************/
216  int i;
217 
218  if(ECAT7_TEST) fprintf(stdout, "ecat7PrintScanheader()\n");
219  fprintf(fp, "data_type := %d (%s)\n", h->data_type,
220  ecat7datatype(h->data_type) );
221  fprintf(fp, "num_dimensions := %d\n", h->num_dimensions);
222  fprintf(fp, "num_r_elements := %d\n", h->num_r_elements);
223  fprintf(fp, "num_angles := %d\n", h->num_angles);
224  fprintf(fp, "corrections_applied := %d\n", h->corrections_applied);
225  fprintf(fp, "num_z_elements :=");
226  for(i=0; i<64; i++) fprintf(fp, " %d", h->num_z_elements[i]);
227  fprintf(fp, "\n");
228  fprintf(fp, "ring_difference := %d\n", h->ring_difference);
229  fprintf(fp, "storage_order := %d\n", h->storage_order);
230  fprintf(fp, "axial_compression := %d (span)\n", h->axial_compression);
231  fprintf(fp, "x_resolution := %g cm\n", h->x_resolution);
232  fprintf(fp, "v_resolution := %g rad\n", h->v_resolution);
233  fprintf(fp, "z_resolution := %g cm\n", h->z_resolution);
234  fprintf(fp, "w_resolution := %g\n", h->w_resolution);
235  fprintf(fp, "gate_duration := %d\n", h->gate_duration);
236  fprintf(fp, "r_wave_offset := %d\n", h->r_wave_offset);
237  fprintf(fp, "num_accepted_beats := %d\n", h->num_accepted_beats);
238  fprintf(fp, "scale_factor := %E\n", h->scale_factor);
239  fprintf(fp, "scan_min := %d\n", h->scan_min);
240  fprintf(fp, "scan_max := %d\n", h->scan_max);
241  fprintf(fp, "prompts := %d\n", h->prompts);
242  fprintf(fp, "delayed := %d\n", h->delayed);
243  fprintf(fp, "multiples := %d\n", h->multiples);
244  fprintf(fp, "net_trues := %d\n", h->net_trues);
245  fprintf(fp, "tot_avg_cor := %g\n", h->tot_avg_cor);
246  fprintf(fp, "tot_avg_uncor := %g\n", h->tot_avg_uncor);
247  fprintf(fp, "total_coin_rate := %d\n", h->total_coin_rate);
248  fprintf(fp, "frame_start_time := %d\n", h->frame_start_time);
249  fprintf(fp, "frame_duration := %d\n", h->frame_duration);
250  fprintf(fp, "deadtime_correction_factor := %g\n", h->deadtime_correction_factor);
251  fprintf(fp, "uncor_singles :=");
252  for(i=0; i<128; i++) fprintf(fp, " %g", h->uncor_singles[i]);
253  fprintf(fp, "\n");
254 }
255 /*****************************************************************************/
256 
257 /*****************************************************************************/
265  int i;
266 
267  if(ECAT7_TEST) fprintf(stdout, "ecat7PrintAttenheader()\n");
268  fprintf(fp, "data_type := %d (%s)\n", h->data_type,
269  ecat7datatype(h->data_type) );
270  fprintf(fp, "num_dimensions := %d\n", h->num_dimensions);
271  fprintf(fp, "attenuation_type := %d\n", h->attenuation_type);
272  fprintf(fp, "num_r_elements := %d\n", h->num_r_elements);
273  fprintf(fp, "num_angles := %d\n", h->num_angles);
274  fprintf(fp, "num_z_elements := %d\n", h->num_z_elements);
275  fprintf(fp, "ring_difference := %d\n", h->ring_difference);
276  fprintf(fp, "x_resolution := %g\n", h->x_resolution);
277  fprintf(fp, "y_resolution := %g\n", h->y_resolution);
278  fprintf(fp, "z_resolution := %g\n", h->z_resolution);
279  fprintf(fp, "w_resolution := %g\n", h->w_resolution);
280  fprintf(fp, "scale_factor := %E\n", h->scale_factor);
281  fprintf(fp, "x_offset := %g\n", h->x_offset);
282  fprintf(fp, "y_offset := %g\n", h->y_offset);
283  fprintf(fp, "x_radius := %g\n", h->x_radius);
284  fprintf(fp, "y_radius := %g\n", h->y_radius);
285  fprintf(fp, "tilt_angle := %g\n", h->tilt_angle);
286  fprintf(fp, "attenuation_coeff := %E\n", h->attenuation_coeff);
287  fprintf(fp, "attenuation_min := %E\n", h->attenuation_min);
288  fprintf(fp, "attenuation_max := %E\n", h->attenuation_max);
289  fprintf(fp, "skull_thickness := %g\n", h->skull_thickness);
290  fprintf(fp, "num_additional_atten_coeff := %d\n", h->num_additional_atten_coeff);
291  fprintf(fp, "additional_atten_coeff :=");
292  for(i=0; i<8; i++) fprintf(fp, " %E", h->additional_atten_coeff[i]);
293  fprintf(fp, "\n");
294  fprintf(fp, "edge_finding_threshold := %g\n", h->edge_finding_threshold);
295  fprintf(fp, "storage_order := %d\n", h->storage_order);
296  fprintf(fp, "span := %d\n", h->span);
297  fprintf(fp, "z_elements :=");
298  for(i=0; i<64; i++) fprintf(fp, " %d", h->z_elements[i]);
299  fprintf(fp, "\n");
300 }
301 /*****************************************************************************/
302 
303 /*****************************************************************************/
311  int i;
312 
313  if(ECAT7_TEST) fprintf(stdout, "ecat7PrintPolmapheader()\n");
314  fprintf(fp, "data_type := %d (%s)\n", h->data_type,
315  ecat7datatype(h->data_type) );
316  fprintf(fp, "polar_map_type := %d\n", h->polar_map_type);
317  fprintf(fp, "num_rings := %d\n", h->num_rings);
318  fprintf(fp, "sectors_per_ring :=");
319  for(i=0; i<32; i++) fprintf(fp, " %d", h->sectors_per_ring[i]);
320  fprintf(fp, "\n");
321  fprintf(fp, "ring_position :=");
322  for(i=0; i<32; i++) fprintf(fp, " %g", h->ring_position[i]);
323  fprintf(fp, "\n");
324  fprintf(fp, "ring_angle :=");
325  for(i=0; i<32; i++) fprintf(fp, " %d", h->ring_angle[i]);
326  fprintf(fp, "\n");
327  fprintf(fp, "start_angle := %d\n", h->start_angle);
328  fprintf(fp, "long_axis_left :=");
329  for(i=0; i<3; i++) fprintf(fp, " %d", h->long_axis_left[i]);
330  fprintf(fp, "\n");
331  fprintf(fp, "long_axis_right :=");
332  for(i=0; i<3; i++) fprintf(fp, " %d", h->long_axis_right[i]);
333  fprintf(fp, "\n");
334  fprintf(fp, "position_data := %d\n", h->position_data);
335  fprintf(fp, "image_min := %d\n", h->image_min);
336  fprintf(fp, "image_max := %d\n", h->image_max);
337  fprintf(fp, "scale_factor := %E\n", h->scale_factor);
338  fprintf(fp, "pixel_size := %g\n", h->pixel_size);
339  fprintf(fp, "frame_duration := %d\n", h->frame_duration);
340  fprintf(fp, "frame_start_time := %d\n", h->frame_start_time);
341  fprintf(fp, "processing_code := %d\n", h->processing_code);
342  fprintf(fp, "quant_units := %d\n", h->quant_units);
343  fprintf(fp, "annotation := %.40s\n", h->annotation);
344  fprintf(fp, "gate_duration := %d\n", h->gate_duration);
345  fprintf(fp, "r_wave_offset := %d\n", h->r_wave_offset);
346  fprintf(fp, "num_accepted_beats := %d\n", h->num_accepted_beats);
347  fprintf(fp, "polar_map_protocol := %.20s\n", h->polar_map_protocol);
348  fprintf(fp, "database_name := %.30s\n", h->database_name);
349 }
350 /*****************************************************************************/
351 
352 /*****************************************************************************/
360  int i;
361 
362  if(ECAT7_TEST) fprintf(stdout, "ecat7PrintNormheader()\n");
363  fprintf(fp, "data_type := %d (%s)\n", h->data_type,
364  ecat7datatype(h->data_type) );
365  fprintf(fp, "num_r_elements := %d\n", h->num_r_elements);
366  fprintf(fp, "num_transaxial_crystals := %d\n", h->num_transaxial_crystals);
367  fprintf(fp, "num_crystal_rings := %d\n", h->num_crystal_rings);
368  fprintf(fp, "crystals_per_ring := %d\n", h->crystals_per_ring);
369  fprintf(fp, "num_geo_corr_planes := %d\n", h->num_geo_corr_planes);
370  fprintf(fp, "uld := %d\n", h->uld);
371  fprintf(fp, "lld := %d\n", h->lld);
372  fprintf(fp, "scatter_energy := %d\n", h->scatter_energy);
373  fprintf(fp, "norm_quality_factor := %g\n", h->norm_quality_factor);
374  fprintf(fp, "norm_quality_factor_code := %d\n", h->norm_quality_factor_code);
375  fprintf(fp, "ring_dtcor1 :=");
376  for(i=0; i<32; i++) fprintf(fp, " %E", h->ring_dtcor1[i]);
377  fprintf(fp, "\n");
378  fprintf(fp, "ring_dtcor2 :=");
379  for(i=0; i<32; i++) fprintf(fp, " %E", h->ring_dtcor2[i]);
380  fprintf(fp, "\n");
381  fprintf(fp, "crystal_dtcor :=");
382  for(i=0; i<8; i++) fprintf(fp, " %E", h->crystal_dtcor[i]);
383  fprintf(fp, "\n");
384  fprintf(fp, "span := %d\n", h->span);
385  fprintf(fp, "max_ring_diff := %d\n", h->max_ring_diff);
386 }
387 /*****************************************************************************/
388 
389 /*****************************************************************************/
397  int i;
398 
399  if(ECAT7_TEST) fprintf(stdout, "ecat7Print2DScanheader()\n");
400  fprintf(fp, "data_type := %d (%s)\n", h->data_type,
401  ecat7datatype(h->data_type) );
402  fprintf(fp, "num_dimensions := %d\n", h->num_dimensions);
403  fprintf(fp, "num_r_elements := %d\n", h->num_r_elements);
404  fprintf(fp, "num_angles := %d\n", h->num_angles);
405  fprintf(fp, "corrections_applied := %d\n", h->corrections_applied);
406  fprintf(fp, "num_z_elements := %d\n", h->num_z_elements);
407  fprintf(fp, "ring_difference := %d\n", h->ring_difference);
408  fprintf(fp, "x_resolution := %g\n", h->x_resolution);
409  fprintf(fp, "y_resolution := %g\n", h->y_resolution);
410  fprintf(fp, "z_resolution := %g\n", h->z_resolution);
411  fprintf(fp, "w_resolution := %g\n", h->w_resolution);
412  fprintf(fp, "gate_duration := %d\n", h->gate_duration);
413  fprintf(fp, "r_wave_offset := %d\n", h->r_wave_offset);
414  fprintf(fp, "num_accepted_beats := %d\n", h->num_accepted_beats);
415  fprintf(fp, "scale_factor := %E\n", h->scale_factor);
416  fprintf(fp, "scan_min := %d\n", h->scan_min);
417  fprintf(fp, "scan_max := %d\n", h->scan_max);
418  fprintf(fp, "prompts := %d\n", h->prompts);
419  fprintf(fp, "delayed := %d\n", h->delayed);
420  fprintf(fp, "multiples := %d\n", h->multiples);
421  fprintf(fp, "net_trues := %d\n", h->net_trues);
422  fprintf(fp, "cor_singles :=");
423  for(i=0; i<16; i++) fprintf(fp, " %g", h->cor_singles[i]);
424  fprintf(fp, "\n");
425  fprintf(fp, "uncor_singles :=");
426  for(i=0; i<16; i++) fprintf(fp, " %g", h->uncor_singles[i]);
427  fprintf(fp, "\n");
428  fprintf(fp, "tot_avg_cor := %g\n", h->tot_avg_cor);
429  fprintf(fp, "tot_avg_uncor := %g\n", h->tot_avg_uncor);
430  fprintf(fp, "total_coin_rate := %d\n", h->total_coin_rate);
431  fprintf(fp, "frame_start_time := %d\n", h->frame_start_time);
432  fprintf(fp, "frame_duration := %d\n", h->frame_duration);
433  fprintf(fp, "deadtime_correction_factor := %E\n", h->deadtime_correction_factor);
434  fprintf(fp, "physical_planes :=");
435  for(i=0; i<8; i++) fprintf(fp, " %d", h->physical_planes[i]);
436  fprintf(fp, "\n");
437 }
438 /*****************************************************************************/
439 
440 /*****************************************************************************/
448  int i;
449 
450  if(ECAT7_TEST) fprintf(stdout, "ecat7Print2DNormheader()\n");
451  fprintf(fp, "data_type := %d (%s)\n", h->data_type,
452  ecat7datatype(h->data_type) );
453  fprintf(fp, "num_dimensions := %d\n", h->num_dimensions);
454  fprintf(fp, "num_r_elements := %d\n", h->num_r_elements);
455  fprintf(fp, "num_angles := %d\n", h->num_angles);
456  fprintf(fp, "num_z_elements := %d\n", h->num_z_elements);
457  fprintf(fp, "ring_difference := %d\n", h->ring_difference);
458  fprintf(fp, "scale_factor := %E\n", h->scale_factor);
459  fprintf(fp, "norm_min := %g\n", h->norm_min);
460  fprintf(fp, "norm_max := %g\n", h->norm_max);
461  fprintf(fp, "fov_source_width := %g\n", h->fov_source_width);
462  fprintf(fp, "norm_quality_factor := %g\n", h->norm_quality_factor);
463  fprintf(fp, "norm_quality_factor_code := %d\n", h->norm_quality_factor_code);
464  fprintf(fp, "storage_order := %d\n", h->storage_order);
465  fprintf(fp, "span := %d\n", h->span);
466  fprintf(fp, "z_elements :=");
467  for(i=0; i<64; i++) fprintf(fp, " %d", h->z_elements[i]);
468  fprintf(fp, "\n");
469 }
470 /*****************************************************************************/
471 
472 /*****************************************************************************/
479 char* ecat7filetype(short int file_type) {
480  static char *info[] = {
481  "unknown", "2D sinogram", "image-16", "attenuation correction",
482  "2D normalization", "polar map", "volume 8", "volume 16",
483  "projection 8", "projection 16", "image 8", "3D sinogram 16",
484  "3D sinogram 8", "3D normalization", "3D sinogram fit",
485  0};
486  if(file_type>=0 && file_type<=14) return((char*)info[file_type]);
487  else return((char*)info[0]);
488 }
489 /*****************************************************************************/
490 
491 /*****************************************************************************/
498 char* ecat7acquisitiontype(short int acquisition_type) {
499  static char *info[] = {
500  "undefined", "blank", "transmission", "static emission",
501  "dynamic emission", "gated emission", "transmission rectilinear",
502  "emission rectilinear",
503  0};
504  if(acquisition_type>=0 && acquisition_type<=7)
505  return((char*)info[acquisition_type]);
506  else return((char*)info[0]);
507 }
508 /*****************************************************************************/
509 
510 /*****************************************************************************/
517 char* ecat7datatype(short int data_type) {
518  static char *info[] = {
519  "unknown", "byte", "VAX 2 byte integer", "VAX 4 byte integer",
520  "VAX 4 byte float", "IEEE 4 byte float", "SUN 2 byte integer",
521  "SUN 4 byte integer",
522  0};
523  if(data_type>=0 && data_type<=7) return((char*)info[data_type]);
524  else return((char*)info[0]);
525 }
526 /*****************************************************************************/
527 
528 /*****************************************************************************/
534  ECAT7_mainheader mh,
536  FILE *fp,
538  int plane,
540  int frame,
542  FILE *ofp
543 ) {
544  int mi, ret, nr=0;
545  ECAT7_imageheader image_header;
546  ECAT7_scanheader scan_header;
547  ECAT7_2Dscanheader scan2D_header;
548  ECAT7_2Dnormheader norm2D_header;
549  ECAT7_normheader norm_header;
550  ECAT7_attenheader atten_header;
551  ECAT7_polmapheader polmap_header;
552  static ECAT7_MATRIXLIST mlist;
553  ECAT7_Matval matval;
554 
555 
556  /*
557  * Read matrix list
558  */
559  ecat7InitMatlist(&mlist);
560  ret=ecat7ReadMatlist(fp, &mlist);
561  if(ret) {
562  fprintf(stderr, "Error (%d): cannot read matrix list.\n", ret);
563  return(2);
564  }
565  if(mlist.matrixNr<=0) {
566  fprintf(stderr, "Error: matrix list is empty.\n");
567  return(2);
568  }
569  if(ECAT7_TEST>1) ecat7PrintMatlist(&mlist);
570 
571  /*
572  * Read and print subheaders one at a time
573  */
574  for(mi=nr=0; mi<mlist.matrixNr; mi++) {
575  /* Get frame nr */
576  ecat7_id_to_val(mlist.matdir[mi].id, &matval);
577  /* Check if this is supposed to be listed or not */
578  if(frame>=0 && frame!=matval.frame) continue;
579  if(plane>=0 && plane!=matval.plane) continue;
580  fprintf(fp, "Matrix: plane %d frame %d gate %d bed %d\n",
581  matval.plane, matval.frame, matval.gate, matval.bed);
582  /* Read and print subheader */
583  ret=0;
584  switch(mh.file_type) {
585  case ECAT7_ATTEN:
586  ret=ecat7ReadAttenheader(fp, mlist.matdir[mi].strtblk, &atten_header);
587  if(ret==0) ecat7PrintAttenheader(&atten_header, stdout);
588  break;
589  case ECAT7_3DNORM:
590  ret=ecat7ReadNormheader(fp, mlist.matdir[mi].strtblk, &norm_header);
591  if(ret==0) ecat7PrintNormheader(&norm_header, stdout);
592  break;
593  case ECAT7_IMAGE8:
594  case ECAT7_IMAGE16:
595  case ECAT7_VOLUME8:
596  case ECAT7_VOLUME16:
597  ret=ecat7ReadImageheader(fp, mlist.matdir[mi].strtblk, &image_header);
598  if(ret==0) ecat7PrintImageheader(&image_header, stdout);
599  break;
600  case ECAT7_3DSCAN:
601  case ECAT7_3DSCAN8:
602  case ECAT7_3DSCANFIT:
603  ret=ecat7ReadScanheader(fp, mlist.matdir[mi].strtblk, &scan_header);
604  if(ret==0) ecat7PrintScanheader(&scan_header, stdout);
605  break;
606  case ECAT7_POLARMAP:
607  ret=ecat7ReadPolmapheader(fp, mlist.matdir[mi].strtblk, &polmap_header);
608  if(ret==0) ecat7PrintPolmapheader(&polmap_header, stdout);
609  break;
610  case ECAT7_2DSCAN:
611  ret=ecat7Read2DScanheader(fp, mlist.matdir[mi].strtblk, &scan2D_header);
612  if(ret==0) ecat7Print2DScanheader(&scan2D_header, stdout);
613  break;
614  case ECAT7_2DNORM:
615  ret=ecat7Read2DNormheader(fp, mlist.matdir[mi].strtblk, &norm2D_header);
616  if(ret==0) ecat7Print2DNormheader(&norm2D_header, stdout);
617  break;
618  default:
619  fprintf(stderr, "Error: matrix filetype %d is not yet supported.\n",
620  mh.file_type);
621  ecat7EmptyMatlist(&mlist);
622  return(8);
623  }
624  if(ret) {
625  fprintf(stderr, "Error %d in reading subheader.\n", ret);
626  ecat7EmptyMatlist(&mlist); return(5);
627  }
628  nr++; // counter
629  } /* next matrix */
630  ecat7EmptyMatlist(&mlist);
631 
632  if(nr==0 && (plane>=0 || frame>=0)) {
633  fprintf(stderr, "Error: specified matrices not found.\n");
634  return(11);
635  }
636 
637  return(0);
638 }
639 /*****************************************************************************/
640 
641 /*****************************************************************************/
642 
ecat7_scanheader::axial_compression
short int axial_compression
Definition: ecat7.h:371
ecat7_2Dnormheader::data_type
short int data_type
Definition: ecat7.h:459
ECAT7_ATTEN
#define ECAT7_ATTEN
Definition: ecat7.h:70
ecat7_imageheader::mt_3_1
float mt_3_1
Definition: ecat7.h:314
ecat7_imageheader::filter_cutoff_frequency
float filter_cutoff_frequency
Definition: ecat7.h:288
ecat7_mainheader::num_gates
short int num_gates
Definition: ecat7.h:191
ecat7_mainheader::wobble_speed
short int wobble_speed
Definition: ecat7.h:133
ecat7_normheader::scatter_energy
short int scatter_energy
Definition: ecat7.h:555
ecat7_normheader::num_crystal_rings
short int num_crystal_rings
Definition: ecat7.h:546
ecat7_attenheader::scale_factor
float scale_factor
Definition: ecat7.h:502
ecat7_polmapheader::frame_start_time
int frame_start_time
Definition: ecat7.h:592
ecat7_mainheader::lwr_true_thres
short int lwr_true_thres
Definition: ecat7.h:203
ecat7_attenheader::z_elements
short int z_elements[64]
Definition: ecat7.h:532
ecat7_mainheader::plane_separation
float plane_separation
Definition: ecat7.h:199
ECAT7_MATRIXLIST::matdir
ECAT7_MatDir * matdir
Definition: ecat7.h:614
ecat7_mainheader::gantry_tilt
float gantry_tilt
Definition: ecat7.h:125
ecat7ReadPolmapheader
int ecat7ReadPolmapheader(FILE *fp, int blk, ECAT7_polmapheader *h)
Definition: ecat7r.c:325
ecat7_imageheader::y_dimension
short int y_dimension
Definition: ecat7.h:236
ecat7_mainheader::transm_source_type
short int transm_source_type
Definition: ecat7.h:135
ecat7_imageheader::image_max
short int image_max
Definition: ecat7.h:252
ecat7_polmapheader::processing_code
short int processing_code
Definition: ecat7.h:593
ecat7_2Dscanheader::total_coin_rate
int total_coin_rate
Definition: ecat7.h:449
ecat7_scanheader::ring_difference
short int ring_difference
Definition: ecat7.h:367
ecat7_mainheader
Definition: ecat7.h:103
ecat7_imageheader::rfilter_code
short int rfilter_code
Definition: ecat7.h:324
ecat7_imageheader::x_resolution
float x_resolution
Definition: ecat7.h:266
ecat7_polmapheader::position_data
short int position_data
Definition: ecat7.h:586
ecat7_polmapheader::r_wave_offset
int r_wave_offset
Definition: ecat7.h:597
ecat7_polmapheader::ring_position
float ring_position[32]
Definition: ecat7.h:581
ecat7_2Dscanheader::w_resolution
float w_resolution
Definition: ecat7.h:433
ecat7_2Dscanheader::uncor_singles
float uncor_singles[16]
Definition: ecat7.h:446
ecat7_attenheader::num_z_elements
short int num_z_elements
Definition: ecat7.h:490
ecat7_imageheader::mt_1_2
float mt_1_2
Definition: ecat7.h:304
ecat7_2Dscanheader
Definition: ecat7.h:422
ecat7_mainheader::serial_number
char serial_number[10]
Definition: ecat7.h:115
ecat7_scanheader::num_angles
short int num_angles
Definition: ecat7.h:361
ecat7_attenheader::x_resolution
float x_resolution
Definition: ecat7.h:494
ecat7_mainheader::facility_name
char facility_name[20]
Definition: ecat7.h:185
ecat7_attenheader::attenuation_coeff
float attenuation_coeff
Definition: ecat7.h:514
ecat7_imageheader::zfilter_cutoff
float zfilter_cutoff
Definition: ecat7.h:328
ecat7_mainheader::file_type
short int file_type
Definition: ecat7.h:113
ecat7_mainheader::calibration_units
short int calibration_units
Definition: ecat7.h:148
ecat7_scanheader::x_resolution
float x_resolution
Definition: ecat7.h:373
ecat7_imageheader::mt_2_4
float mt_2_4
Definition: ecat7.h:338
ecat7_imageheader::image_min
short int image_min
Definition: ecat7.h:250
ecat7_imageheader::mt_3_3
float mt_3_3
Definition: ecat7.h:318
ecat7_attenheader::data_type
short int data_type
Definition: ecat7.h:480
ecat7.h
ecat7_mainheader::well_counter_corr_factor
float well_counter_corr_factor
Definition: ecat7.h:219
ECAT7_Matval::gate
int gate
Definition: ecat7.h:617
ECAT7_3DSCAN8
#define ECAT7_3DSCAN8
Definition: ecat7.h:79
ecat7_imageheader::num_accepted_beats
int num_accepted_beats
Definition: ecat7.h:286
ecat7_mainheader::patient_name
char patient_name[32]
Definition: ecat7.h:158
ecat7_2Dscanheader::data_type
short int data_type
Definition: ecat7.h:423
ECAT7_Matval::bed
int bed
Definition: ecat7.h:617
ecat7_2Dscanheader::frame_start_time
int frame_start_time
Definition: ecat7.h:450
ecat7_imageheader
Definition: ecat7.h:228
ecat7_scanheader::z_resolution
float z_resolution
Definition: ecat7.h:377
ecat7_2Dnormheader::scale_factor
float scale_factor
Definition: ecat7.h:465
ecat7_imageheader::x_pixel_size
float x_pixel_size
Definition: ecat7.h:254
ecat7_imageheader::z_offset
float z_offset
Definition: ecat7.h:244
ecat7_mainheader::patient_weight
float patient_weight
Definition: ecat7.h:168
ecat7_imageheader::scale_factor
float scale_factor
Definition: ecat7.h:248
ecat7_imageheader::x_offset
float x_offset
Definition: ecat7.h:240
ecat7_mainheader::patient_dexterity
char patient_dexterity
Definition: ecat7.h:162
ecat7_2Dscanheader::tot_avg_uncor
float tot_avg_uncor
Definition: ecat7.h:448
ecat7_polmapheader::sectors_per_ring
short int sectors_per_ring[32]
Definition: ecat7.h:580
ecat7_normheader::span
short int span
Definition: ecat7.h:567
ecat7_scanheader::delayed
int delayed
Definition: ecat7.h:397
ecat7_attenheader::num_additional_atten_coeff
short int num_additional_atten_coeff
Definition: ecat7.h:522
ecat7_mainheader::angular_compression
short int angular_compression
Definition: ecat7.h:141
ecat7_imageheader::rfilter_cutoff
float rfilter_cutoff
Definition: ecat7.h:320
ECAT7_MATRIXLIST
Definition: ecat7.h:611
ecat7_imageheader::rfilter_order
short int rfilter_order
Definition: ecat7.h:326
ecat7_2Dscanheader::delayed
int delayed
Definition: ecat7.h:442
ecat7_polmapheader::image_min
short int image_min
Definition: ecat7.h:587
ecat7_mainheader::bed_position
float bed_position[15]
Definition: ecat7.h:197
ecat7_imageheader::z_resolution
float z_resolution
Definition: ecat7.h:270
ecat7_2Dnormheader::num_z_elements
short int num_z_elements
Definition: ecat7.h:463
ecat7_mainheader::transaxial_fov
float transaxial_fov
Definition: ecat7.h:139
ecat7_2Dscanheader::scale_factor
float scale_factor
Definition: ecat7.h:438
ecat7_mainheader::distance_scanned
float distance_scanned
Definition: ecat7.h:137
ecat7_mainheader::magic_number
char magic_number[14]
Definition: ecat7.h:105
ECAT7_IMAGE8
#define ECAT7_IMAGE8
Definition: ecat7.h:77
ecat7_mainheader::bed_elevation
float bed_elevation
Definition: ecat7.h:129
ecat7_attenheader::tilt_angle
float tilt_angle
Definition: ecat7.h:512
ecat7_imageheader::processing_code
int processing_code
Definition: ecat7.h:280
ecat7_attenheader::attenuation_min
float attenuation_min
Definition: ecat7.h:516
ecat7_imageheader::zfilter_order
short int zfilter_order
Definition: ecat7.h:334
ecat7_imageheader::mt_3_2
float mt_3_2
Definition: ecat7.h:316
ECAT7_MatDir::strtblk
int strtblk
Definition: ecat7.h:607
ecat7_mainheader::patient_id
char patient_id[16]
Definition: ecat7.h:156
ecat7_imageheader::filter_ramp_slope
float filter_ramp_slope
Definition: ecat7.h:292
ecat7_mainheader::lwr_sctr_thres
short int lwr_sctr_thres
Definition: ecat7.h:201
ecat7_imageheader::filter_order
short int filter_order
Definition: ecat7.h:294
ecat7_2Dnormheader::num_dimensions
short int num_dimensions
Definition: ecat7.h:460
ecat7_attenheader::storage_order
short int storage_order
Definition: ecat7.h:528
ecat7_scanheader::scale_factor
float scale_factor
Definition: ecat7.h:389
ecat7_mainheader::original_file_name
char original_file_name[32]
Definition: ecat7.h:107
ecat7_mainheader::isotope_name
char isotope_name[8]
Definition: ecat7.h:119
ecat7_attenheader::y_radius
float y_radius
Definition: ecat7.h:510
ecat7_2Dscanheader::num_angles
short int num_angles
Definition: ecat7.h:426
ecat7_polmapheader::num_rings
short int num_rings
Definition: ecat7.h:579
ecat7_mainheader::branching_fraction
float branching_fraction
Definition: ecat7.h:213
ecat7_mainheader::dosage
float dosage
Definition: ecat7.h:217
ecat7_normheader::data_type
short int data_type
Definition: ecat7.h:540
ecat7_mainheader::num_frames
short int num_frames
Definition: ecat7.h:189
ECAT7_3DNORM
#define ECAT7_3DNORM
Definition: ecat7.h:80
ecat7_mainheader::upr_true_thres
short int upr_true_thres
Definition: ecat7.h:205
ecat7_imageheader::mt_1_4
float mt_1_4
Definition: ecat7.h:336
ecat7_attenheader::span
short int span
Definition: ecat7.h:530
ecat7_attenheader::num_angles
short int num_angles
Definition: ecat7.h:488
ecat7_polmapheader
Definition: ecat7.h:576
ecat7_mainheader::acquisition_type
short int acquisition_type
Definition: ecat7.h:181
ecat7_attenheader::y_resolution
float y_resolution
Definition: ecat7.h:496
ecat7_imageheader::frame_start_time
int frame_start_time
Definition: ecat7.h:262
ecat7_mainheader::data_units
char data_units[32]
Definition: ecat7.h:221
ecat7_attenheader::y_offset
float y_offset
Definition: ecat7.h:506
ecat7_attenheader::w_resolution
float w_resolution
Definition: ecat7.h:500
ecat7_imageheader::gate_duration
int gate_duration
Definition: ecat7.h:282
ecat7_2Dnormheader::storage_order
short int storage_order
Definition: ecat7.h:471
ecat7_scanheader::deadtime_correction_factor
float deadtime_correction_factor
Definition: ecat7.h:413
ecat7_mainheader::physician_name
char physician_name[32]
Definition: ecat7.h:174
ecat7_scanheader
Definition: ecat7.h:353
ecat7_scanheader::num_r_elements
short int num_r_elements
Definition: ecat7.h:359
ecat7_polmapheader::quant_units
short int quant_units
Definition: ecat7.h:594
ecat7_imageheader::y_resolution
float y_resolution
Definition: ecat7.h:268
ecat7_attenheader::x_offset
float x_offset
Definition: ecat7.h:504
ecat7_2Dnormheader::norm_quality_factor_code
short int norm_quality_factor_code
Definition: ecat7.h:470
ecat7_attenheader::additional_atten_coeff
float additional_atten_coeff[8]
Definition: ecat7.h:524
ecat7_mainheader::init_bed_position
float init_bed_position
Definition: ecat7.h:195
ecat7_mainheader::fill_cti
short int fill_cti[6]
Definition: ecat7.h:225
ecat7_imageheader::filter_code
short int filter_code
Definition: ecat7.h:264
ecat7_imageheader::y_pixel_size
float y_pixel_size
Definition: ecat7.h:256
ecat7_imageheader::num_angles
float num_angles
Definition: ecat7.h:274
ecat7_imageheader::rfilter_resolution
float rfilter_resolution
Definition: ecat7.h:322
ecat7_mainheader::num_bed_pos
short int num_bed_pos
Definition: ecat7.h:193
ecat7_polmapheader::start_angle
short int start_angle
Definition: ecat7.h:583
ecat7_scanheader::net_trues
int net_trues
Definition: ecat7.h:401
ecat7_scanheader::tot_avg_cor
float tot_avg_cor
Definition: ecat7.h:403
ecat7_scanheader::r_wave_offset
int r_wave_offset
Definition: ecat7.h:385
ecat7_scanheader::uncor_singles
float uncor_singles[128]
Definition: ecat7.h:419
ecat7_imageheader::annotation
char annotation[40]
Definition: ecat7.h:300
ecat7_attenheader::z_resolution
float z_resolution
Definition: ecat7.h:498
ecat7_2Dscanheader::y_resolution
float y_resolution
Definition: ecat7.h:431
ecat7_attenheader::num_r_elements
short int num_r_elements
Definition: ecat7.h:486
ecat7_mainheader::user_process_code
char user_process_code[10]
Definition: ecat7.h:207
ecat7_mainheader::sw_version
short int sw_version
Definition: ecat7.h:109
ECAT7_Matval::plane
int plane
Definition: ecat7.h:617
ecat7_2Dscanheader::cor_singles
float cor_singles[16]
Definition: ecat7.h:445
ecat7_imageheader::fill_user
short int fill_user[49]
Definition: ecat7.h:350
ecat7_polmapheader::database_name
char database_name[30]
Definition: ecat7.h:600
ecat7_polmapheader::image_max
short int image_max
Definition: ecat7.h:588
ECAT7_MATRIXLIST::matrixNr
int matrixNr
Definition: ecat7.h:612
ecat7_2Dscanheader::prompts
int prompts
Definition: ecat7.h:441
ecat7_normheader::ring_dtcor2
float ring_dtcor2[32]
Definition: ecat7.h:563
ecat7_imageheader::mt_2_3
float mt_2_3
Definition: ecat7.h:312
ecat7_polmapheader::polar_map_protocol
char polar_map_protocol[20]
Definition: ecat7.h:599
ecat7_2Dnormheader
Definition: ecat7.h:458
ecat7_normheader::max_ring_diff
short int max_ring_diff
Definition: ecat7.h:569
ecat7_scanheader::v_resolution
float v_resolution
Definition: ecat7.h:375
ecat7_2Dnormheader::ring_difference
short int ring_difference
Definition: ecat7.h:464
ecat7_attenheader::attenuation_max
float attenuation_max
Definition: ecat7.h:518
ecat7_normheader::crystal_dtcor
float crystal_dtcor[8]
Definition: ecat7.h:565
ECAT7_Matval::frame
int frame
Definition: ecat7.h:617
ecat7_2Dnormheader::norm_min
float norm_min
Definition: ecat7.h:466
ecat7_scanheader::w_resolution
float w_resolution
Definition: ecat7.h:379
ecat7ReadNormheader
int ecat7ReadNormheader(FILE *fp, int blk, ECAT7_normheader *h)
Definition: ecat7r.c:378
ecat7_mainheader::patient_sex
char patient_sex
Definition: ecat7.h:160
ecat7_mainheader::septa_state
short int septa_state
Definition: ecat7.h:223
ecat7_2Dscanheader::z_resolution
float z_resolution
Definition: ecat7.h:432
ecat7_2Dnormheader::num_r_elements
short int num_r_elements
Definition: ecat7.h:461
ecat7_2Dnormheader::span
short int span
Definition: ecat7.h:472
ECAT7_Matval
Definition: ecat7.h:616
ecat7_mainheader::patient_height
float patient_height
Definition: ecat7.h:166
ecat7_scanheader::total_coin_rate
int total_coin_rate
Definition: ecat7.h:407
ECAT7_POLARMAP
#define ECAT7_POLARMAP
Definition: ecat7.h:72
ecat7PrintNormheader
void ecat7PrintNormheader(ECAT7_normheader *h, FILE *fp)
Definition: ecat7p.c:359
ecat7_scanheader::scan_min
short int scan_min
Definition: ecat7.h:391
ECAT7_3DSCAN
#define ECAT7_3DSCAN
Definition: ecat7.h:78
ecat7_polmapheader::frame_duration
int frame_duration
Definition: ecat7.h:591
ecat7ReadImageheader
int ecat7ReadImageheader(FILE *fp, int blk, ECAT7_imageheader *h)
Definition: ecat7r.c:177
ecat7_normheader::norm_quality_factor
float norm_quality_factor
Definition: ecat7.h:557
ecat7_imageheader::y_offset
float y_offset
Definition: ecat7.h:242
ecat7_2Dscanheader::physical_planes
short int physical_planes[8]
Definition: ecat7.h:453
ecat7_polmapheader::polar_map_type
short int polar_map_type
Definition: ecat7.h:578
ecat7_2Dscanheader::ring_difference
short int ring_difference
Definition: ecat7.h:429
ecat7_imageheader::mt_1_1
float mt_1_1
Definition: ecat7.h:302
ecat7filetype
char * ecat7filetype(short int file_type)
Definition: ecat7p.c:479
ecat7_mainheader::isotope_halflife
float isotope_halflife
Definition: ecat7.h:121
ecat7ReadAttenheader
int ecat7ReadAttenheader(FILE *fp, int blk, ECAT7_attenheader *h)
Definition: ecat7r.c:268
ecat7_2Dscanheader::num_z_elements
short int num_z_elements
Definition: ecat7.h:428
ECAT7_VOLUME16
#define ECAT7_VOLUME16
Definition: ecat7.h:74
ecat7PrintMainheader
void ecat7PrintMainheader(ECAT7_mainheader *h, FILE *fp)
Definition: ecat7p.c:49
ecat7_2Dscanheader::multiples
int multiples
Definition: ecat7.h:443
ecat7_mainheader::gantry_rotation
float gantry_rotation
Definition: ecat7.h:127
ecat7PrintMatlist
void ecat7PrintMatlist(ECAT7_MATRIXLIST *ml)
Definition: ecat7ml.c:149
ecat7_scanheader::tot_avg_uncor
float tot_avg_uncor
Definition: ecat7.h:405
ecat7_imageheader::recon_zoom
float recon_zoom
Definition: ecat7.h:246
ecat7_imageheader::z_dimension
short int z_dimension
Definition: ecat7.h:238
ecat7_imageheader::z_rotation_angle
float z_rotation_angle
Definition: ecat7.h:276
ecat7_mainheader::patient_orientation
short int patient_orientation
Definition: ecat7.h:183
ecat7PrintPolmapheader
void ecat7PrintPolmapheader(ECAT7_polmapheader *h, FILE *fp)
Definition: ecat7p.c:310
ecat7_polmapheader::long_axis_left
short int long_axis_left[3]
Definition: ecat7.h:584
ecat7_mainheader::operator_name
char operator_name[32]
Definition: ecat7.h:176
ecat7_imageheader::z_pixel_size
float z_pixel_size
Definition: ecat7.h:258
ecat7_mainheader::dose_start_time
int dose_start_time
Definition: ecat7.h:215
ecat7PrintScanheader
void ecat7PrintScanheader(ECAT7_scanheader *h, FILE *fp)
Definition: ecat7p.c:215
ecat7_attenheader::attenuation_type
short int attenuation_type
Definition: ecat7.h:484
ecat7_mainheader::scan_start_time
int scan_start_time
Definition: ecat7.h:117
ecat7_mainheader::ecat_calibration_factor
float ecat_calibration_factor
Definition: ecat7.h:146
ecat7_normheader::crystals_per_ring
short int crystals_per_ring
Definition: ecat7.h:547
ecat7_polmapheader::pixel_size
float pixel_size
Definition: ecat7.h:590
ecat7_2Dscanheader::deadtime_correction_factor
float deadtime_correction_factor
Definition: ecat7.h:452
ecat7_imageheader::data_type
short int data_type
Definition: ecat7.h:230
ecat7_normheader::num_geo_corr_planes
short int num_geo_corr_planes
Definition: ecat7.h:549
ecat7PrintSubheader
int ecat7PrintSubheader(ECAT7_mainheader mh, FILE *fp, int plane, int frame, FILE *ofp)
Definition: ecat7p.c:532
ecat7datatype
char * ecat7datatype(short int data_type)
Definition: ecat7p.c:517
ecat7_attenheader::ring_difference
short int ring_difference
Definition: ecat7.h:492
ecat7_polmapheader::scale_factor
float scale_factor
Definition: ecat7.h:589
ecat7_imageheader::mt_2_2
float mt_2_2
Definition: ecat7.h:310
ecat7ReadScanheader
int ecat7ReadScanheader(FILE *fp, int blk, ECAT7_scanheader *h)
Definition: ecat7r.c:424
ecat7InitMatlist
void ecat7InitMatlist(ECAT7_MATRIXLIST *mlist)
Definition: ecat7ml.c:59
ecat7_2Dnormheader::norm_max
float norm_max
Definition: ecat7.h:467
ecat7_2Dscanheader::x_resolution
float x_resolution
Definition: ecat7.h:430
ecat7_mainheader::axial_samp_mode
short int axial_samp_mode
Definition: ecat7.h:145
ecat7_scanheader::corrections_applied
short int corrections_applied
Definition: ecat7.h:363
ecat7_normheader::norm_quality_factor_code
short int norm_quality_factor_code
Definition: ecat7.h:559
ecat7_2Dscanheader::net_trues
int net_trues
Definition: ecat7.h:444
ecat7_2Dscanheader::scan_max
short int scan_max
Definition: ecat7.h:440
ecat7_mainheader::system_type
short int system_type
Definition: ecat7.h:111
ecat7_scanheader::multiples
int multiples
Definition: ecat7.h:399
ECAT7_IMAGE16
#define ECAT7_IMAGE16
Definition: ecat7.h:69
ecat7_normheader::ring_dtcor1
float ring_dtcor1[32]
Definition: ecat7.h:561
ecat7_normheader::num_transaxial_crystals
short int num_transaxial_crystals
Definition: ecat7.h:544
ecat7_scanheader::gate_duration
int gate_duration
Definition: ecat7.h:383
ecat7EmptyMatlist
void ecat7EmptyMatlist(ECAT7_MATRIXLIST *mlist)
Definition: ecat7ml.c:70
ecat7_2Dscanheader::gate_duration
int gate_duration
Definition: ecat7.h:435
ECAT7_3DSCANFIT
#define ECAT7_3DSCANFIT
Definition: ecat7.h:81
ecat7_scanheader::frame_duration
int frame_duration
Definition: ecat7.h:411
ECAT7_MatDir::id
int id
Definition: ecat7.h:606
ecat7_2Dscanheader::r_wave_offset
int r_wave_offset
Definition: ecat7.h:436
ecat7_2Dscanheader::frame_duration
int frame_duration
Definition: ecat7.h:451
ecat7_mainheader::acquisition_mode
short int acquisition_mode
Definition: ecat7.h:209
ecat7_imageheader::frame_duration
int frame_duration
Definition: ecat7.h:260
ecat7_mainheader::intrinsic_tilt
float intrinsic_tilt
Definition: ecat7.h:131
ecat7_polmapheader::long_axis_right
short int long_axis_right[3]
Definition: ecat7.h:585
ecat7_mainheader::compression_code
short int compression_code
Definition: ecat7.h:152
ecat7_id_to_val
void ecat7_id_to_val(int matrix_id, ECAT7_Matval *matval)
Definition: ecat7ml.c:299
ecat7_mainheader::patient_age
float patient_age
Definition: ecat7.h:164
ecat7_imageheader::num_r_elements
float num_r_elements
Definition: ecat7.h:272
ecat7_scanheader::frame_start_time
int frame_start_time
Definition: ecat7.h:409
ecat7ReadMatlist
int ecat7ReadMatlist(FILE *fp, ECAT7_MATRIXLIST *ml)
Definition: ecat7ml.c:86
ecat7_imageheader::filter_scatter_slope
float filter_scatter_slope
Definition: ecat7.h:298
ecat7_mainheader::coin_samp_mode
short int coin_samp_mode
Definition: ecat7.h:143
ecat7_imageheader::zfilter_resolution
float zfilter_resolution
Definition: ecat7.h:330
ecat7_imageheader::x_dimension
short int x_dimension
Definition: ecat7.h:234
ecat7_imageheader::mt_3_4
float mt_3_4
Definition: ecat7.h:340
ecat7_polmapheader::gate_duration
int gate_duration
Definition: ecat7.h:596
ECAT7_2DNORM
#define ECAT7_2DNORM
Definition: ecat7.h:71
ecat7_2Dnormheader::fov_source_width
float fov_source_width
Definition: ecat7.h:468
ecat7_2Dnormheader::z_elements
short int z_elements[64]
Definition: ecat7.h:473
ecat7_mainheader::radiopharmaceutical
char radiopharmaceutical[32]
Definition: ecat7.h:123
ecat7_imageheader::decay_corr_fctr
float decay_corr_fctr
Definition: ecat7.h:278
ecat7_2Dscanheader::num_dimensions
short int num_dimensions
Definition: ecat7.h:424
ecat7PrintAttenheader
void ecat7PrintAttenheader(ECAT7_attenheader *h, FILE *fp)
Definition: ecat7p.c:264
ecat7_attenheader::num_dimensions
short int num_dimensions
Definition: ecat7.h:482
ecat7_2Dscanheader::num_accepted_beats
int num_accepted_beats
Definition: ecat7.h:437
ecat7_scanheader::num_accepted_beats
int num_accepted_beats
Definition: ecat7.h:387
ecat7_imageheader::recon_views
short int recon_views
Definition: ecat7.h:346
ecat7PrintImageheader
void ecat7PrintImageheader(ECAT7_imageheader *h, FILE *fp)
Definition: ecat7p.c:137
ecat7_scanheader::num_dimensions
short int num_dimensions
Definition: ecat7.h:357
ecat7_mainheader::patient_birth_date
int patient_birth_date
Definition: ecat7.h:172
ecat7_mainheader::study_type
char study_type[12]
Definition: ecat7.h:154
ecat7_attenheader::x_radius
float x_radius
Definition: ecat7.h:508
ecat7_mainheader::calibration_units_label
short int calibration_units_label
Definition: ecat7.h:150
ecat7_imageheader::scatter_type
short int scatter_type
Definition: ecat7.h:342
ecat7_attenheader::edge_finding_threshold
float edge_finding_threshold
Definition: ecat7.h:526
ecat7_scanheader::data_type
short int data_type
Definition: ecat7.h:355
ecat7_polmapheader::ring_angle
short int ring_angle[32]
Definition: ecat7.h:582
ecat7_imageheader::mt_1_3
float mt_1_3
Definition: ecat7.h:306
ecat7_2Dnormheader::norm_quality_factor
float norm_quality_factor
Definition: ecat7.h:469
ecat7_scanheader::storage_order
short int storage_order
Definition: ecat7.h:369
ecat7_attenheader::skull_thickness
float skull_thickness
Definition: ecat7.h:520
ecat7_mainheader::bin_size
float bin_size
Definition: ecat7.h:211
ecat7_mainheader::study_description
char study_description[32]
Definition: ecat7.h:178
ecat7_2Dscanheader::tot_avg_cor
float tot_avg_cor
Definition: ecat7.h:447
ecat7_imageheader::num_dimensions
short int num_dimensions
Definition: ecat7.h:232
ecat7_imageheader::filter_scatter_fraction
float filter_scatter_fraction
Definition: ecat7.h:296
ecat7_scanheader::prompts
int prompts
Definition: ecat7.h:395
ecat7_mainheader::num_planes
short int num_planes
Definition: ecat7.h:187
ECAT7_TEST
int ECAT7_TEST
Definition: ecat7.h:101
ecat7_imageheader::recon_type
short int recon_type
Definition: ecat7.h:344
ecat7_normheader::num_r_elements
short int num_r_elements
Definition: ecat7.h:542
ecat7_imageheader::zfilter_code
short int zfilter_code
Definition: ecat7.h:332
ecat7_scanheader::num_z_elements
short int num_z_elements[64]
Definition: ecat7.h:365
ecat7Read2DScanheader
int ecat7Read2DScanheader(FILE *fp, int blk, ECAT7_2Dscanheader *h)
Definition: ecat7r.c:485
ecat7_imageheader::filter_resolution
float filter_resolution
Definition: ecat7.h:290
ecat7_normheader::lld
short int lld
Definition: ecat7.h:553
ecat7acquisitiontype
char * ecat7acquisitiontype(short int acquisition_type)
Definition: ecat7p.c:498
ecat7_polmapheader::annotation
char annotation[40]
Definition: ecat7.h:595
ecat7_normheader
Definition: ecat7.h:539
ecat7_normheader::uld
short int uld
Definition: ecat7.h:551
ecat7_polmapheader::data_type
short int data_type
Definition: ecat7.h:577
ecat7_attenheader
Definition: ecat7.h:478
ecat7_2Dscanheader::corrections_applied
short int corrections_applied
Definition: ecat7.h:427
ecat7_2Dscanheader::num_r_elements
short int num_r_elements
Definition: ecat7.h:425
ecat7_scanheader::scan_max
short int scan_max
Definition: ecat7.h:393
ecat7_polmapheader::num_accepted_beats
int num_accepted_beats
Definition: ecat7.h:598
ecat7_2Dscanheader::scan_min
short int scan_min
Definition: ecat7.h:439
ecat7_imageheader::mt_2_1
float mt_2_1
Definition: ecat7.h:308
ECAT7_2DSCAN
#define ECAT7_2DSCAN
Definition: ecat7.h:68
ECAT7_VOLUME8
#define ECAT7_VOLUME8
Definition: ecat7.h:73
ecat7_imageheader::fill_cti
short int fill_cti[87]
Definition: ecat7.h:348
ecat7Read2DNormheader
int ecat7Read2DNormheader(FILE *fp, int blk, ECAT7_2Dnormheader *h)
Definition: ecat7r.c:546
ecat7_2Dnormheader::num_angles
short int num_angles
Definition: ecat7.h:462
ecat7_imageheader::r_wave_offset
int r_wave_offset
Definition: ecat7.h:284
ecat7Print2DNormheader
void ecat7Print2DNormheader(ECAT7_2Dnormheader *h, FILE *fp)
Definition: ecat7p.c:447
ecat7Print2DScanheader
void ecat7Print2DScanheader(ECAT7_2Dscanheader *h, FILE *fp)
Definition: ecat7p.c:396