TPCCLIB
Loading...
Searching...
No Matches
metabcor.c
Go to the documentation of this file.
1
8/*****************************************************************************/
9#include "tpcclibConfig.h"
10/*****************************************************************************/
11#include <stdio.h>
12#include <stdlib.h>
13#include <unistd.h>
14#include <string.h>
15#include <math.h>
16/*****************************************************************************/
17#include "libtpcmisc.h"
18#include "libtpcmodel.h"
19#include "libtpccurveio.h"
20/*****************************************************************************/
21
22/*****************************************************************************/
23static char *info[] = {
24 "Calculate TACs of authentic (unchanged) tracer and radioactive",
25 "metabolite(s) from measured plasma TAC and fractions of authentic tracer.",
26 " ",
27 "Usage: @P [Options] plasmafile fractionfile",
28 " ",
29 "Fraction file can have either of two formats:",
30 " 1) it can contain the sample times (min), and the fraction(s) of authentic",
31 " tracer, and optionally the fractions of different metabolites; or",
32 " 2) parameters of a mathematical function fitted to the fraction curves.",
33 " ",
34 "By default, result TACs are written in files named as *_pure.* and",
35 "*_met.*, and if several metabolites exist, the following as *_met2.*",
36 "and *_met3.*",
37 " ",
38 "Options:",
39 " -fnpure=<filename>",
40 " Replace default filename parent tracer TAC.",
41 " -fnmet=<filename>",
42 " Replace default filename for the plasma metabolite TAC.",
43 " -fnmet2=<filename>",
44 " Replace default filename the second plasma metabolite TAC.",
45 " -fnmet3=<filename>",
46 " Replace default filename the 3rd plasma metabolite TAC.",
47 " -pure=<id>",
48 " The result file is named by adding specified id text before file",
49 " extension, instead of the default '_pure'.",
50 " -met=<id>",
51 " The result file is named by adding specified id text before file",
52 " name extension, instead of the default '_met'.",
53 " -met2=<id>",
54 " The result file is named by adding specified id text before file",
55 " name extension, instead of the default '_met2'.",
56 " -met3=<id>",
57 " The result file is named by adding specified id text before file",
58 " name extension, instead of the default '_met3'.",
59 " -stdoptions", // List standard options like --help, -v, etc
60 " ",
61 "See also: fit_ppf, fit_fexp, fit2dat, tac2svg, taccalc",
62 " ",
63 "Keywords: input, plasma, TAC, modelling, metabolite correction",
64 0};
65/*****************************************************************************/
66
67/*****************************************************************************/
68/* Turn on the globbing of the command line, since it is disabled by default in
69 mingw-w64 (_dowildcard=0); in MinGW32 define _CRT_glob instead, if necessary;
70 In Unix&Linux wildcard command line processing is enabled by default. */
71/*
72#undef _CRT_glob
73#define _CRT_glob -1
74*/
75int _dowildcard = -1;
76/*****************************************************************************/
77
78/*****************************************************************************/
82int main(int argc, char **argv)
83{
84 int ai, help=0, version=0, verbose=1;
85 int ri, fi, fj, n, filetype, ret;
86 double v, v_max;
87 DFT plasma, fract;
88 FIT fit;
89 char *cptr, tmp[FILENAME_MAX], plfile[FILENAME_MAX], ratfile[FILENAME_MAX];
90 char output_id0[128], output_id1[128], output_id2[128], output_id3[128];
91 char *outfile[4];
92
93
94 /*
95 * Get arguments
96 */
97 if(argc==1) {tpcPrintUsage(argv[0], info, stderr); return(1);}
98 plfile[0]=ratfile[0]=(char)0;
99 for(n=0; n<4; n++) outfile[n]=(char*)NULL;
100 strcpy(output_id0, "_pure");
101 strcpy(output_id1, "_met");
102 strcpy(output_id2, "_met2");
103 strcpy(output_id3, "_met3");
104 dftInit(&plasma); dftInit(&fract); fitInit(&fit);
105 /* Options */
106 for(ai=1; ai<argc; ai++) if(*argv[ai]=='-') {
107 cptr=argv[ai]+1; if(*cptr=='-') cptr++; if(cptr==NULL) continue;
108 if(tpcProcessStdOptions(argv[ai], &help, &version, &verbose)==0) continue;
109 if(strncasecmp(cptr, "PURE=", 5)==0) {
110 cptr+=5; if(strlen(cptr)>0 && strlen(cptr)<128) {
111 strlcpy(output_id0, cptr, 128); continue;}
112 } else if(strncasecmp(cptr, "MET=", 4)==0) {
113 cptr+=4; if(strlen(cptr)>0 && strlen(cptr)<128) {
114 strlcpy(output_id1, cptr, 128); continue;}
115 } else if(strncasecmp(cptr, "MET2=", 5)==0) {
116 cptr+=5; if(strlen(cptr)>0 && strlen(cptr)<128) {
117 strlcpy(output_id2, cptr, 128); continue;}
118 } else if(strncasecmp(cptr, "MET3=", 5)==0) {
119 cptr+=5; if(strlen(cptr)>0 && strlen(cptr)<128) {
120 strlcpy(output_id3, cptr, 128); continue;}
121 } else if(strncasecmp(cptr, "FNPURE=", 7)==0) {
122 cptr+=7; if(strlen(cptr)>0 && strlen(cptr)<FILENAME_MAX) {
123 outfile[0]=cptr; continue;}
124 } else if(strncasecmp(cptr, "FNMET=", 6)==0) {
125 cptr+=6; if(strlen(cptr)>0 && strlen(cptr)<FILENAME_MAX) {
126 outfile[1]=cptr; continue;}
127 } else if(strncasecmp(cptr, "FNMET2=", 7)==0) {
128 cptr+=7; if(strlen(cptr)>0 && strlen(cptr)<FILENAME_MAX) {
129 outfile[2]=cptr; continue;}
130 } else if(strncasecmp(cptr, "FNMET3=", 7)==0) {
131 cptr+=7; if(strlen(cptr)>0 && strlen(cptr)<FILENAME_MAX) {
132 outfile[3]=cptr; continue;}
133 }
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 for(; ai<argc; ai++) {
145 if(!plfile[0]) {strcpy(plfile, argv[ai]); continue;}
146 else if(!ratfile[0]) {strcpy(ratfile, argv[ai]); continue;}
147 fprintf(stderr, "Error: invalid argument '%s'.\n", argv[ai]);
148 return(1);
149 }
150
151 /* Is something missing? */
152 if(!ratfile[0]) {
153 fprintf(stderr, "Error: missing file name for fraction data.\n");
154 return(1);
155 }
156 if(verbose>5) MATHFUNC_TEST=verbose-5; else MATHFUNC_TEST=0;
157
158
159 /* In verbose mode print arguments and options */
160 if(verbose>1) {
161 printf("plfile := %s\n", plfile);
162 printf("ratfile := %s\n", ratfile);
163 printf("output_id0 := %s\n", output_id0);
164 printf("output_id1 := %s\n", output_id1);
165 printf("output_id2 := %s\n", output_id2);
166 printf("output_id3 := %s\n", output_id3);
167 for(n=0; n<4; n++) if(outfile[n]) printf("outfile%d := %s\n", n, outfile[n]);
168 }
169
170
171 /*
172 * Read plasma TAC
173 */
174 if(verbose>1) printf("reading %s\n", plfile);
175 if(dftRead(plfile, &plasma)) {
176 fprintf(stderr, "Error in reading '%s': %s\n", plfile, dfterrmsg);
177 return(2);
178 }
179 /* Delete other than the first column */
180 if(plasma.voiNr>1) {
181 fprintf(stderr,
182 "Warning: plasma file contains several TACs; only the first is used.\n");
183 plasma.voiNr=1;
184 }
185 if(0) dftPrint(&plasma);
186 /* Make sure that times are in minutes */
187 /* Save the original unit, so that units can be converted back */
188 if(plasma.timeunit==TUNIT_UNKNOWN) {
189 plasma.timeunit=TUNIT_MIN;
190 fprintf(stderr, "Warning: assuming time_unit := %s\n",
191 petTunit(plasma.timeunit));
192 }
193 int orig_plasma_time_unit=plasma.timeunit;
194 if(plasma.timeunit!=TUNIT_MIN) {
195 if(verbose>2)
196 fprintf(stdout,
197 "Note: plasma sample times are converted to minutes.\n");
198 dftTimeunitConversion(&plasma, TUNIT_MIN);
199 }
200 /* Make sure that plasma data has memory for unchanged tracer curve and
201 all metabolite curves */
202 ret=dftAddmem(&plasma, 4); if(ret) {
203 fprintf(stderr, "Error in memory allocation.\n");
204 dftEmpty(&plasma); return(2);
205 }
206 /* Set names for the TACs */
207 if(strlen(plasma.voi[0].voiname)<1 || strcmp(plasma.voi[0].voiname, ".")==0)
208 strcpy(plasma.voi[0].voiname, "Plasma");
209 for(ri=1; ri<5; ri++) {
210 strcpy(plasma.voi[ri].voiname, plasma.voi[0].voiname);
211 strcpy(plasma.voi[ri].place, plasma.voi[0].place);
212 plasma.voi[ri].size=plasma.voi[0].size;
213 }
214 cptr=output_id0; if(cptr[0]=='_') cptr++; strcpy(plasma.voi[1].hemisphere, cptr);
215 cptr=output_id1; if(cptr[0]=='_') cptr++; strcpy(plasma.voi[2].hemisphere, cptr);
216 cptr=output_id2; if(cptr[0]=='_') cptr++; strcpy(plasma.voi[3].hemisphere, cptr);
217 cptr=output_id3; if(cptr[0]=='_') cptr++; strcpy(plasma.voi[4].hemisphere, cptr);
218 for(ri=1; ri<5; ri++)
219 sprintf(plasma.voi[ri].name, "%s %s", plasma.voi[ri].voiname, plasma.voi[ri].hemisphere);
220 /* Remove NA's (only after dftAddmem()) */
221 fi=0; n=plasma.frameNr;
222 while(fi<plasma.frameNr) {
223 if(!isnan(plasma.voi[0].y[fi])) {fi++; continue;}
224 for(fj=fi+1; fj<plasma.frameNr; fj++) {
225 plasma.x1[fj-1]=plasma.x1[fj];
226 plasma.x2[fj-1]=plasma.x2[fj];
227 plasma.x[fj-1]=plasma.x[fj];
228 plasma.voi[0].y[fj-1]=plasma.voi[0].y[fj];
229 plasma.w[fj-1]=plasma.w[fj];
230 }
231 plasma.frameNr--;
232 }
233 if(verbose>2) printf("%d non-available sample(s) removed from plasma TAC.\n",
234 n-plasma.frameNr);
235 if(plasma.frameNr<1) {
236 fprintf(stderr, "Error in %s: invalid contents.\n", plfile);
237 dftEmpty(&plasma); return(2);
238 }
239
240
241 /*
242 * Read fraction curve(s)
243 */
244 if(verbose>1) printf("Reading fractions.\n");
245 /* Check that file can be opened for read */
246 {
247 FILE *fp;
248 fp=fopen(ratfile, "r");
249 if(fp==NULL) {
250 fprintf(stderr, "Error: cannot open '%s'.\n", ratfile);
251 dftEmpty(&plasma); return(3);
252 }
253 fclose(fp);
254 }
255 /* Determine file format */
256 filetype=dftFormat(ratfile);
257 if(filetype==DFT_FORMAT_UNKNOWN) {
258 fprintf(stderr, "Error: unknown fraction file format.\n");
259 dftEmpty(&plasma); return(3);
260 }
261 if(verbose>2) printf("Fractions filetype=%d\n", filetype);
262
263 if(filetype==DFT_FORMAT_FIT) { /* function fitted to fractions */
264
265 /* read FIT file */
266 if(verbose>1) printf("reading %s\n", ratfile);
267 if(fitRead(ratfile, &fit, verbose-5)) {
268 fprintf(stderr, "Error in reading '%s': %s\n", ratfile, fiterrmsg);
269 dftEmpty(&plasma); return(6);
270 }
271 if(verbose>10) fitPrint(&fit);
272 /* Unknown time units are assumed to be in minutes */
273 if(fit.timeunit==TUNIT_UNKNOWN) fit.timeunit=TUNIT_MIN;
274 /* Check that file does not contain more than 4 fraction curves */
275 if(fit.voiNr>4) {
276 fprintf(stderr, "Error in '%s': too many metabolites.\n", ratfile);
277 dftEmpty(&plasma); fitEmpty(&fit); return(6);
278 }
279 /* Check that fraction data extends to most of the plasma sample range */
280 if(fit.voi[0].end>0.0 && plasma.x[plasma.frameNr-1]>1.33*fit.voi[0].end) {
281 fprintf(stderr, "Warning: excessive extrapolation needed for fractions.\n");
282 }
283 /* Evaluate function values at plasma sample times */
284 for(ri=0; ri<fit.voiNr; ri++) {
285 ret=fitEvaltac(&fit.voi[ri], plasma.x, plasma.voi[ri+1].y2, plasma.frameNr);
286 if(ret) {
287 fprintf(stderr, "Error %d in function evaluation.\n", ret);
288 dftEmpty(&plasma); fitEmpty(&fit); return(6);
289 }
290 }
291 plasma.voiNr+=fit.voiNr;
292 fitEmpty(&fit); /* no need for original fitted fractions any more */
293 /* Check for percentages */
294 for(fi=0, v_max=v=0.0; fi<plasma.frameNr; fi++) {
295 for(ri=1, v=0.0; ri<plasma.voiNr; ri++) v+=plasma.voi[ri].y2[fi];
296 if(v>v_max) v_max=v;
297 }
298 if(verbose>2) printf("v_max=%g\n", v_max);
299 if(v_max>101.0) {
300 fprintf(stderr, "Error: invalid fraction values.\n");
301 dftEmpty(&plasma); dftEmpty(&fract); return(6);
302 }
303 if(v_max>1.01) {
304 fprintf(stderr, "Warning: converting percentages to fractions.\n");
305 for(fi=0; fi<plasma.frameNr; fi++) for(ri=1; ri<plasma.voiNr; ri++)
306 plasma.voi[ri].y2[fi]/=100.0;
307 }
308
309 } else { /* try to read as discrete fractions */
310
311 /* read file */
312 if(verbose>1) printf("reading %s\n", ratfile);
313 if(dftRead(ratfile, &fract)) {
314 fprintf(stderr, "Error in reading '%s': %s\n", ratfile, dfterrmsg);
315 dftEmpty(&plasma); return(4);
316 }
317 /* Unknown time units are assumed to be in minutes */
318 if(fract.timeunit==TUNIT_UNKNOWN) fract.timeunit=TUNIT_MIN;
319 /* Check that file does not contain more than 4 fraction columns */
320 if(fract.voiNr>4) {
321 fprintf(stderr, "Error in '%s': too many metabolites.\n", ratfile);
322 dftEmpty(&plasma); dftEmpty(&fract); return(4);
323 }
324 /* Check for percentages (before setting (0,1)) */
325 for(fi=0, v_max=v=0.0; fi<fract.frameNr; fi++) {
326 for(ri=0, v=0.0; ri<fract.voiNr; ri++)
327 if(!isnan(fract.voi[ri].y[fi])) v+=fract.voi[ri].y[fi];
328 if(v>v_max) v_max=v;
329 }
330 if(verbose>2) printf("v_max=%g\n", v_max);
331 if(v_max>101.0) {
332 fprintf(stderr, "Error: invalid fraction values.\n");
333 dftEmpty(&plasma); dftEmpty(&fract); return(4);
334 }
335 if(v_max>1.011) {
336 fprintf(stderr, "Warning: converting percentages to fractions.\n");
337 for(fi=0; fi<fract.frameNr; fi++) for(ri=0; ri<fract.voiNr; ri++)
338 if(!isnan(fract.voi[ri].y[fi])) fract.voi[ri].y[fi]/=100.0;
339 }
340 /* Assume that fractions at zero time are 1, 0, 0,... */
341 if(fract.x[0]>0) {
342 if(verbose>2) printf("adding zero fraction sample\n");
343 ret=dftAddnullframe(&fract);
344 if(ret) {
345 fprintf(stderr, "Error in processing fractions.\n");
346 dftEmpty(&plasma); dftEmpty(&fract); return(3);
347 }
348 fract.voi[0].y[0]=1.0;
349 }
350 /* Remove NA's in parent fractions, but do not allow NA's in
351 metabolite fractions */
352 for(ri=n=0; ri<fract.voiNr; ri++) for(fi=0; fi<fract.frameNr; fi++) {
353 if(isnan(fract.voi[ri].y[fi])) {
354 if(ri>0) { // 0=parent
355 fprintf(stderr, "Error: missing metabolite fraction(s).\n");
356 dftEmpty(&plasma); dftEmpty(&fract); return(3);
357 }
358 n++;
359 }
360 }
361 if(n>0) {
362 if(verbose>1) printf("replacing NAs in fractions\n");
363 ret=dftNAfill(&fract);
364 if(ret) {
365 fprintf(stderr, "Error in replacing missing fractions.\n");
366 dftEmpty(&plasma); dftEmpty(&fract); return(3);
367 }
368 }
369 if(verbose>10) dftPrint(&fract);
370 /* Check that fraction data extends to most of the plasma sample range */
371 if(plasma.x[plasma.frameNr-1]>1.5*fract.x[fract.frameNr-1]) {
372 fprintf(stderr, "Error: excessive extrapolation needed for fractions.\n");
373 dftEmpty(&plasma); dftEmpty(&fract); return(3);
374 }
375 if(plasma.x[plasma.frameNr-1]>1.2*fract.x[fract.frameNr-1]) {
376 fprintf(stderr, "Warning: excessive extrapolation needed for fractions.\n");
377 }
378 /* Interpolate fraction curves to plasma sample times */
379 if(verbose>1) printf("interpolation of fractions\n");
380 for(ri=0; ri<fract.voiNr; ri++) {
381 if(plasma.timetype==DFT_TIME_STARTEND)
382 ret=interpolate4pet(fract.x, fract.voi[ri].y, fract.frameNr,
383 plasma.x1, plasma.x2, plasma.voi[ri+1].y2, NULL, NULL,
384 plasma.frameNr);
385 else
386 ret=interpolate(fract.x, fract.voi[ri].y, fract.frameNr,
387 plasma.x, plasma.voi[ri+1].y2, NULL, NULL, plasma.frameNr);
388 if(ret) {
389 fprintf(stderr, "Error in interpolation.\n");
390 dftEmpty(&plasma); dftEmpty(&fract); return(4);
391 }
392 }
393 plasma.voiNr+=fract.voiNr;
394 dftEmpty(&fract); /* no need for original fractions any more */
395 }
396 if(verbose>8) dftPrint(&plasma);
397
398 /*
399 * Calculate metabolite fractions, if...
400 */
401 if(plasma.voiNr==2) { /* only unchanged fraction was given */
402 if(verbose>1)
403 printf("calculating metabolite fractions for extra metabolite\n");
404 for(fi=0; fi<plasma.frameNr; fi++)
405 plasma.voi[2].y2[fi]=1.0-plasma.voi[1].y2[fi];
406 plasma.voiNr=3;
407 } else {
408 /* Check if the sum of fractions is clearly <1 */
409 if(verbose>1) printf("checking the sum of fractions\n");
410 for(fi=0, v_max=0.0, n=0; fi<plasma.frameNr; fi++) {
411 for(ri=1, v=0.0; ri<plasma.voiNr; ri++) v+=plasma.voi[ri].y2[fi];
412 if(plasma.voiNr<5) plasma.voi[plasma.voiNr].y2[fi]=1.0-v;
413 if(v>0.0) n++; else continue;
414 if((1.0-v)>v_max) v_max=1.0-v;
415 }
416 if(verbose>2 && (v_max>0 || n>0))
417 printf("sum of fractions was less than 1.0; vmax=%g n=%d\n", v_max, n);
418 if(v_max>0.02 && n>1) { /* yes there are, this is not a rounding up error */
419 if(plasma.voiNr>4) { /* there's no room for more */
420 fprintf(stderr, "Error: sum of fractions was less than 1.0.\n");
421 dftEmpty(&plasma); return(7);
422 }
423 printf("sum of fractions was less than 1.0; assuming another metabolite.\n");
424 plasma.voiNr++;
425 }
426 }
427 if(verbose>7) dftPrint(&plasma);
428
429
430 /*
431 * Calculate the curves of authentic tracer and metabolites
432 */
433 for(ri=1; ri<plasma.voiNr; ri++) {
434 /* Multiply fractions with total plasma concentration */
435 for(fi=0; fi<plasma.frameNr; fi++)
436 plasma.voi[ri].y[fi]=plasma.voi[0].y[fi]*plasma.voi[ri].y2[fi];
437 }
438
439 /* Change times back to original units if necessary */
440 if(plasma.timeunit!=orig_plasma_time_unit) {
441 if(verbose>3) printf("converting plasma %s to %s\n",
442 petTunit(plasma.timeunit), petTunit(orig_plasma_time_unit) );
443 if(verbose>4) printf("last_t := %g\n", plasma.x[plasma.frameNr-1]);
444 ret=dftTimeunitConversion(&plasma, orig_plasma_time_unit);
445 if(verbose>4) printf("last_t := %g\n", plasma.x[plasma.frameNr-1]);
446 }
447
448
449 /*
450 * Save the curves of authentic tracer and metabolites
451 */
452 n=plasma.voiNr;
453 for(ri=1; ri<n; ri++) {
454 /* Copy one curve at a time to the first place */
455 ret=dftCopyvoi(&plasma, ri, 0);
456 if(ret) {
457 fprintf(stderr, "Error in processing TACs.\n");
458 dftEmpty(&plasma); return(9);
459 }
460 /* Construct filename */
461 if(outfile[ri-1]) {
462 strcpy(tmp, outfile[ri-1]);
463 } else {
464 strcpy(tmp, plfile); cptr=strrchr(tmp, '.'); if(cptr!=NULL) *cptr=(char)0;
465 switch(ri) {
466 case 1: strcat(tmp, output_id0); break;
467 case 2: strcat(tmp, output_id1); break;
468 case 3: strcat(tmp, output_id2); break;
469 case 4: strcat(tmp, output_id3); break;
470 default:
471 fprintf(stderr, "Error in programmer.\n");
472 dftEmpty(&plasma); return(99);
473 }
474 cptr=strrchr(plfile, '.'); if(cptr!=NULL) strcat(tmp, cptr);
475 }
476 /* Save TAC */
477 if(verbose>0) fprintf(stdout, " writing %s\n", tmp);
478 plasma.voiNr=1; ret=dftWrite(&plasma, tmp); plasma.voiNr=n;
479 if(ret) {
480 fprintf(stderr, "Error (%d) in writing '%s': %s\n", ret, tmp, dfterrmsg);
481 dftEmpty(&plasma); return(11);
482 }
483 }
484
485 /* Free memory */
486 dftEmpty(&plasma);
487
488 return(0);
489}
490/*****************************************************************************/
491
492/*****************************************************************************/
int dftAddnullframe(DFT *data)
Definition dft.c:752
void dftInit(DFT *data)
Definition dft.c:38
char dfterrmsg[64]
Definition dft.c:6
int dftAddmem(DFT *dft, int voiNr)
Definition dft.c:107
int dftCopyvoi(DFT *data, int from, int to)
Definition dft.c:472
void dftEmpty(DFT *data)
Definition dft.c:20
int dftNAfill(DFT *dft)
Definition dft.c:930
int dftRead(char *filename, DFT *data)
Definition dftio.c:22
int dftFormat(char *fname)
Definition dftio.c:422
void dftPrint(DFT *data)
Definition dftio.c:538
int dftWrite(DFT *data, char *filename)
Definition dftio.c:594
int dftTimeunitConversion(DFT *dft, int tunit)
Definition dftunit.c:119
int interpolate(double *x, double *y, int nr, double *newx, double *newy, double *newyi, double *newyii, int newnr)
Linear interpolation and integration.
Definition integr.c:28
int interpolate4pet(double *x, double *y, int nr, double *newx1, double *newx2, double *newy, double *newyi, double *newyii, int newnr)
Interpolate and integrate TAC to PET frames.
Definition integr.c:510
Header file for libtpccurveio.
int fitEvaltac(FitVOI *r, double *x, double *y, int dataNr)
Definition mathfunc.c:1252
void fitEmpty(FIT *fit)
Definition mathfunc.c:18
int fitRead(char *filename, FIT *fit, int verbose)
Definition mathfunc.c:196
#define DFT_FORMAT_FIT
int MATHFUNC_TEST
Definition mathfunc.c:5
char fiterrmsg[64]
Definition mathfunc.c:6
void fitInit(FIT *fit)
Definition mathfunc.c:38
#define DFT_TIME_STARTEND
#define DFT_FORMAT_UNKNOWN
void fitPrint(FIT *fit)
Definition mathfunc.c:180
Header file for libtpcmisc.
int tpcProcessStdOptions(const char *s, int *print_usage, int *print_version, int *verbose_level)
Definition proginfo.c:40
size_t strlcpy(char *dst, const char *src, size_t dstsize)
Definition strext.c:245
char * petTunit(int tunit)
Definition petunits.c:226
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 libtpcmodel.
int timetype
Voi * voi
int timeunit
double * w
double * x1
int voiNr
double * x2
int frameNr
double * x
int timeunit
int voiNr
FitVOI * voi
double end
double size
double * y2
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]