~ubuntu-branches/ubuntu/warty/xmedcon/warty

« back to all changes in this revision

Viewing changes to source/m-conc.h

  • Committer: Bazaar Package Importer
  • Author(s): Roland Marcus Rutschmann
  • Date: 2004-06-07 09:00:14 UTC
  • Revision ID: james.westby@ubuntu.com-20040607090014-t39n52qc9zjqqqkh
Tags: upstream-0.9.6
ImportĀ upstreamĀ versionĀ 0.9.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 
2
 * filename: m-conc.h                                                      *
 
3
 *                                                                         *
 
4
 * UTIL C-source: Medical Image Conversion Utility                         *
 
5
 *                                                                         *
 
6
 * purpose      : m-conc.c header file                                     *
 
7
 *                                                                         *
 
8
 * project      : (X)MedCon by Erik Nolf                                   *
 
9
 *                                                                         *
 
10
 * Author       : Andy Loening                                             *
 
11
 *                                                                         *
 
12
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
13
/* $Id: m-conc.h,v 1.19 2004/05/07 22:28:47 enlf Exp $
 
14
 */
 
15
 
 
16
/*
 
17
   Copyright (C) 1997-2004 by Erik Nolf
 
18
 
 
19
   This program is free software; you can redistribute it and/or modify it
 
20
   under the terms of the GNU General Public License as published by the
 
21
   Free Software Foundation; either version 2, or (at your option) any later
 
22
   version.
 
23
 
 
24
   This program is distributed in the hope that it will be useful, but
 
25
   WITHOUT ANY WARRANTY; without even the implied warranty of
 
26
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
 
27
   Public License for more details.
 
28
 
 
29
   You should have received a copy of the GNU General Public License along
 
30
   with this program; if not, write to the Free Software Foundation, Inc.,
 
31
   59 Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
32
 
 
33
#ifndef __M_CONC_H__
 
34
#define __M_CONC_H__
 
35
 
 
36
/****************************************************************************
 
37
                              H E A D E R S
 
38
****************************************************************************/
 
39
 
 
40
 
 
41
 
 
42
/****************************************************************************
 
43
                              D E F I N E S
 
44
****************************************************************************/
 
45
 
 
46
/* concorde data file types (integer) */
 
47
typedef enum {
 
48
  MDC_CONC_FILE_UNKNOWN,
 
49
  MDC_CONC_FILE_LIST_MODE,
 
50
  MDC_CONC_FILE_SINOGRAM,
 
51
  MDC_CONC_FILE_NORMALIZATION,
 
52
  MDC_CONC_FILE_ATTENUATION,
 
53
  MDC_CONC_FILE_IMAGE,
 
54
  MDC_CONC_FILE_BLANK,
 
55
  MDC_CONC_FILE_RESERVED, /* 7 is skipped for some reason */
 
56
  MDC_CONC_FILE_MU_MAP,
 
57
  MDC_CONC_NUM_FILE_TYPES
 
58
} MdcConcFileTypes;
 
59
 
 
60
/* concorde acquisition modes (integer) */
 
61
typedef enum {
 
62
  MDC_CONC_ACQ_UNKNOWN,                    /* Unknown acquisition mode */
 
63
  MDC_CONC_ACQ_BLANK,                      /* Blank acquisition */
 
64
  MDC_CONC_ACQ_EMISSION,                   /* Emission acquisition */
 
65
  MDC_CONC_ACQ_DYNAMIC,                    /* Dynamic acquisition */
 
66
  MDC_CONC_ACQ_GATED,                      /* Gated acquisition */
 
67
  MDC_CONC_ACQ_CONTINUOUS,                 /* Continous bed motion acquisition */
 
68
  MDC_CONC_ACQ_SINGLES,                    /* Singles transmission acquisition */
 
69
  MDC_CONC_ACQ_WINDOWED_COINCIDENCE,       /* Windowed coincidence transmission acquisition */
 
70
  MDC_CONC_ACQ_NON_WINDOWED_COINCIDENCE,   /* Non-windowed coincidence transmission acquisition */
 
71
  MDC_CONC_NUM_ACQ_MODES
 
72
} MdcConcAcqModes;
 
73
 
 
74
typedef enum {
 
75
  MDC_CONC_BED_MOTION_STATIC,              /* Static or unknown bed motion */
 
76
  MDC_CONC_BED_MOTION_CONTINOUS,           /* Continous bed motion */
 
77
  MDC_CONC_NUM_BED_MOTIONS
 
78
} MdcConcBedMotion;
 
79
 
 
80
typedef enum {
 
81
  MDC_CONC_TX_SRC_UNKNOWN,                 /* Unknown transmission source type */
 
82
  MDC_CONC_TX_SRC_POINT,                   /* Transmission point source */
 
83
  MDC_CONC_TX_SRC_LINE,                    /* transmission line source */
 
84
  MDC_CONC_NUM_TX_SRC_TYPES
 
85
} MdcConcTXSrcTypes;
 
86
 
 
87
typedef enum {
 
88
  MDC_CONC_DATA_UNKNOWN,      /* Unknown data type */
 
89
  MDC_CONC_DATA_SBYTE,        /* Signed 8 bit */
 
90
  MDC_CONC_DATA_SSHORT_LE,    /* Signed 16 bit int, little endian */
 
91
  MDC_CONC_DATA_SINT_LE,      /* Signed 32 bit int, little endian */
 
92
  MDC_CONC_DATA_FLOAT_LE,     /* IEEE Float (32bit), little endian */
 
93
  MDC_CONC_DATA_FLOAT_BE,     /* IEEE Float (32bit), big endian */
 
94
  MDC_CONC_DATA_SSHORT_BE,    /* Signed 16 bit int, big endian */
 
95
  MDC_CONC_DATA_SINT_BE,      /* Signed 32 bit int, big endian */
 
96
  MDC_CONC_NUM_DATA_TYPES
 
97
} MdcConcDataTypes;
 
98
 
 
99
typedef enum {
 
100
  MDC_CONC_ORDER_VIEW,        /* Element/Axis/View/Ring_diff - view mode */
 
101
  MDC_CONC_ORDER_SINOGRAM,    /* Element/View/Axis/Ring_Diff - sinogram mode */
 
102
  MDC_CONC_NUM_ORDER_MODES
 
103
} MdcConcOrderModes;
 
104
 
 
105
typedef enum {
 
106
  MDC_CONC_REBIN_UNKNOWN,     /* Unknown, or no, algorith type */
 
107
  MDC_CONC_REBIN_FULL,        /* Full 3D binning (span and ring difference) */
 
108
  MDC_CONC_REBIN_SINGLE,      /* Single-Slice Rebinning */
 
109
  MDC_CONC_REBIN_FOURIER,     /* Fourier Rebinning */
 
110
  MDC_CONC_NUM_REBIN_TYPES
 
111
} MdcConcRebinTypes;
 
112
 
 
113
typedef enum {
 
114
  MDC_CONC_RECON_UNKNOWN,     /* Unknown, or no, algorithm type */
 
115
  MDC_CONC_RECON_FBP,         /* Filtered Backprojection */
 
116
  MDC_CONC_RECON_OSEM2D,      /* OSEM2d */
 
117
  MDC_CONC_NUM_RECON_TYPES
 
118
} MdcConcReconTypes;
 
119
 
 
120
typedef enum {
 
121
  MDC_CONC_OSEM2D_UNWEIGHTED,   /* Unweighted osem2d reconstruction */
 
122
  MDC_CONC_OSEM2D_ATTENUATION,  /* Attenuation weighted osem2d reconstruction */
 
123
  MDC_CONC_NUM_OSEM2D_TYPES,
 
124
  MDC_CONC_OSEM2D_UNKNOWN
 
125
} MdcConcOSEM2DTypes;
 
126
 
 
127
/* deadtime correction applied to the data set */
 
128
typedef enum {
 
129
  MDC_CONC_DEAD_CORR_NONE,       /* No deadtime correction applied */
 
130
  MDC_CONC_DEAD_CORR_GLOBAL,     /* Global estimate based on singles */
 
131
  MDC_CONC_DEAD_CORR_CMS,        /* CMS estimate based on singles */
 
132
  MDC_CONC_NUM_DEAD_CORR_TYPES
 
133
} MdcConcDeadCorrTypes;
 
134
 
 
135
typedef enum {
 
136
  MDC_CONC_ATTN_CORR_NONE,                        /* No attenuation applied */
 
137
  MDC_CONC_ATTN_CORR_PT_WINDOWED_COINCIDENCE,     /* Point source in windowed TX coincidence */
 
138
  MDC_CONC_ATTN_CORR_PT_SINGLES,                  /* Point source singles based TX */
 
139
  MDC_CONC_ATTN_CORR_SEG_COINCIDENCE,             /* Segmented point src in TX coincidence*/
 
140
  MDC_CONC_ATTN_CORR_SEG_SINGLES,                 /* Segmented point src singles based TX */
 
141
  MDC_CONC_ATTN_CORR_GEOMETRY,                    /* Calculated by geometry */
 
142
  MDC_CONC_ATTN_CORR_NON_BETA_SINGLES,            /* Non-positron source singles based TX */
 
143
  MDC_CONC_ATTN_CORR_PT_NON_WINDOWED_COINCIDENCE, /* Point source in non-windowed TX coincidence */
 
144
  MDC_CONC_NUM_ATTN_CORR_TYPES
 
145
} MdcConcAttnCorrTypes;
 
146
 
 
147
typedef enum {
 
148
  MDC_CONC_SCATTER_CORR_NONE,                     /* No scatter correction applied */
 
149
  MDC_CONC_SCATTER_CORR_TAILS,                    /* Fit of emission tail */
 
150
  MDC_CONC_SCATTER_CORR_MONTE_CARLO,              /* Monte Carlo of emission and transmission data */
 
151
  MDC_CONC_SCATTER_CORR_DIRECT,                   /* Direct calculation from analytical formulas */
 
152
  MDC_CONC_NUM_SCATTER_CORR_TYPES
 
153
} MdcConcScatterCorrTypes;
 
154
 
 
155
 
 
156
typedef enum {
 
157
  MDC_CONC_EVENT_UNKNOWN,        /* Unknown event type */
 
158
  MDC_CONC_EVENT_SINGLES,        /* Singles */
 
159
  MDC_CONC_EVENT_COINCIDENCES,   /* Prompt events (coincidences) */
 
160
  MDC_CONC_EVENT_DELAYS,         /* Delay events */
 
161
  MDC_CONC_EVENT_TRUES,          /* Trues */
 
162
  MDC_CONC_NUM_EVENT_TYPES
 
163
} MdcConcEventTypes;
 
164
 
 
165
typedef enum {
 
166
  MDC_CONC_FILTER_NONE,          /* No filter */
 
167
  MDC_CONC_FILTER_RAMP,          /* Ramp filter (backprojection) or no filter */
 
168
  MDC_CONC_FILTER_BUTTERWORTH_1, /* First-order Butterworth window */
 
169
  MDC_CONC_FILTER_HANNING,       /* Hanning window */
 
170
  MDC_CONC_FILTER_HAMMING,       /* Hamming window */
 
171
  MDC_CONC_FILTER_PARZEN,        /* Parzen window */
 
172
  MDC_CONC_FILTER_SHEPP,         /* Shepp filter */
 
173
  MDC_CONC_FILTER_BUTTERWORTH_2, /* Second-order Butterworth window */
 
174
  MDC_CONC_NUM_FILTER_TYPES
 
175
} MdcConcFilterTypes;
 
176
 
 
177
typedef enum {
 
178
  MDC_CONC_NORM_NONE,            /* No normalization applied */
 
179
  MDC_CONC_NORM_POINT_INVERSE,   /* Point source inversion */
 
180
  MDC_CONC_NORM_POINT_COMPONENT, /* Point source component based */
 
181
  MDC_CONC_NORM_CYL_INVERSE,     /* Cylinder source inversion */
 
182
  MDC_CONC_NORM_CYL_COMPONENT,   /* Cylinder source component based */
 
183
  MDC_CONC_NUM_NORM_TYPES
 
184
} MdcConcNormTypes;
 
185
 
 
186
typedef enum {
 
187
  MDC_CONC_CALIB_UNITS_UNKNOWN,        /* Unknown calibration units */
 
188
  MDC_CONC_CALIB_UNITS_NANOCURIES,     /* nanoCuries/cc */
 
189
  MDC_CONC_CALIB_UNITS_BEQUERELS,      /* bequerels/cc */
 
190
  MDC_CONC_NUM_CALIB_UNITS
 
191
} MdcConcCalibUnits;
 
192
 
 
193
typedef enum {
 
194
  MDC_CONC_DOSE_UNITS_UNKNOWN,        /* Unknown calibration units */
 
195
  MDC_CONC_DOSE_UNITS_MILLICURIES,    /* mCi */
 
196
  MDC_CONC_DOSE_UNITS_MEGA_BEQUERELS, /* MBq */
 
197
  MDC_CONC_NUM_DOSE_UNITS
 
198
} MdcConcDoseUnits;
 
199
 
 
200
typedef enum {
 
201
  MDC_CONC_SUBJECT_ORIENTATION_UNKNOWN,      /* 0 - Unknown subject orientation */
 
202
  MDC_CONC_SUBJECT_ORIENTATION_FEET_PRONE,   /* 1 - Feet first, prone */
 
203
  MDC_CONC_SUBJECT_ORIENTATION_HEAD_PRONE,   /* 2 - Head first, prone */
 
204
  MDC_CONC_SUBJECT_ORIENTATION_FEET_SUPINE, /* 3 - Feet first, supine */
 
205
  MDC_CONC_SUBJECT_ORIENTATION_HEAD_SUPINE, /* 4 - Head first, supine */
 
206
  MDC_CONC_SUBJECT_ORIENTATION_FEET_RIGHT,   /* 5 - Feet first, right */
 
207
  MDC_CONC_SUBJECT_ORIENTATION_HEAD_RIGHT,   /* 6 - Head first, right */
 
208
  MDC_CONC_SUBJECT_ORIENTATION_FEET_LEFT,    /* 7 - Feet first, left */
 
209
  MDC_CONC_SUBJECT_ORIENTATION_HEAD_LEFT,    /* 8 - Head first, left */
 
210
  MDC_CONC_NUM_SUBJECT_ORIENTATIONS
 
211
} MdcConcSubjectOrientation;
 
212
 
 
213
typedef enum {
 
214
  MDC_CONC_LENGTH_UNITS_UNKNOWN,       /* 0 - Unknown length units */
 
215
  MDC_CONC_LENGTH_UNITS_MILLIMETERS,   /* 1 - millimeters */
 
216
  MDC_CONC_LENGTH_UNITS_CENTIMETERS,   /* 2 - centimeters */
 
217
  MDC_CONC_LENGTH_UNITS_INCHES,        /* 3 - inches */
 
218
  MDC_CONC_NUM_LENGTH_UNITS
 
219
} MdcConcLengthUnits;
 
220
 
 
221
typedef enum {
 
222
  MDC_CONC_WEIGHT_UNITS_UNKNOWN,       /* 0 - Unknown weight units */
 
223
  MDC_CONC_WEIGHT_UNITS_GRAMS,         /* 1 - grams */
 
224
  MDC_CONC_WEIGHT_UNITS_OUNCES,        /* 2 - ounces */
 
225
  MDC_CONC_WEIGHT_UNITS_KILOGRAMS,     /* 3 - kilograms */
 
226
  MDC_CONC_WEIGHT_UNITS_POUNDS,        /* 4 - pounds */
 
227
  MDC_CONC_NUM_WEIGHT_UNITS
 
228
} MdcConcWeightUnits;
 
229
 
 
230
/* what can appear in the top of the header */
 
231
typedef enum {
 
232
  /* Version of header parameters (float) */
 
233
  MDC_CONC_HDR_VERSION,
 
234
 
 
235
  /* Scanner model (integer) */
 
236
  MDC_CONC_HDR_MODEL,
 
237
 
 
238
  /* Institution identification (string) */
 
239
  MDC_CONC_HDR_INSTITUTION,
 
240
 
 
241
  /* Study type/description (string) */
 
242
  MDC_CONC_HDR_STUDY,
 
243
 
 
244
  /* Data filename, possibly including path (string) */    
 
245
  /* NOTE: Filename may contain spaces, therefore the ENTIRE */
 
246
  /*       line, up to the EOL, is used after the parameter name. */
 
247
  MDC_CONC_HDR_FILE_NAME,
 
248
 
 
249
  /* Data file type (integer) */
 
250
  /*   0 - Unknown data file type */
 
251
  /*   1 - List mode data file */
 
252
  /*   2 - Sinogram data file */
 
253
  /*   3 - Normalization data file */
 
254
  /*   4 - Attenuation correction data file */
 
255
  /*   5 - Image data file */
 
256
  /*   6 - Blank data file */
 
257
  /*   8 - Mu map data file */
 
258
  MDC_CONC_HDR_FILE_TYPE,
 
259
 
 
260
  /* Acquisition mode (integer) */
 
261
  /* 0 - Unknown acquisition mode */
 
262
  /*   1 - Blank acquisition */
 
263
  /*   2 - Emission acquisition */
 
264
  /*   3 - Dynamic acquisition */
 
265
  /*   4 - Gated acquisition */
 
266
  /*   5 - Continuous bed motion acquisition */
 
267
  /*   6 - Singles transmission acquisition */
 
268
  /*   7 - Windowed coincidence transmission acquisition */
 
269
  /*   8 - Non-windowed coincidence transmission acquisition */
 
270
  MDC_CONC_HDR_ACQUISITION_MODE,               
 
271
 
 
272
  /* Bed motion (integer) */
 
273
  /*   0 - Static or unknown bed motion */
 
274
  /*   1 - Continuous bed motion */
 
275
  MDC_CONC_HDR_BED_MOTION,
 
276
 
 
277
  /* Number of frames in data file (integer) */
 
278
  MDC_CONC_HDR_TOTAL_FRAMES,
 
279
 
 
280
  /* Isotope description (string) */
 
281
  MDC_CONC_HDR_ISOTOPE,
 
282
 
 
283
  /* Isotope half-life, in secs (float) */
 
284
  MDC_CONC_HDR_ISOTOPE_HALF_LIFE,
 
285
 
 
286
  /* Isotope branching fraction (float) */
 
287
  /*   NOTE: Frame scale factor DOES NOT include */
 
288
  /*         isotope branching fraction. */
 
289
  MDC_CONC_HDR_ISOTOPE_BRANCHING_FRACTION,
 
290
 
 
291
  /* Transaxial crystals per block (integer) */
 
292
  MDC_CONC_HDR_TRANSAXIAL_CRYSTALS_PER_BLOCK,
 
293
 
 
294
  /* Axial crystals per block (integer) */
 
295
  MDC_CONC_HDR_AXIAL_CRYSTALS_PER_BLOCK,
 
296
 
 
297
  /* Crystal offset for intrinsic rotation (integer) */
 
298
  MDC_CONC_HDR_INTRINSIC_CRYSTAL_OFFSET,
 
299
 
 
300
  /* Number of transaxial blocks (integer) */
 
301
  MDC_CONC_HDR_TRANSAXIAL_BLOCKS,
 
302
 
 
303
  /* Number of axial blocks (integer) */
 
304
  MDC_CONC_HDR_AXIAL_BLOCKS,
 
305
 
 
306
  /* Transaxial crystal pitch, in cm (float) */
 
307
  MDC_CONC_HDR_TRANSAXIAL_CRYSTAL_PITCH,
 
308
 
 
309
  /* Axial crystal pitch, in cm (float) */
 
310
  MDC_CONC_HDR_AXIAL_CRYSTAL_PITCH,
 
311
  
 
312
  /* Ring radius to crystal face, in cm (float) */
 
313
  MDC_CONC_HDR_RADIUS,
 
314
 
 
315
  /* Radial field-of-view, in cm (float) */
 
316
  MDC_CONC_HDR_RADIAL_FOV,
 
317
 
 
318
  /* (Point) source radius, in cm (float) */
 
319
  MDC_CONC_HDR_PT_SRC_RADIUS, /* deprecated? */
 
320
  MDC_CONC_HDR_SRC_RADIUS,
 
321
 
 
322
  /* Source axial cm per revolution, in cm (float) */
 
323
  MDC_CONC_HDR_SRC_CM_PER_REV,
 
324
 
 
325
  /* Source type (integer) */
 
326
  /* 0 - Unknown TX source type */
 
327
  /* 1 - TX point source */
 
328
  /* 2 - TX line source */
 
329
  MDC_CONC_HDR_TX_SRC_TYPE,
 
330
 
 
331
  /* (Point) source encoder steps per revolution (integer) */
 
332
  MDC_CONC_HDR_PT_SRC_STEPS_PER_REV, /* deprecated? */
 
333
  MDC_CONC_HDR_SRC_STEPS_PER_REV,
 
334
 
 
335
  /* Default number of projections (integer) */
 
336
  MDC_CONC_HDR_DEFAULT_PROJECTIONS,
 
337
 
 
338
  /* Default number of transaxial angles (integer) */
 
339
  MDC_CONC_HDR_DEFAULT_TRANSAXIAL_ANGLES,
 
340
 
 
341
  /* Crystal thickness, in cm (float) */
 
342
  MDC_CONC_HDR_CRYSTAL_THICKNESS,
 
343
 
 
344
  /* Depth of interaction, in cm (float) */
 
345
  MDC_CONC_HDR_DEPTH_OF_INTERACTION,
 
346
 
 
347
  /* Transaxial projection bin size, in cm (float) */
 
348
  MDC_CONC_HDR_TRANSAXIAL_BIN_SIZE,
 
349
 
 
350
  /* Axial plane size, in cm (float) */
 
351
  MDC_CONC_HDR_AXIAL_PLANE_SIZE,
 
352
 
 
353
  /* Lower level energy threshold, in KeV (float) */
 
354
  MDC_CONC_HDR_LLD,
 
355
 
 
356
  /* Upper level energy threshold, in KeV (float) */
 
357
  MDC_CONC_HDR_ULD,
 
358
 
 
359
  /* Coincidence timing window, in nsecs (int) */
 
360
  MDC_CONC_HDR_TIMING_WINDOW,
 
361
 
 
362
  /* Data type (integer) */
 
363
  /*   0 - Unknown data type */
 
364
  /*   1 - Byte (8-bits) data type */
 
365
  /*   2 - 2-byte integer - Little Endian */
 
366
  /*   3 - 4-byte integer - Little Endian */
 
367
  /*   4 - 4-byte IEEE float - Little Endian */
 
368
  /*   5 - 4-byte IEEE float - Big Endian */
 
369
  /*   6 - 2-byte integer - Big Endian */
 
370
  /*   7 - 4-byte integer - Big Endian */
 
371
  MDC_CONC_HDR_DATA_TYPE,                      
 
372
 
 
373
  /* Data order (integer) */
 
374
  /*   0 - Element/Axis/View/Ring_Diff - view mode */
 
375
  /*   1 - Element/View/Axis/Ring_Diff - sinogram mode */
 
376
  /*  NOTE that ElVwAxRd (XYZW) is the data order for images. */
 
377
  /*    ElVwAxRd for images means that Z and Y are flipped. */
 
378
  MDC_CONC_HDR_DATA_ORDER,                     
 
379
 
 
380
  /* Span of data set (integer) */
 
381
  MDC_CONC_HDR_SPAN,
 
382
 
 
383
  /* Maximum ring difference of data set (integer) */
 
384
  MDC_CONC_HDR_RING_DIFFERENCE,
 
385
 
 
386
  /* Number of dimensions in data set (integer) */
 
387
  /*     Order from fastest to slowest is XYZW */
 
388
  MDC_CONC_HDR_NUMBER_OF_DIMENSIONS,
 
389
 
 
390
  /* Size of X dimension in data set (integer) */
 
391
  MDC_CONC_HDR_X_DIMENSION,
 
392
 
 
393
  /* Size of Y dimension in data set (integer) */
 
394
  MDC_CONC_HDR_Y_DIMENSION,
 
395
 
 
396
  /* Size of Z dimension in data set (integer) */
 
397
  MDC_CONC_HDR_Z_DIMENSION,
 
398
 
 
399
  /* Size of W dimension in data set (integer) */
 
400
  MDC_CONC_HDR_W_DIMENSION,
 
401
 
 
402
  /* Size of 'changing' dimension at each step (integer integer) */
 
403
  MDC_CONC_HDR_DELTA_ELEMENTS,
 
404
 
 
405
  /* X filter and/or apodizing windows type (integer) */
 
406
  /*       and cutoff (float) */
 
407
  /*   0 - No filter */
 
408
  /*   1 - Ramp filter (backprojection) or no filter */
 
409
  /*   2 - First-order Butterworth window */
 
410
  /*   3 - Hanning window */
 
411
  /*   4 - Hamming window */
 
412
  /*   5 - Parzen window */
 
413
  /*   6 - Shepp filter */
 
414
  /*   7 - Second-order Butterworth window */
 
415
  /*   NOTE that a cutoff of 0.5 is the Nyquist point */
 
416
  /*     i.e 1.0 / (2.0 * sampling). */
 
417
  /*     Also, the Ramp and Shepp should ONLY be used */
 
418
  /*     for backprojection */
 
419
  MDC_CONC_HDR_X_FILTER,
 
420
 
 
421
  /* Y apodizing filter type (integer) and cutoff (float) */
 
422
  /*   0 - No filter */
 
423
  /*   2 - First-order Butterworth window */
 
424
  /*   3 - Hanning window */
 
425
  /*   4 - Hamming window */
 
426
  /*   5 - Parzen window */
 
427
  /*   7 - Second-order Butterworth window */
 
428
  /*   NOTE that a cutoff of 0.5 is the Nyquist point */
 
429
  /*     i.e 1.0 / (2.0 * sampling). */
 
430
  MDC_CONC_HDR_Y_FILTER,
 
431
 
 
432
  /* Z apodizing filter type (integer) and cutoff (float) */
 
433
  /*   0 - No filter */
 
434
  /*   2 - First-order Butterworth window */
 
435
  /*   3 - Hanning window */
 
436
  /*   4 - Hamming window */
 
437
  /*   5 - Parzen window */
 
438
  /*   7 - Second-order Butterworth window */
 
439
  /*   NOTE that a cutoff of 0.5 is the Nyquist point */
 
440
  /*     i.e 1.0 / (2.0 * sampling). */
 
441
  MDC_CONC_HDR_Z_FILTER,
 
442
 
 
443
  /* Version of histogram program used (float) */
 
444
  MDC_CONC_HDR_HISTOGRAM_VERSION,
 
445
 
 
446
  /* Rebinning type (integer) */
 
447
  /*   0 - Unknown, or no, algorithm type */
 
448
  /*   1 - Full 3D binning (span and ring difference) */
 
449
  /*   2 - Single-Slice Rebinning */
 
450
  /*   3 - Fourier Rebinning */
 
451
  MDC_CONC_HDR_REBINNING_TYPE,
 
452
 
 
453
  /* Version of rebinning program used (float) */
 
454
  MDC_CONC_HDR_REBINNING_VERSION,
 
455
 
 
456
  /* Reconstruction type (integer) */
 
457
  /*   0 - Unknown, or no, algorithm type */
 
458
  /*   1 - Filtered Backprojection */
 
459
  /*   2 - OSEM2d */
 
460
  MDC_CONC_HDR_RECON_ALGORITHM,
 
461
 
 
462
  /* Version of reconstruction program used (float) */
 
463
  MDC_CONC_HDR_RECON_VERSION,
 
464
 
 
465
  /* OSEM2D method (integer) */
 
466
  /* 0 - Unweighted osem2d reconstruction */
 
467
  /* 1 - Attenuation weighted osem2d reconstruction */
 
468
  MDC_CONC_HDR_OSEM2D_METHOD,
 
469
 
 
470
  /* Number of osem2d subsets (integer) */
 
471
  MDC_CONC_HDR_OSEM2D_SUBSETS,
 
472
 
 
473
  /* Number of osem2d iterations (integer) */
 
474
  MDC_CONC_HDR_OSEM2D_ITERATIONS,
 
475
 
 
476
  /* Number of EM iterations after osem2d iterations (integer) */
 
477
  MDC_CONC_HDR_OSEM2D_EM_ITERATIONS,
 
478
 
 
479
  /* Epsilon and power values for map regularization (float integer) */
 
480
  MDC_CONC_HDR_OSEM2D_MAP,
 
481
 
 
482
  /* Large object osem2d x_offset in cm (float) */
 
483
  MDC_CONC_HDR_OSEM2D_X_OFFSET,
 
484
 
 
485
  /* Large object osem2d y_offset in cm (float) */
 
486
  MDC_CONC_HDR_OSEM2D_Y_OFFSET,
 
487
 
 
488
  /* Large object osem2d zoom (float) */
 
489
  MDC_CONC_HDR_OSEM2D_ZOOM,
 
490
 
 
491
  /* Deadtime correction applied to data set (integer) */
 
492
  /*   0 - No deadtime correction applied */
 
493
  /*   1 - Global estimate based on singles */
 
494
  /*   2 - CMS estimate based on singles */
 
495
  MDC_CONC_HDR_DEADTIME_CORRECTION_APPLIED,
 
496
 
 
497
  /* Decay correction applied to data set (integer) */
 
498
  /*     0 (FALSE) - Decay correction has NOT been applied */
 
499
  /*     !0 (TRUE) - Decay correction has been applied */
 
500
  MDC_CONC_HDR_DECAY_CORRECTION_APPLIED,
 
501
 
 
502
  /* Normalization applied to data set (integer) */
 
503
  /*   0 - No normalization applied */
 
504
  /*   1 - Point source inversion */
 
505
  /*   2 - Point source component based */
 
506
  /*   3 - Cylinder source inversion */
 
507
  /*   4 - Cylinder source component based */
 
508
  MDC_CONC_HDR_NORMALIZATION_APPLIED,
 
509
 
 
510
  /* Normalization filename, possibly including path (string) */
 
511
  /*    NOTE: Filename may contain spaces, therefore the ENTIRE */
 
512
  /*          line, up to the EOL, is used after the parameter name. */
 
513
  MDC_CONC_HDR_NORMALIZATION_FILENAME,
 
514
 
 
515
  /* Attenuation applied to data set (integer) */
 
516
  /*   0 - No attenuation applied */
 
517
  /*   1 - Point source in windowed TX coincidence */
 
518
  /*   2 - Point source singles based TX */
 
519
  /*   3 - Segmented point source in TX coincidence */
 
520
  /*   4 - Segmented point source singles based TX */
 
521
  /*   5 - Calculated by geometry */
 
522
  /*   6 - Non-positron source singles based TX */
 
523
  /*   7 - Point source in non-windowed TX coincidence */
 
524
  MDC_CONC_HDR_ATTENUATION_APPLIED,
 
525
 
 
526
  /* Scatter correction applied to data set (integer) */
 
527
  /*   0 - No scatter correction applied */
 
528
  /*   1 - Fit of emission tail */
 
529
  /*   2 - Monte Carlo of emission and transmission data */
 
530
  /*   3 - Direct calculation from analytical formulas */
 
531
  MDC_CONC_HDR_SCATTER_CORRECTION,
 
532
 
 
533
  /* Version of scatter program used (float) */
 
534
  MDC_CONC_HDR_SCATTER_VERSION,
 
535
 
 
536
  /* Arc correction applied to data set (integer) */
 
537
  /*     0 (FALSE) - Arc correction has NOT been applied */
 
538
  /*     !0 (TRUE) - Arc correction has been applied */
 
539
  MDC_CONC_HDR_ARC_CORRECTION_APPLIED,
 
540
 
 
541
  /* Rotation, in degrees, applied to data set (float) */
 
542
  MDC_CONC_HDR_ROTATION,
 
543
 
 
544
  /* X offset, in cm, applied to data set (float) */
 
545
  MDC_CONC_HDR_X_OFFSET,
 
546
 
 
547
  /* Y offset, in cm, applied to data set (float) */
 
548
  MDC_CONC_HDR_Y_OFFSET,
 
549
 
 
550
  /* Z offset, in cm, applied to data set (float) */
 
551
  MDC_CONC_HDR_Z_OFFSET,
 
552
 
 
553
  /* Zoom applied to data set (float) */
 
554
  MDC_CONC_HDR_ZOOM,
 
555
 
 
556
  /* Reconstructed pixel size, in cm (float) */
 
557
  /*     NOTE: pixel_size = (((X_crystal_pitch / 2.0) * X_dim) / */
 
558
  /*           (image_size * zoom)) * (effective_radius / radius) */
 
559
  MDC_CONC_HDR_PIXEL_SIZE,
 
560
 
 
561
  /* Calibration units (integer) */
 
562
  /*   0 - Unknown calibration units */
 
563
  /*   1 - nanoCuries/cc */
 
564
  /*   2 - bequerels/cc */
 
565
  MDC_CONC_HDR_CALIBRATION_UNITS,
 
566
 
 
567
  /* Calibration factor (float) */
 
568
  /*   NOTE: Frame scale factor DOES NOT include calibration factor. */
 
569
  MDC_CONC_HDR_CALIBRATION_FACTOR,
 
570
 
 
571
  /* Calibration source branching fraction (float) */
 
572
  /* NOTE: Frame scale factor DOES NOT include
 
573
   *       calibration source branching fraction.  */
 
574
  MDC_CONC_HDR_CALIBRATION_BRANCHING_FRACTION,
 
575
 
 
576
  /* Number of singles rates in subheader (integer) */
 
577
  /*   NOTE: This normally is the number of blocks. */
 
578
  MDC_CONC_HDR_NUMBER_OF_SINGLES_RATES,
 
579
 
 
580
  /* Investigator identification (string) */
 
581
  MDC_CONC_HDR_INVESTIGATOR,
 
582
 
 
583
  /* Operator identification (string) */
 
584
  MDC_CONC_HDR_OPERATOR,
 
585
 
 
586
  /* Study identification (string) */
 
587
  MDC_CONC_HDR_STUDY_IDENTIFIER,
 
588
 
 
589
  /* Scan start date and time (string) */
 
590
  /* Format is: Sun Sep 16 01:03:52 1973 */
 
591
  MDC_CONC_HDR_SCAN_TIME,
 
592
 
 
593
  /* Injected compound (string) */
 
594
  MDC_CONC_HDR_INJECTED_COMPOUND,
 
595
 
 
596
  /* Dose units (integer) */
 
597
  /* 0 - Unknown dose units */
 
598
  /* 1 - mCi */
 
599
  /* 2 - MBq */
 
600
  MDC_CONC_HDR_DOSE_UNITS,
 
601
 
 
602
  /* Injected dose (float) */
 
603
  MDC_CONC_HDR_INJECTED_DOSE,
 
604
 
 
605
  /* Injection date and time (string) */
 
606
  /* Format is: Sun Sep 16 01:03:52 1973 */
 
607
  MDC_CONC_HDR_INJECTION_TIME,
 
608
 
 
609
  /* Injection decay correction factor (float) */
 
610
  /* NOTE: Frame scale factor and decay correction factor */
 
611
  /* DO NOT include injection decay correction factor. */
 
612
  MDC_CONC_HDR_INJECTION_DECAY_CORRECTION,
 
613
 
 
614
  /* Number of gating inputs in study (integer) */
 
615
  /* NOTE: This is ONLY present when gating inputs are present. */
 
616
  MDC_CONC_HDR_GATE_INPUTS,
 
617
 
 
618
  /* Gate input bins per cycle and gate input range array (integer  integer  float   float) */
 
619
  /* NOTE: This is ONLY present when gating inputs are present. */
 
620
  /* If the minimum/maximum gate input ranges are < 0.0, all values up to or below are accepted. */
 
621
  /* If they are NOT present, all values are accepted. */
 
622
  /* gate_input    gate_bins/cycle    minimum gate cycle (secs)   maximum gate cycle (secs) */
 
623
  MDC_CONC_HDR_GATE_BINS,
 
624
 
 
625
  /* Gate input description (integer  string) */
 
626
  /* NOTE: This is ONLY present when gating inputs are present. */
 
627
  /* gate_input    gate_description */
 
628
  MDC_CONC_HDR_GATE_DESCRIPTION,
 
629
 
 
630
  /* Subject identifier (string) */
 
631
  MDC_CONC_HDR_SUBJECT_IDENTIFIER,
 
632
 
 
633
  /* Subject genus (string) */
 
634
  MDC_CONC_HDR_SUBJECT_GENUS,
 
635
 
 
636
  /* Subject orientation (integer) */
 
637
  /* 0 - Unknown subject orientation */
 
638
  /* 1 - Feet first, prone */
 
639
  /* 2 - Head first, prone */
 
640
  /* 3 - Feet first, supine */
 
641
  /* 4 - Head first, supine */
 
642
  /* 5 - Feet first, right */
 
643
  /* 6 - Head first, right */
 
644
  /* 7 - Feet first, left */
 
645
  /* 8 - Head first, left */
 
646
  MDC_CONC_HDR_SUBJECT_ORIENTATION,
 
647
 
 
648
  /* Length units (integer) */
 
649
  /* 0 - Unknown length units */
 
650
  /* 1 - millimeters */
 
651
  /* 2 - centimeters */
 
652
  /* 3 - inches */
 
653
  MDC_CONC_HDR_SUBJECT_LENGTH_UNITS,
 
654
 
 
655
  /* Subject length (float) */
 
656
  MDC_CONC_HDR_SUBJECT_LENGTH,
 
657
 
 
658
  /* Weight units (integer) */
 
659
  /* 0 - Unknown weight units */
 
660
  /* 1 - grams */
 
661
  /* 2 - ounces */
 
662
  /* 3 - kilograms */
 
663
  /* 4 - pounds */
 
664
  MDC_CONC_HDR_SUBJECT_WEIGHT_UNITS,
 
665
 
 
666
  /* Subject weight (float) */
 
667
  MDC_CONC_HDR_SUBJECT_WEIGHT,
 
668
 
 
669
  /* Subject phenotype (string) */
 
670
  MDC_CONC_HDR_SUBJECT_PHENOTYPE,
 
671
 
 
672
  /* Study model (string) */
 
673
  MDC_CONC_HDR_STUDY_MODEL,
 
674
 
 
675
  /* Subject anesthesia (string) */
 
676
  MDC_CONC_HDR_ANESTHESIA,
 
677
 
 
678
  /* Subject analgesia (string) */
 
679
  MDC_CONC_HDR_ANALGESIA,
 
680
  
 
681
  /* Other drugs (string) */
 
682
  MDC_CONC_HDR_OTHER_DRUGS,
 
683
 
 
684
  /* Food access (string) */
 
685
  MDC_CONC_HDR_FOOD_ACCESS,
 
686
 
 
687
  /* Water access (string) */
 
688
  MDC_CONC_HDR_WATER_ACCESS,
 
689
 
 
690
  /* End of Header indicator */
 
691
  MDC_CONC_HDR_END_OF_HEADER,
 
692
 
 
693
  MDC_CONC_NUM_HDR_VALUES,
 
694
  MDC_CONC_HDR_UNKNOWN,
 
695
  MDC_CONC_HDR_EOF
 
696
} MdcConcHdrValue;
 
697
 
 
698
/* what can appear in the bottom of the header */
 
699
typedef enum {
 
700
  /* Frame number (integer) */
 
701
  MDC_CONC_BLOCK_FRAME,
 
702
 
 
703
  /* Event type (integer) */
 
704
  /*   0 - Unknown event type */
 
705
  /*   1 - Singles */
 
706
  /*   2 - Prompt events (coincidences) */
 
707
  /*   3 - Delay events */
 
708
  /*   4 - Trues (prompts - delays) */
 
709
  MDC_CONC_BLOCK_EVENT_TYPE,
 
710
 
 
711
  /* Gate number (integer) */
 
712
  MDC_CONC_BLOCK_GATE,
 
713
 
 
714
  /* Bed number (integer) */
 
715
  MDC_CONC_BLOCK_BED,
 
716
 
 
717
  /* Bed offset, in cm (float) */
 
718
  MDC_CONC_BLOCK_BED_OFFSET,
 
719
 
 
720
  /* Ending horizontal bed offset, in cm (float) */
 
721
  MDC_CONC_BLOCK_ENDING_BED_OFFSET,
 
722
 
 
723
  /* Vertical bed offset, in cm (float) */
 
724
  MDC_CONC_BLOCK_VERTICAL_BED_OFFSET,
 
725
 
 
726
  /* Data file offset to start of data (2 longs) */
 
727
  /* Values are: low_part */
 
728
  /*         or: high_part low_part */
 
729
  MDC_CONC_BLOCK_DATA_FILE_POINTER,
 
730
 
 
731
  /* Frame start time, in secs (float) */
 
732
  MDC_CONC_BLOCK_FRAME_START,
 
733
  
 
734
/* Frame duration, in secs (float) */
 
735
  MDC_CONC_BLOCK_FRAME_DURATION,
 
736
 
 
737
  /* Scale factor for data set (float) */
 
738
  MDC_CONC_BLOCK_SCALE_FACTOR,
 
739
 
 
740
  /* Minimum value in data set (float) */
 
741
  MDC_CONC_BLOCK_MINIMUM,
 
742
 
 
743
  /* Maximum value in data set (float) */
 
744
  MDC_CONC_BLOCK_MAXIMUM,
 
745
 
 
746
  /* Deadtime correction for data set (float) */
 
747
  /*             NOTE: Scale factor INCLUDES this value. */
 
748
  MDC_CONC_BLOCK_DEADTIME_CORRECTION,
 
749
 
 
750
  /* Global decay correction applied to data set (float) */
 
751
  /*     NOTE: Scale factor INCLUDES this value. */
 
752
  MDC_CONC_BLOCK_DECAY_CORRECTION,
 
753
 
 
754
  /* Prompts count for data set (long) */
 
755
  MDC_CONC_BLOCK_PROMPTS,
 
756
 
 
757
  /* Delays count for data set (long) */
 
758
  MDC_CONC_BLOCK_DELAYS,
 
759
 
 
760
  /* Trues count for data set (long) */
 
761
  MDC_CONC_BLOCK_TRUES,
 
762
 
 
763
  /* Prompts countrate per sec before histogramming (int) */
 
764
  MDC_CONC_BLOCK_PROMPTS_RATE,
 
765
 
 
766
  /* Delays countrate per sec before histogramming (int) */
 
767
  MDC_CONC_BLOCK_DELAYS_RATE,
 
768
 
 
769
  /* Singles rate array (integer float) */
 
770
  /*       block_number    singles/sec */
 
771
  MDC_CONC_BLOCK_SINGLES,
 
772
 
 
773
  /* End of Header indicator */
 
774
  MDC_CONC_BLOCK_END_OF_HEADER,
 
775
 
 
776
  MDC_CONC_NUM_BLOCK_VALUES,
 
777
  MDC_CONC_BLOCK_UNKNOWN,
 
778
  MDC_CONC_BLOCK_EOF
 
779
} MdcConcBlockValue;
 
780
 
 
781
 
 
782
 
 
783
/****************************************************************************
 
784
                            F U N C T I O N S
 
785
****************************************************************************/
 
786
 
 
787
const char *MdcLoadPlaneCONC(FILEINFO *fi, int img);
 
788
const char *MdcLoadHeaderCONC(FILEINFO *fi);
 
789
const char *MdcLoadCONC(FILEINFO *fi);
 
790
const char *MdcSavePlaneCONC(FILEINFO *fi, int img);
 
791
const char *MdcSaveHeaderCONC(FILEINFO *fi);
 
792
const char *MdcSaveCONC(FILEINFO *fi);
 
793
 
 
794
int MdcCheckCONC(FILEINFO *fi);
 
795
const char *MdcReadCONC(FILEINFO *fi);
 
796
const char *MdcWriteCONC(FILEINFO *fi);
 
797
 
 
798
#endif
 
799