TPCCLIB
Loading...
Searching...
No Matches
imghead.c
Go to the documentation of this file.
1
9/*****************************************************************************/
10#include "tpcclibConfig.h"
11/*****************************************************************************/
12#include <stdio.h>
13#include <stdlib.h>
14#include <math.h>
15#include <string.h>
16#include <unistd.h>
17#include <time.h>
18/*****************************************************************************/
19#include "libtpcmisc.h"
20#include "libtpcimgio.h"
21#include "libtpccurveio.h"
22#include "libtpcimgp.h"
23#include "libtpcmodext.h"
24/*****************************************************************************/
25
26/*****************************************************************************/
27static char *info[] = {
28 "Program calculates the average TAC from all pixels in a PET image or scan",
29 "file in ECAT 6.3 or 7 format, or PET image in NIfTI-1 or Analyze format,",
30 "to be used as 'head curve' or 'count-rate' file in time delay correction.",
31 "Decay correction is not changed: if image or sinogram is decay corrected,",
32 "head curve will be decay corrected, and vice versa.",
33 " ",
34 "Usage: @P [Options] petfile headcurve",
35 " ",
36 "Options:",
37 " -thr[=<Threshold-%>,<<Nr of frames>|<a>|<fh>>]",
38 " TAC is calculated from pixels exceeding the specified threshold level,",
39 " or 10% level with only -thr.",
40 " Specified number or default five last frames are used in determining",
41 " threshold level; alternatively, with 'a' all frames, or with 'fh'",
42 " the first half of frames are used in thresholding.",
43 " Without -thr option all pixels are included.",
44 " -min | -sec",
45 " TAC times are written in minutes or seconds (default).",
46 " -keepnegat",
47 " Frames with negative mean value are not set to zero.",
48 " -sum | -cps | -peakmax | -framemax",
49 " By default, mean of all or thresholded pixels is calculated;",
50 " with option -sum the sum of pixel values is reported, or",
51 " with option -cps the total radioactivity (not concentration), or",
52 " with option -peakmax the TAC of pixel which has the max peak value, or",
53 " with option -framemax the TAC with values of max at each frame.",
54 " -stdoptions", // List standard options like --help, -v, etc
55 " ",
56 "Example:",
57 " @P -thr=10,5 ub6789dy1.v ub6789head.tac",
58 " ",
59 "See also: eframe, pxl2tac, img2dft, tocr, fitdelay, tac2svg, tacformat",
60 " ",
61 "Keywords: image, time delay, count-rate, head-curve, input, TAC",
62 0};
63/*****************************************************************************/
64
65/*****************************************************************************/
66/* Turn on the globbing of the command line, since it is disabled by default in
67 mingw-w64 (_dowildcard=0); in MinGW32 define _CRT_glob instead, if necessary;
68 In Unix&Linux wildcard command line processing is enabled by default. */
69/*
70#undef _CRT_glob
71#define _CRT_glob -1
72*/
73int _dowildcard = -1;
74/*****************************************************************************/
75
76/*****************************************************************************/
80int main(int argc, char **argv)
81{
82 int ai, help=0, version=0, verbose=1;
83 int ret, fi, n;
84 int timeunit=TUNIT_SEC;
85 int keepnegat=0;
86 int calcsum=0; /* 0=avg of voxels; 1=sum of voxels;
87 2=multiplied by volume of included voxels */
88 int maxpix=0; /* 0=avg; 1=peakmax; 2=framemax */
89 int first, last, thr_nr=0;
90 char petfile[FILENAME_MAX], headfile[FILENAME_MAX], *cptr;
91 IMG img;
92 DFT dft;
93 float threshold=0.0, thr_value;
94
95
96 /*
97 * Get arguments
98 */
99 if(argc==1) {tpcPrintUsage(argv[0], info, stderr); return(1);}
100 petfile[0]=headfile[0]=(char)0;
101 /* Options */
102 for(ai=1; ai<argc; ai++) if(*argv[ai]=='-') { /* options */
103 cptr=argv[ai]+1; if(*cptr=='-') cptr++; if(cptr==NULL) continue;
104 if(tpcProcessStdOptions(argv[ai], &help, &version, &verbose)==0) continue;
105 if(strcasecmp(cptr, "SUM")==0) { // must be before -s[ec]
106 calcsum=1; continue;
107 } else if(strcasecmp(cptr, "CPS")==0) {
108 calcsum=2; continue;
109 } else if(strncasecmp(cptr, "MIN", 1)==0) {
110 timeunit=TUNIT_MIN; continue;
111 } else if(strncasecmp(cptr, "SEC", 1)==0) {
112 timeunit=TUNIT_SEC; continue;
113 } else if(strcasecmp(cptr, "THR")==0) {
114 threshold=0.10; thr_nr=5; continue;
115 } else if(strncasecmp(cptr, "THR=", 4)==0) {
116 /* do not use atof_dpi() here */
117 cptr+=4; threshold=0.01*atof(cptr);
118 while(*cptr && *cptr!=',') cptr++;
119 if(*cptr==',') {
120 cptr++;
121 if(strcasecmp(cptr, "A")==0) thr_nr=-1;
122 else if(strcasecmp(cptr, "FH")==0) thr_nr=-2;
123 else thr_nr=atoi(cptr);
124 }
125 if(thr_nr!=0 && threshold>=0.0 && threshold<1.0) continue;
126 } else if(strncasecmp(cptr, "KEEPNEGAT", 4)==0) {
127 keepnegat=1; continue;
128 } else if(strncasecmp(cptr, "PEAKMAX", 4)==0) {
129 maxpix=1; continue;
130 } else if(strncasecmp(cptr, "FRAMEMAX", 5)==0) {
131 maxpix=2; continue;
132 }
133 /* We should not be here */
134 fprintf(stderr, "Error: invalid option '%s'.\n", argv[ai]);
135 return(1);
136 } else break;
137
138 /* Print help or version? */
139 if(help==2) {tpcHtmlUsage(argv[0], info, ""); return(0);}
140 if(help) {tpcPrintUsage(argv[0], info, stdout); return(0);}
141 if(version) {tpcPrintBuild(argv[0], stdout); return(0);}
142
143 /* Process other arguments, starting from the first non-option */
144 if(ai<argc) {strlcpy(petfile, argv[ai], FILENAME_MAX); ai++;}
145 if(ai<argc) {strlcpy(headfile, argv[ai], FILENAME_MAX); ai++;}
146 if(ai<argc) {fprintf(stderr, "Error: too many arguments.\n"); return(1);}
147
148 /* Is something missing or wrong? */
149 if(!headfile[0]) {
150 fprintf(stderr, "Error: missing command-line argument; use option --help\n");
151 return(1);
152 }
153 if(strcasecmp(petfile, headfile)==0) {
154 fprintf(stderr, "Error: check the output filename.\n");
155 return(1);
156 }
157 if(maxpix>0) {
158 if(calcsum>0) fprintf(stderr, "Warning: options -sum and -cps ignored.\n");
159 calcsum=0;
160 }
161
162 /* In verbose mode print arguments and options */
163 if(verbose>1) {
164 printf("petfile := %s\n", petfile);
165 printf("headfile := %s\n", headfile);
166 printf("threshold := %g%%\n", 100.*threshold);
167 printf("thr_nr := %d\n", thr_nr);
168 printf("keepnegat := %d\n", keepnegat);
169 printf("calcsum := %d\n", calcsum);
170 printf("maxpix := %d\n", maxpix);
171 printf("timeunit := %d\n", timeunit);
172 }
173
174
175
176 /*
177 * Read the contents of the PET file to img data structure
178 */
179 imgInit(&img);
180 if(verbose>0) printf("reading %s\n", petfile);
181 ret=imgRead(petfile, &img);
182 if(ret) {
183 fprintf(stderr, "Error: %s\n", img.statmsg);
184 if(verbose>1) printf("ret=%d\n", ret);
185 imgEmpty(&img); return(2);
186 }
187 if(imgNaNs(&img, 1)>0)
188 if(verbose>0) fprintf(stderr, "Warning: missing pixel values.\n");
189
190 /* For raw data, divide counts by frame duration */
191 ret=imgRawCountsPerTime(&img, 1);
192 if(ret) {
193 fprintf(stderr, "Error: cannot correct sinogram counts.\n");
194 if(verbose>1) printf("ret=%d\n", ret);
195 imgEmpty(&img); return(2);
196 }
197
198 /*
199 * Prepare the place for head TAC
200 */
201 if(verbose>1) printf("preparing head TAC\n");
202 dftInit(&dft);
203 /* Allocate memory for TAC */
204 ret=dftAllocateWithIMG(&dft, 1, &img);
205 if(ret) {
206 fprintf(stderr, "Error: cannot allocate memory for head TAC.\n");
207 imgEmpty(&img);
208 return(3);
209 }
210 /* Set DFT information */
211 /* File format based on filename */
212 {
213 char *p; p=strrchr(headfile, '.');
214 if(strcasecmp(p, ".dft")==0) dft._type=DFT_FORMAT_STANDARD;
215 else if(strcasecmp(p, ".tac")==0) dft._type=DFT_FORMAT_PMOD;
216 else if(strcasecmp(p, ".bld")==0) dft._type=DFT_FORMAT_PMOD;
217 else if(strcasecmp(p, ".csv")==0) dft._type=DFT_FORMAT_CSV_UK;
218 else if(strcasecmp(p, ".cr")==0) dft._type=DFT_FORMAT_PLAIN;
219 else if(strcasecmp(p, ".head")==0) dft._type=DFT_FORMAT_PLAIN;
220 else dft._type=DFT_FORMAT_PLAIN;
221 }
222 /* Set studynumber */
223 if(strlen(dft.studynr)==0) studynr_from_fname2(petfile, dft.studynr, 1);
224 if(verbose>1) printf("studynr := %s\n", dft.studynr);
225 /* Set calibration unit */
226 if(calcsum==2) { // change from concentration to dose
227 int unit;
228 unit=petCunitId(dft.unit);
229 if(verbose>1) printf("original unit := %s\n", petCunit(unit));
230 if(unit==CUNIT_BQ_PER_ML) unit=CUNIT_BQ;
231 else if(unit==CUNIT_KBQ_PER_ML) unit=CUNIT_KBQ;
232 else if(unit==CUNIT_MBQ_PER_ML) unit=CUNIT_MBQ;
233 else if(unit==CUNIT_NCI_PER_ML) unit=CUNIT_NCI;
234 else if(unit==CUNIT_UCI_PER_ML) unit=CUNIT_UCI;
235 else unit=CUNIT_UNKNOWN;
236 strcpy(dft.unit, petCunit(unit));
237 if(verbose>1) printf("count unit := %s\n", dft.unit);
238 }
239 /* Set TAC frame times */
240 if(verbose>2) printf("setting TAC times\n");
243 dft.timeunit=timeunit;
244 if(timeunit==TUNIT_MIN) {
245 for(int i=0; i<dft.frameNr; i++) {
246 /* these all must be set even if timetype==0, they are used below */
247 dft.x1[i]/=60.0; dft.x2[i]/=60.0; dft.x[i]/=60.0;
248 }
249 }
250 /* Set TAC name */
251 if(verbose>2) printf("setting TAC names\n");
252 strcpy(dft.voi[0].name, "Head");
253 strcpy(dft.voi[0].voiname, "Head");
254 strcpy(dft.voi[0].hemisphere, ".");
255 strcpy(dft.voi[0].place, "All");
256 /* Set scan start time */
258 /* Radiopharmaceutical and isotope */
259 if(verbose>5) printf("radiopharmaceutical := '%s'\n", img.radiopharmaceutical);
262 if(verbose>5) printf("isotope := '%s'\n", imgIsotope(&img));
263 strcpy(dft.isotope, imgIsotope(&img));
264
265
266 /*
267 * Calculate the size of one voxel (mL = cc)
268 */
269 float pxlvol=1.0;
270 if(img.sizex>0.0) pxlvol*=0.1*img.sizex;
271 if(img.sizey>0.0) pxlvol*=0.1*img.sizey;
272 if(img.sizez>0.0) pxlvol*=0.1*img.sizez;
273 if(verbose>1) printf("pxlvol := %g cc\n", pxlvol);
274
275
276 /*
277 * Calculate head TAC
278 */
279 if(verbose>0) fprintf(stdout, "calculating head curve\n");
280 if(thr_nr==0) {
281 if(verbose>1) fprintf(stdout, "no thresholding\n");
282 if(maxpix==0) {
283 if(verbose>1) fprintf(stdout, "computing mean of pixels\n");
284 ret=imgAverageTAC(&img, img.sd);
285 if(ret) {
286 fprintf(stderr, "Error: cannot calculate average TAC.\n");
287 if(verbose>1) printf("ret := %d\n", ret);
288 imgEmpty(&img); dftEmpty(&dft);
289 return(4);
290 }
291 /* multiply average with pixel number, if required */
292 if(calcsum!=0) {
293 n=img.dimx*img.dimy*img.dimz;
294 if(verbose>2) printf("sum of %d pixels\n", n);
295 for(fi=0; fi<img.dimt; fi++) img.sd[fi]*=(float)n;
296 }
297 /* Multiply sum with the volume of one pixel, if required */
298 if(calcsum==2) for(fi=0; fi<img.dimt; fi++) img.sd[fi]*=pxlvol;
299 } else if(maxpix==1) {
300 if(verbose>1) fprintf(stdout, "searching max peak\n");
301 IMG_PIXEL pxl;
302 ret=imgGetPeak(&img, img.end[img.dimt-1], &pxl, verbose-6);
303 if(ret) {
304 fprintf(stderr, "Error: cannot find peak value in image.\n");
305 if(verbose>1) printf("ret := %d\n", ret);
306 imgEmpty(&img); dftEmpty(&dft);
307 return(4);
308 }
309 if(verbose>1)
310 printf("image max at [%d,%d,%d,%d]\n", pxl.x, pxl.y, pxl.z, pxl.f);
311 for(fi=0; fi<img.dimt; fi++)
312 img.sd[fi]=img.m[pxl.z-1][pxl.y-1][pxl.x-1][fi];
313 } else {
314 if(verbose>1) fprintf(stdout, "searching max for each frame\n");
315 float tmp; ret=0;
316 for(fi=0; fi<img.dimt && ret==0; fi++)
317 ret=imgFrameMinMax(&img, fi+1, &tmp, img.sd+fi);
318 if(ret) {
319 fprintf(stderr, "Error: cannot find frame max in image.\n");
320 if(verbose>1) printf("ret := %d\n", ret);
321 imgEmpty(&img); dftEmpty(&dft);
322 return(4);
323 }
324 }
325 } else { /* only thresholded pixels */
326 /* Determine which frames to use in thresholding */
327 if(thr_nr>0) {
328 last=img.dimt-1; first=1+last-thr_nr; if(first<0) first=0;
329 } else if(thr_nr==-2) {
330 last=(img.dimt-1)/2; first=0;
331 } else {
332 first=0; last=img.dimt-1;
333 }
334 if(verbose>1) {
335 printf("calculating sum image from frames %d-%d\n", first+1, last+1);
336 if(img.dimt>=last+2) printf("excluding frames %d-%d\n", last+2, img.dimt);
337 else printf("all frames included\n");
338 }
339 /* Calculate integral image */
340 IMG iimg, timg;
341 imgInit(&iimg); imgInit(&timg);
342 ret=imgFrameIntegral(&img, first, last, &iimg, verbose-4);
343 if(ret) {
344 fprintf(stderr, "Error: cannot calculate sum image (%d).\n", ret);
345 imgEmpty(&img); dftEmpty(&dft); imgEmpty(&iimg);
346 return(5);
347 }
348 /* Search for the maximum value in integral image */
349 if(verbose>2) printf("searching for maximum integral\n");
350 ret=imgMax(&iimg, &thr_value);
351 if(verbose>1) printf("maximum integral value := %g\n", thr_value);
352 thr_value*=threshold;
353 /* Make a template image */
354 if(verbose>1) printf("making a template image with threshold %g\n", thr_value);
355 ret=imgThresholdMask(&iimg, thr_value, 1.0e+38, &timg);
356 if(ret) {
357 fprintf(stderr, "Error (%d): cannot threshold.\n", ret);
358 imgEmpty(&img); dftEmpty(&dft); imgEmpty(&iimg); imgEmpty(&timg);
359 return(6);
360 }
361 timg._fileFormat=IMG_E7;
362 if(verbose>22) {
363 printf("First frame values of the thresholded pixels:\n");
364 int xx, yy, zz;
365 for(zz=0; zz<timg.dimz; zz++) for(yy=0; yy<timg.dimy; yy++)
366 for(xx=0; xx<timg.dimx; xx++) if(timg.m[zz][yy][xx][0]>0) {
367 printf(" v[%d][%d][%d] := %g\n", zz, yy, xx, img.m[zz][yy][xx][0]);
368 }
369 }
370 imgEmpty(&iimg); /* sum image is not needed anymore */
371 if(verbose>20) {
372 ret=imgWrite("template.v", &timg);
373 if(ret==0) printf("template.v image saved for testing\n");
374 else fprintf(stderr, "template.v image could not be saved for testing\n");
375 }
376 if(maxpix==0) {
377 if(verbose>1) fprintf(stdout, "computing mean of pixels\n");
378 /* Calculate average curve based on the template */
379 ret=imgAverageMaskTAC(&img, &timg, img.sd);
380 if(ret) {
381 fprintf(stderr, "Error: cannot calculate average TAC (%d).\n", ret);
382 imgEmpty(&img); dftEmpty(&dft); imgEmpty(&timg);
383 return(7);
384 }
385 /* multiply average with pixel number, if required */
386 if(calcsum!=0) {
387 long long n=0;
388 int xx, yy, zz;
389 for(zz=0; zz<timg.dimz; zz++) for(yy=0; yy<timg.dimy; yy++)
390 for(xx=0; xx<timg.dimx; xx++) if(timg.m[zz][yy][xx][0]>0) n++;
391 if(verbose>1) printf("sum of %lld thresholded pixels\n", n);
392 for(int i=0; i<img.dimt; i++) img.sd[i]*=(float)n;
393 }
394 /* Multiply sum with the volume of one pixel, if required */
395 if(calcsum==2) for(int i=0; i<img.dimt; i++) img.sd[i]*=pxlvol;
396 } else if(maxpix==1) {
397 if(verbose>1) fprintf(stdout, "searching max peak\n");
398 int xx, yy, zz;
399 for(zz=0; zz<timg.dimz; zz++)
400 for(yy=0; yy<timg.dimy; yy++)
401 for(xx=0; xx<timg.dimx; xx++) if(timg.m[zz][yy][xx][0]<0.0001)
402 for(int i=0; i<img.dimt; i++) img.sd[i]=0.0;
403 IMG_PIXEL pxl;
404 ret=imgGetPeak(&img, img.end[img.dimt-1], &pxl, verbose-6);
405 if(ret) {
406 fprintf(stderr, "Error: cannot find peak value in image.\n");
407 if(verbose>1) printf("ret := %d\n", ret);
408 imgEmpty(&img); dftEmpty(&dft); imgEmpty(&timg);
409 return(4);
410 }
411 if(verbose>1)
412 printf("image max at [%d,%d,%d,%d]\n", pxl.x, pxl.y, pxl.z, pxl.f);
413 for(fi=0; fi<img.dimt; fi++)
414 img.sd[fi]=img.m[pxl.z-1][pxl.y-1][pxl.x-1][fi];
415 } else {
416 if(verbose>1) fprintf(stdout, "searching max for each frame\n");
417 int xx, yy, zz;
418 for(zz=0; zz<timg.dimz; zz++)
419 for(yy=0; yy<timg.dimy; yy++)
420 for(xx=0; xx<timg.dimx; xx++) if(timg.m[zz][yy][xx][0]<0.0001)
421 for(int i=0; i<img.dimt; i++) img.sd[i]=0.0;
422 float tmp; ret=0;
423 for(fi=0; fi<img.dimt && ret==0; fi++)
424 ret=imgFrameMinMax(&img, fi+1, &tmp, img.sd+fi);
425 if(ret) {
426 fprintf(stderr, "Error: cannot find frame max in image.\n");
427 if(verbose>1) printf("ret := %d\n", ret);
428 imgEmpty(&img); dftEmpty(&dft); imgEmpty(&timg);
429 return(4);
430 }
431 }
432 imgEmpty(&timg); /* template image is not needed anymore */
433 }
434 if(verbose>3) printf("head TAC computed\n");
435 /* Copy head TAC */
436 for(int i=0; i<img.dimt; i++) dft.voi[0].y[i]=img.sd[i];
437 /* Dynamic PET is not needed any more */
438 imgEmpty(&img);
439
440 /*
441 * Add zero frame to head curve, if first frame is not at zero time
442 * and if there are more than one frame.
443 */
444 if(dft.frameNr>1) {
445 if(verbose>3) printf("checking whether initial zero is needed\n");
446 if(dft.timetype==DFT_TIME_STARTEND) {
447 if(dft.x1[0]>0 && dftAddnullframe(&dft)==0) {
448 dft.x1[0]=0.0; dft.x2[0]=dft.x1[1];
449 dft.x[0]=0.5*(dft.x1[0]+dft.x2[0]);
450 dft.voi[0].y[0]=0.0;}
451 } else {
452 if(dft.x[0]>0 && dftAddnullframe(&dft)==0) {
453 dft.x[0]=dft.x1[1]; dft.voi[0].y[0]=0.0;}
454 }
455 }
456
457 /*
458 * Change negative values to zero, if not required otherwise
459 */
460 if(keepnegat==0) {
461 if(verbose>3) printf("removing subzero values\n");
462 for(int i=0, n=0; i<dft.frameNr; i++)
463 if(dft.voi[0].y[i]<0.0) {dft.voi[0].y[i]=0.0; n++;}
464 if(verbose>1) {
465 if(ret>0) printf("%d negative mean(s) changed to zero.\n", n);
466 else printf("all mean values were positive.\n");
467 }
468 }
469
470 /* Convert doses to MBq, if required */
471 if(calcsum==2) {
472 if(verbose>3) printf("converting to MBq\n");
473 ret=dftUnitConversion(&dft, CUNIT_MBQ);
474 if(verbose>0 && ret!=0) fprintf(stderr, "Warning: cannot convert units.\n");
475 if(verbose>2) printf("new unit := %s\n", dft.unit);
476 }
477
478 /*
479 * Write head curve
480 */
481 if(verbose>1) fprintf(stdout, "writing head curve in %s\n", headfile);
482 if(verbose>2) printf("dft._type := %d\n", dft._type);
483 if(verbose>10) dftPrint(&dft);
484 if(dftWrite(&dft, headfile)) {
485 fprintf(stderr, "Error in writing '%s': %s\n", headfile, dfterrmsg);
486 dftEmpty(&dft); return(11);
487 }
488 if(verbose>0) fprintf(stdout, "Head curve written in %s\n", headfile);
489 dftEmpty(&dft);
490
491 if(verbose>0) fprintf(stdout, "done.\n");
492 return(0);
493}
494/*****************************************************************************/
495
496/*****************************************************************************/
char * ctime_r_int(const time_t *t, char *buf)
Convert calendard time t into a null-terminated string of the form YYYY-MM-DD hh:mm:ss,...
Definition datetime.c:110
int dftAddnullframe(DFT *data)
Definition dft.c:752
void dftInit(DFT *data)
Definition dft.c:38
char dfterrmsg[64]
Definition dft.c:6
void dftEmpty(DFT *data)
Definition dft.c:20
void dftPrint(DFT *data)
Definition dftio.c:538
int dftWrite(DFT *data, char *filename)
Definition dftio.c:594
int dftUnitConversion(DFT *dft, int dunit)
Definition dftunit.c:25
unsigned long long imgNaNs(IMG *img, int fix)
Definition img.c:658
void imgEmpty(IMG *image)
Definition img.c:121
void imgInit(IMG *image)
Definition img.c:60
int imgFrameIntegral(IMG *img, int first, int last, IMG *iimg, int verbose)
Definition imgarithm.c:346
int imgRawCountsPerTime(IMG *img, int operation)
Definition imgarithm.c:442
char * imgIsotope(IMG *img)
Definition imgdecayc.c:76
int imgAverageTAC(IMG *img, float *tac)
Definition imgeval.c:15
int imgAverageMaskTAC(IMG *img, IMG *timg, float *tac)
Definition imgeval.c:34
int imgRead(const char *fname, IMG *img)
Definition imgfile.c:26
int imgWrite(const char *fname, IMG *img)
Definition imgfile.c:136
int imgFrameMinMax(IMG *img, int frame, float *minvalue, float *maxvalue)
Definition imgminmax.c:171
int imgGetPeak(IMG *img, float beforeTime, IMG_PIXEL *p, int verbose)
Definition imgminmax.c:294
int imgMax(IMG *img, float *maxvalue)
Definition imgminmax.c:15
int imgThresholdMask(IMG *img, float minValue, float maxValue, IMG *timg)
Header file for libtpccurveio.
#define DFT_FORMAT_PMOD
#define DFT_FORMAT_CSV_UK
#define DFT_TIME_MIDDLE
#define DFT_FORMAT_STANDARD
#define DFT_FORMAT_PLAIN
#define DFT_TIME_STARTEND
Header file for libtpcimgio.
#define IMG_E7
Header file for libtpcimgp.
Header file for libtpcmisc.
int tpcProcessStdOptions(const char *s, int *print_usage, int *print_version, int *verbose_level)
Definition proginfo.c:40
int studynr_from_fname2(char *fname, char *studynr, int force)
Definition studynr.c:67
int petCunitId(const char *unit)
Definition petunits.c:74
char * petCunit(int cunit)
Definition petunits.c:211
size_t strlcpy(char *dst, const char *src, size_t dstsize)
Definition strext.c:245
int tpcHtmlUsage(const char *program, char *text[], const char *path)
Definition proginfo.c:213
void tpcPrintBuild(const char *program, FILE *fp)
Definition proginfo.c:383
void tpcPrintUsage(const char *program, char *text[], FILE *fp)
Definition proginfo.c:158
Header file for libtpcmodext.
int dftAllocateWithIMG(DFT *dft, int tacNr, IMG *img)
Definition misc_model.c:296
char scanStartTime[20]
char decayCorrected
int _type
int timetype
Voi * voi
int timeunit
char studynr[MAX_STUDYNR_LEN+1]
double * x1
double * x2
int frameNr
char isotope[8]
double * x
char unit[MAX_UNITS_LEN+1]
char radiopharmaceutical[32]
float sizex
unsigned short int dimx
float * sd
float **** m
char decayCorrection
time_t scanStart
int _fileFormat
unsigned short int dimt
float sizey
unsigned short int dimz
unsigned short int dimy
float * end
char radiopharmaceutical[32]
const char * statmsg
float sizez
char voiname[MAX_REGIONSUBNAME_LEN+1]
double * y
char name[MAX_REGIONNAME_LEN+1]
char hemisphere[MAX_REGIONSUBNAME_LEN+1]
char place[MAX_REGIONSUBNAME_LEN+1]