ecat+ 6.0.0
general.h
Go to the documentation of this file.
1/* This software and supporting documentation are distributed by
2 * Institut Federatif de Recherche 49
3 * CEA/NeuroSpin, Batiment 145,
4 * 91191 Gif-sur-Yvette cedex
5 * France
6 *
7 * This software is governed by the CeCILL-B license under
8 * French law and abiding by the rules of distribution of free software.
9 * You can use, modify and/or redistribute the software under the
10 * terms of the CeCILL-B license as circulated by CEA, CNRS
11 * and INRIA at the following URL "http://www.cecill.info".
12 *
13 * As a counterpart to the access to the source code and rights to copy,
14 * modify and redistribute granted by the license, users are provided only
15 * with a limited warranty and the software's author, the holder of the
16 * economic rights, and the successive licensors have only limited
17 * liability.
18 *
19 * In this respect, the user's attention is drawn to the risks associated
20 * with loading, using, modifying and/or developing or reproducing the
21 * software by the user in light of its specific status of free software,
22 * that may mean that it is complicated to manipulate, and that also
23 * therefore means that it is reserved for developers and experienced
24 * professionals having in-depth computer knowledge. Users are therefore
25 * encouraged to load and test the software's suitability as regards their
26 * requirements in conditions enabling the security of their systems and/or
27 * data to be ensured and, more generally, to use and operate it in the
28 * same conditions as regards security.
29 *
30 * The fact that you are presently reading this means that you have had
31 * knowledge of the CeCILL-B license and that you accept its terms.
32 */
33
34/****************************************************************************
35 * PROJECT : E.C.A.T.S.H.F.J. Library
36 * MODULE NAME : general.h * TYPE : header
37 * AUTHOR : FROUIN V. * CREATION : 19/05/2000
38 * VERSION : 0.1 * REVISION :
39 * LANGUAGE : C++ * EXAMPLE :
40 * DEVICE :
41 ****************************************************************************
42 *
43 * DESCRIPTION : Ecat6-7 data reader class
44 * Version d'apres codes les codes de C. Comtat.
45 *
46 ****************************************************************************
47 * REVISIONS : DATE | AUTHOR | DESCRIPTION
48 *--------------------|--------------|---------------------------------------
49 * 07/09/2000 | COMTAT C. | Modification de la structure
50 * | | UnifiedEcatInfo :
51 * | |
52 * | | - suppression de la variable mptr
53 * | | (MatrixFile), afin de ne pas
54 * | | avoir a inclure
55 * | | ecat/kernel/matrix.h dans les
56 * | | routines faisant appel a la
57 * | | librairie ecat+
58 * | |
59 * | | - ajout de la variable fname
60 * | |
61 * | | - ajout de la variable
62 * | | original_filename pour
63 * | | referencer le fichier d'ou
64 * | | proviennent les donnees.
65 * | |
66 * | | - ajout de la variable open_mode,
67 * | | pour savoir si fname est ouvert
68 * | | pour ecriture ou lecture
69 * | |
70 *--------------------|--------------|---------------------------------------
71 * 07/11/2000 | Frouin V. | Ajout de champs dans la struture uei
72 * | | - isotope, halflife
73 * | | - proc_code et proc_list
74 * | |
75 *--------------------|--------------|---------------------------------------
76 * 16/11/2000 | Frouin V. | Remplac. de isotope et halflife par
77 * | Comtat C. | radiopharmaceutic
78 * | | Ajout de calibUnits et dataCalibrated
79 * | |
80 ****************************************************************************/
81#ifndef ECATSHFJ_IO_GENERAL_H
82#define ECATSHFJ_IO_GENERAL_H
83
84#include <stdlib.h>
85#include <time.h>
86
87#define ECATSHFJ_FAIL 0
88#define ECATSHFJ_OK 1
89
90#define ECATSHFJ_FRAMED 0
91#define ECATSHFJ_GATED 1
92
93#define ECATSHFJ_ECS "ECAT counts/sec"
94#define ECATSHFJ_BQCC "Bq/cc"
95#define ECATSHFJ_LABELS "Labels"
96#define ECATSHFJ_UNKN "Unknown"
97
98typedef struct
99{
100 char *fname;
101 struct
102 {
103 int x, y, z, t;
104 } size;
105 struct
106 {
107 float x, y, z, t;
108 } voxelsize;
109
110 /* Pointeur vers les infos sur le timing */
111 float *scale;
114
115 /* FileType dans le main header peut etre faux */
116 /* trueFileType contient la valeur correct : */
117 /* Image, Volume, Projection */
118 /* Cette variable sera initialisée avec les valeurs */
119 /* enum de ecat : PetImage, PetVolume et PetProjection */
121
122 /* Argument du fichier ouvert */
124 /* nom du fichier ouvert en mode */
125 /* lecture (== fname) ou */
126 /* du fichier d'ou */
127 /* proviennent les donnees qui */
128 /* vont etre ecrites */
129 char open_mode[4]; /* mode d'ouverture du fichier */
130
131
132
133 /* Pointeur vers les infos sur le timing */
134 int *rawlist; /* list des framegate number tels */
135 /* que presentes dans les headers */
136
137 long *sortuniqlist; /*index de parcours logique de rawlist*/
138 /* contient size.t elements */
139
140
141 /* Pointeurs sur des informations complémentai destinées au header*/
144
145 float calib;
146 char calibUnits[128];
148
149
152
153 char category[64];
156
157
158typedef struct scan3dsub
159{
160 struct scan3dsub *next;
161 /* ---------- SUBHEADER --------------------------------*/
162
163 unsigned int gate_duration;
167 short scan_min;
168 short scan_max;
176 unsigned int frame_start_time;
177 unsigned int frame_duration;
179 float uncor_singles[128];
180
181 /* --------------------------------------------- */
182#ifdef QUOICESTCA
183 MatrixFile *matfile ; /* pointer to parent */
184 DataSetType mat_type ; /* type of matrix? */
185 MatrixDataType data_type ; /* type of data */
186 int data_size ; /* size of data in bytes */
187 int xdim; /* dimensions of data */
188 int ydim; /* y dimension */
189 int zdim; /* for volumes */
190 float scale_factor ; /* valid if data is int? */
191 float pixel_size; /* xdim data spacing (cm) */
192 float y_size; /* ydim data spacing (cm) */
193 float z_size; /* zdim data spacing (cm) */
194 float data_min; /* min value of data */
195 float data_max; /* max value of data */
196 float x_origin; /* x origin of data */
197 float y_origin; /* y origin of data */
198 float z_origin; /* z origin of data */
199#endif
201
202
203typedef struct
204{
205 char *fname;
206 char open_mode[4]; /* mode d'ouverture du fichier */
207
208 /* ------- MAIN HEADER -----------------------*/
209 char magic_number[14];
213 char file_type[32];
215 short align_0;
216 unsigned int scan_start_time;
231 short align_1;
236 char study_name[12];
237 char patient_id[16];
238 char patient_name[32];
239 char patient_sex[1];
256 float bed_offset[15];
263 short align_2;
264 float bin_size;
266 unsigned int dose_start_time;
267 float dosage;
269 char data_units[32];
271 short align_3;
272
273 /* A mon avis ce sont des champs des subheaders qui sont communes
274 a toutes les données ... */
275
281 short num_z_elements[64];
289
290
291
293
295
296
297#endif
struct scan3dsub scan3DSub
struct matrix_file MatrixFile
MatrixDataType
DataSetType
char dataCalibrated
Definition general.h:147
char open_mode[4]
Definition general.h:129
int * duration_time
Definition general.h:112
char original_filename[200]
Definition general.h:123
char calibUnits[128]
Definition general.h:146
char radiopharmaceutical[200]
Definition general.h:142
time_t zero_start_time
Definition general.h:154
char * proc_list
Definition general.h:150
float * scale
Definition general.h:111
long * sortuniqlist
Definition general.h:137
char category[64]
Definition general.h:153
float isotope_halflife
Definition general.h:143
int * start_time
Definition general.h:112
float well_counter_factor
Definition general.h:268
unsigned int dose_start_time
Definition general.h:266
char patient_sex[1]
Definition general.h:239
char radiopharmaceutical[32]
Definition general.h:219
short corrections_applied
Definition general.h:280
unsigned int scan_start_time
Definition general.h:216
char patient_name[32]
Definition general.h:238
scan3DSub * subfirst
Definition general.h:292
short axial_compression
Definition general.h:284
char data_units[32]
Definition general.h:269
short angular_compression
Definition general.h:228
char original_file_name[32]
Definition general.h:210
char patient_id[16]
Definition general.h:237
short transm_source_type
Definition general.h:225
char serial_number[10]
Definition general.h:214
char isotope_code[8]
Definition general.h:217
short calibration_units
Definition general.h:233
char patient_dexterity[1]
Definition general.h:240
char study_description[32]
Definition general.h:247
char facility_name[20]
Definition general.h:250
float branching_fraction
Definition general.h:265
char user_process_code[10]
Definition general.h:261
float bed_offset[15]
Definition general.h:256
short patient_orientation
Definition general.h:249
char physician_name[32]
Definition general.h:245
short calibration_units_label
Definition general.h:234
scan3DSub * sublast
Definition general.h:292
float init_bed_position
Definition general.h:255
char operator_name[32]
Definition general.h:246
short num_z_elements[64]
Definition general.h:281
float calibration_factor
Definition general.h:232
char study_name[12]
Definition general.h:236
char file_type[32]
Definition general.h:213
char magic_number[14]
Definition general.h:209
int multiples
Definition general.h:171
float loss_correction_fctr
Definition general.h:178
float uncor_singles[128]
Definition general.h:179
int total_coin_rate
Definition general.h:175
short scan_min
Definition general.h:167
int r_wave_offset
Definition general.h:164
int num_accepted_beats
Definition general.h:165
float scale_factor
Definition general.h:166
unsigned int frame_duration
Definition general.h:177
unsigned int frame_start_time
Definition general.h:176
int delayed
Definition general.h:170
int prompts
Definition general.h:169
short scan_max
Definition general.h:168
int net_trues
Definition general.h:172
float tot_avg_cor
Definition general.h:173
struct scan3dsub * next
Definition general.h:160
float tot_avg_uncor
Definition general.h:174
unsigned int gate_duration
Definition general.h:163