TPCCLIB
Loading...
Searching...
No Matches
avgbolus.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 <math.h>
15#include <string.h>
16/*****************************************************************************/
17#include "libtpcmisc.h"
18#include "libtpccurveio.h"
19#include "libtpcmodel.h"
20#include "libtpcmodext.h"
21/*****************************************************************************/
22
23/*****************************************************************************/
24static char *info[] = {
25 "Calculate an average curve of several bolus input curves with different",
26 "sample times. For simulations.",
27 " ",
28 "Usage: @P [Options] meanfile tacfiles",
29 " ",
30 "Options:",
31 " -nr=<Sample nr>",
32 " Set the nr of samples to use for bolus appearance time; default is 2.",
33 " Set nr=0, if different appearance time is not to be considered.",
34 " -peak",
35 " Peak time is used to align TACs instead of bolus appearance time.",
36 " -ns",
37 " TACs are not scaled to a common AUC.",
38 " -ne",
39 " Standard deviations are not written in output file.",
40 " -stdoptions", // List standard options like --help, -v, etc
41 " ",
42 "Example 1:",
43 " @P apmean.kbq up????ap.kbq",
44 "Example 2 (Windows OS):",
45 " dir /b *.kbq > filelist.txt",
46 " @P apmean.dat filelist.txt",
47 " ",
48 "TAC datafiles must contain a time column, and one or more concentration",
49 "columns separated by space(s) or tabulator(s). Only the first concentration",
50 "column is used in calculations.",
51 "If only one input datafile is given, it is assumed to contain a list of",
52 "bolus datafiles with paths if necessary. Tabs, commas and newlines can be",
53 "used to separate filenames in the list file.",
54 " ",
55 "Output datafile will contain three columns: time, avg concentration and s.d.",
56 "Program will determine the new sample times based on the shortest of input",
57 "datafiles.",
58 " ",
59 "Detailed program description:",
60 " 1) Read first curve from each datafile",
61 " 2) Replace NaNs with interpolated values.",
62 " 3) Determine bolus appearance time in each curve based on certain number",
63 " of samples with highest slope.",
64 " 4) Move all curves in time to have a common appearance time.",
65 " 5) Search the bolus curve with shortest sampling duration.",
66 " 6) Calculate AUC from 0 to that time from all curves separately.",
67 " 7) Scale all bolus curves to have the same average AUC.",
68 " 8) Interpolate all bolus curves to common sample times.",
69 " 9) Calculate the mean and s.d. curve of all bolus curves.",
70 "10) Write the mean and s.d. data in a specified ASCII datafile.",
71 " ",
72 "See also: avgttac, avgfract, dftavg, tacadd, interpol, tac2svg, tacformat",
73 " ",
74 "Keywords: TAC, simulation, modelling, input",
75 0};
76/*****************************************************************************/
77
78/*****************************************************************************/
79/* Turn on the globbing of the command line, since it is disabled by default in
80 mingw-w64 (_dowildcard=0); in MinGW32 define _CRT_glob instead, if necessary;
81 In Unix&Linux wildcard command line processing is enabled by default. */
82/*
83#undef _CRT_glob
84#define _CRT_glob -1
85*/
86int _dowildcard = -1;
87/*****************************************************************************/
88
89/*****************************************************************************/
93int main(int argc, char **argv)
94{
95 int ai, help=0, version=0, verbose=1;
96 int ret, n, m;
97 int slopeNr=2, scaling=1, save_errors=1;
98 int usePeak=0;
99 char *cptr, ofile[FILENAME_MAX],
100 tmp[FILENAME_MAX], studynr[MAX_STUDYNR_LEN+1];
101 double f, g, h;
102 STR_TOKEN_LIST filelist;
103
104
105 /*
106 * Get arguments
107 */
108 if(argc==1) {tpcPrintUsage(argv[0], info, stderr); return(1);}
109 ofile[0]=(char)0;
110 str_token_list_init(&filelist);
111 /* Options */
112 for(ai=1; ai<argc; ai++) if(*argv[ai]=='-') {
113 if(tpcProcessStdOptions(argv[ai], &help, &version, &verbose)==0) continue;
114 cptr=argv[ai]+1; if(*cptr=='-') cptr++; if(cptr==NULL) continue;
115 if(strncasecmp(cptr, "NR=", 3)==0) {
116 slopeNr=atoi(cptr+3); continue;
117 } else if(strncasecmp(cptr, "NS", 2)==0) {
118 scaling=0; continue;
119 } else if(strncasecmp(cptr, "NE", 2)==0) {
120 save_errors=0; continue;
121 } else if(strcasecmp(cptr, "PEAK")==0) {
122 usePeak=1; continue;
123 }
124 fprintf(stderr, "Error: invalid option '%s'.\n", argv[ai]);
125 return(1);
126 } else break;
127 if(usePeak) slopeNr=0;
128
129 /* Print help or version? */
130 if(help==2) {tpcHtmlUsage(argv[0], info, ""); return(0);}
131 if(help) {tpcPrintUsage(argv[0], info, stdout); return(0);}
132 if(version) {tpcPrintBuild(argv[0], stdout); return(0);}
133
134 /* Process other arguments, starting from the first non-option */
135 for(; ai<argc; ai++) {
136 if(!ofile[0]) {
137 strlcpy(ofile, argv[ai], FILENAME_MAX); continue;
138 } else if(str_token_list_add(&filelist, argv[ai])) {
139 fprintf(stderr, "Error: invalid argument '%s'.\n", argv[ai]);
140 return(1);
141 }
142 }
143
144 /* Is something missing? */
145 if(!ofile[0] || filelist.token_nr<1) {
146 fprintf(stderr, "Error: missing command-line argument; use option --help\n");
147 return(1);
148 }
149
150 /* In verbose mode print arguments and options */
151 if(verbose>1) {
152 printf("usePeak := %d\n", usePeak);
153 if(!usePeak) printf("slopeNr := %d\n", slopeNr);
154 printf("scaling := %d\n", scaling);
155 printf("save_errors := %d\n", save_errors);
156 printf("ofile := %s\n", ofile);
157 printf("token_nr := %d\n", filelist.token_nr);
158 }
159
160 /* Check filename list; read list of files if necessary */
161 if(filelist.token_nr==0) {
162 tpcPrintUsage(argv[0], info, stderr);
163 str_token_list_empty(&filelist);
164 return(1);
165 } else if(filelist.token_nr>1) {
166 /* Filenames were given directly */
167 if(verbose>2) printf("filenames were given on command-line\n");
168 } else { /* Filenames were given in a list file */
169 strcpy(tmp, filelist.tok[0]);
170 if(access(tmp, 0) == -1) {
171 fprintf(stderr, "Error: '%s' is not accessible.\n", tmp);
172 str_token_list_empty(&filelist); return(2);
173 }
174 str_token_list_empty(&filelist);
175 if(verbose>1) printf("reading filenames in %s\n", tmp);
176 ret=str_token_list_read(tmp, &filelist);
177 if(ret) {
178 fprintf(stderr, "Error %d in reading filename list %s\n", ret, tmp);
179 return(2);
180 }
181 }
182
183 /*
184 * Read datafiles
185 */
186 int bi, fi, dftNr;
187 dftNr=filelist.token_nr;
188 DFT *dftlist;
189 if(verbose>1) printf("dftNr := %d\n", dftNr);
190 /* Check that files exist */
191 for(bi=0; bi<dftNr; bi++) {
192 if(verbose>3)
193 fprintf(stdout, "Bolus datafile #%d: '%s'\n", bi+1, filelist.tok[bi]);
194 if(access(filelist.tok[bi], 0) == -1) {
195 fprintf(stderr, "Error: bolus file '%s' is not accessible.\n",
196 filelist.tok[bi]);
197 str_token_list_empty(&filelist); return(3);
198 }
199 }
200 /* Allocate memory for an array of DFT data */
201 dftlist=(DFT*)malloc(dftNr*sizeof(DFT));
202 if(dftlist==NULL) {
203 fprintf(stderr, "Error: out of memory.\n");
204 str_token_list_empty(&filelist); return(4);
205 }
206 /* Read bolus datafiles */
207 for(bi=0; bi<dftNr; bi++) {
208 if(verbose>2) printf("reading %s\n", filelist.tok[bi]);
209 dftInit(dftlist+bi);
210 if(dftRead(filelist.tok[bi], dftlist+bi)) {
211 fprintf(stderr, "Error in reading '%s': %s\n",filelist.tok[bi],dfterrmsg);
212 str_token_list_empty(&filelist); return(5);
213 }
214 if(verbose>3) printf(" -> %d frames and %d curves\n",
215 dftlist[bi].frameNr, dftlist[bi].voiNr);
216 if(dftlist[bi].frameNr<2) {
217 fprintf(stderr, "Error: only one sample time in '%s'.\n",filelist.tok[bi]);
218 str_token_list_empty(&filelist); return(5);
219 }
220 /* Get studynr */
221 if(bi==0) strcpy(studynr, dftlist[bi].studynr);
222 else {if(strcasecmp(studynr, dftlist[bi].studynr)!=0) strcpy(studynr, "");}
223 /* We use only the first TAC in case there are several */
224 if(dftlist[bi].voiNr>1) {
225 fprintf(stderr, "Warning: only first TAC in %s is read.\n",
226 filelist.tok[bi]);
227 dftlist[bi].voiNr=1;
228 }
229 /* Remove NA's */
230 if(dftNAfill(dftlist+bi)) {
231 fprintf(stderr, "Error: cannot replace missing data in %s\n",
232 filelist.tok[bi]);
233 str_token_list_empty(&filelist); return(5);
234 }
235 }
236
237 /* Allocate temp memory */
238 double *bolusv;
239 bolusv=(double*)malloc(dftNr*sizeof(double));
240 if(bolusv==NULL) {
241 fprintf(stderr, "Error: out of memory.\n");
242 str_token_list_empty(&filelist);
243 for(bi=dftNr-1; bi>=0; bi--) dftEmpty(dftlist+bi);
244 free(dftlist);
245 return(6);
246 }
247
248
249 if(!usePeak) {
250 /*
251 * Correct the bolus appearance time to the average of it
252 */
253 if(verbose>1) printf("determining the bolus appearance times\n");
254 double slope, ic, meanAppTime;
255 /* Determine the appearance times; set to 0 if it is not possible */
256 for(bi=0; bi<dftNr; bi++) {
257 bolusv[bi]=0.0; if(slopeNr<2) continue;
258 /* Find the max TAC value */
259 f=dftlist[bi].voi[0].y[0]; n=0;
260 for(fi=1; fi<dftlist[bi].frameNr; fi++) if(dftlist[bi].voi[0].y[fi]>f) {
261 f=dftlist[bi].voi[0].y[fi]; n=fi;
262 }
263 if(verbose>2) printf("curve #%d: max %g at sample %d\n", bi+1, f, n+1);
264 /* If the first sample is the max, then we cannot determine
265 appearance time */
266 if(n==0) {bolusv[bi]=nan(""); continue;}
267 /* Determine the max "derivative" */
268 /* and appearance time as its intercept with x axis */
269 ret=highest_slope(
270 dftlist[bi].x, dftlist[bi].voi[0].y, dftlist[bi].frameNr, slopeNr,
271 &slope, &ic, NULL, NULL
272 );
273 if(ret) {
274 fprintf(stderr, "Error (%d): cannot calculate max slope.\n", ret);
275 str_token_list_empty(&filelist); free(bolusv);
276 for(bi=dftNr-1; bi>=0; bi--) dftEmpty(dftlist+bi);
277 free(dftlist);
278 return(7);
279 }
280 if(slope!=0.0) bolusv[bi]=-ic/slope; else bolusv[bi]=nan("");
281 if(verbose>2)
282 printf(" curve #%d: slopeMax %g appTime %g\n", bi+1, slope, bolusv[bi]);
283 }
284 /* Calculate the mean appearance time (including only positive values) */
285 meanAppTime=0; n=0;
286 for(bi=0; bi<dftNr; bi++) if(!isnan(bolusv[bi]) && bolusv[bi]>0.0) {
287 meanAppTime+=bolusv[bi]; n++;}
288 if(n>0) {
289 meanAppTime/=(double)n;
290 if(verbose>0) fprintf(stdout, "Mean appearance time is %g\n", meanAppTime);
291 }
292 /* Correct the bolus sample times according to mean appearance time */
293 if(slopeNr>0) for(bi=0; bi<dftNr; bi++) if(!isnan(bolusv[bi])) {
294 g=meanAppTime-bolusv[bi];
295 if(verbose>0)
296 fprintf(stdout, "%s : %g change in sample times\n", filelist.tok[bi], g);
297 for(fi=0; fi<dftlist[bi].frameNr; fi++) {
298 dftlist[bi].x[fi]+=g; dftlist[bi].x1[fi]+=g; dftlist[bi].x2[fi]+=g;}
299 if(verbose==11) dftPrint(dftlist+bi);
300 }
301 /* Add zero sample times with zero value if necessary */
302 for(bi=0; bi<dftNr; bi++) if(dftlist[bi].x[0]>0.0) {
303 dftAddnullframe(dftlist+bi);
304 /* Set the "null" time closer to the mean appearance time */
305 if(dftlist[bi].x[1]>meanAppTime) dftlist[bi].x[0]=meanAppTime;
306 }
307
308 } else {
309
310 /*
311 * Correct the peak time to the average of it
312 */
313 if(verbose>1) printf("determining the peak times\n");
314 double maxv;
315 /* Determine the peak times */
316 for(bi=0; bi<dftNr; bi++) {
317 ret=dftMinMaxTAC(dftlist+bi, 0, NULL, bolusv+bi,
318 NULL, &maxv, NULL, NULL, NULL, NULL);
319 if(ret) {
320 fprintf(stderr, "Error: cannot determine TAC peak.\n");
321 str_token_list_empty(&filelist); free(bolusv);
322 for(bi=dftNr-1; bi>=0; bi--) dftEmpty(dftlist+bi);
323 free(dftlist);
324 return(6);
325 }
326 if(verbose>2) printf("curve #%d: max %g at %g\n", bi+1, maxv, bolusv[bi]);
327 }
328 /* What is the latest peak time? */
329 double latestPeak;
330 latestPeak=bolusv[0];
331 for(bi=1; bi<dftNr; bi++) if(bolusv[bi]>latestPeak) latestPeak=bolusv[bi];
332 if(verbose>2) printf("latest peak time is %g\n", latestPeak);
333 /* Correct the peak times according to the latest peak time */
334 for(bi=0; bi<dftNr; bi++) {
335 g=latestPeak-bolusv[bi];
336 if(verbose>0)
337 fprintf(stdout, "%s : %g change in sample times\n", filelist.tok[bi], g);
338 for(fi=0; fi<dftlist[bi].frameNr; fi++) {
339 dftlist[bi].x[fi]+=g; dftlist[bi].x1[fi]+=g; dftlist[bi].x2[fi]+=g;}
340 if(verbose==11) dftPrint(dftlist+bi);
341 }
342 }
343
344 /*
345 * Scale the levels of curves based on AUC
346 */
347 double shortestTime, longestTime;
348 /* Find the shortest and longest bolus curve */
349 shortestTime=longestTime=dftlist[0].x[dftlist[0].frameNr-1];
350 for(bi=1; bi<dftNr; bi++) {
351 if(dftlist[bi].x[dftlist[bi].frameNr-1]<shortestTime)
352 shortestTime=dftlist[bi].x[dftlist[bi].frameNr-1];
353 else if(dftlist[bi].x[dftlist[bi].frameNr-1]>longestTime)
354 longestTime=dftlist[bi].x[dftlist[bi].frameNr-1];
355 }
356 if(verbose>1)
357 printf("The shortest and longest bolus curve lengths are %g and %g\n",
358 shortestTime, longestTime);
359 if(shortestTime<=0.0) {
360 fprintf(stderr, "Error: check the bolus sample times!\n");
361 for(bi=dftNr-1; bi>=0; bi--) dftEmpty(dftlist+bi);
362 free(dftlist);
363 str_token_list_empty(&filelist); free(bolusv);
364 return(8);
365 }
366 /* Calculate AUC 0-shortestTime for all curves */
367 double x[2], yi[2];
368 x[0]=0.0; x[1]=shortestTime;
369 for(bi=0; bi<dftNr; bi++) {
370 ret=interpolate(dftlist[bi].x, dftlist[bi].voi[0].y, dftlist[bi].frameNr,
371 x, NULL, yi, NULL, 2);
372 if(ret) {
373 fprintf(stderr, "Error %d in AUC calculation: check sample times!\n", ret);
374 str_token_list_empty(&filelist);
375 for(bi=dftNr-1; bi>=0; bi--) dftEmpty(dftlist+bi);
376 free(dftlist);
377 free(bolusv); return(8);
378 }
379 bolusv[bi]=yi[1]-yi[0];
380 if(verbose>3) printf("Curve #%d: AUC0-%g = %g\n", bi+1, shortestTime, bolusv[bi]);
381 }
382 /* Calculate the mean AUC */
383 f=0.0; for(bi=0; bi<dftNr; bi++) f+=bolusv[bi];
384 f/=(double)dftNr;
385 if(verbose>2) fprintf(stdout, "Mean AUC is %g\n", f);
386 /* Correct the bolus curves according to mean AUC */
387 if(scaling!=0) {
388 if(verbose>1) printf("scaling the levels of curves based on AUC\n");
389 for(bi=0; bi<dftNr; bi++) {
390 g=f/bolusv[bi];
391 if(verbose>0)
392 fprintf(stdout, "%s : scaling with factor %g\n", filelist.tok[bi], g);
393 for(fi=0; fi<dftlist[bi].frameNr; fi++) dftlist[bi].voi[0].y[fi]*=g;
394 if(verbose==13) dftPrint(dftlist+bi);
395 }
396 }
397
398
399 /*
400 * Interpolate bolus curves to the same sample times
401 */
402 DFT idft;
403 dftInit(&idft); bi=0;
404 /* Use autointerpolate for the first TAC just to get the times */
405 f=0.5*(shortestTime+longestTime);
406 if(verbose>1) printf("interpolating to time %g\n", f);
407 ret=dftAutointerpolate(dftlist+bi, &idft, f, verbose-2);
408 if(ret) {
409 fprintf(stderr, "Error %d: cannot create interpolated curve.\n", ret);
410 str_token_list_empty(&filelist);
411 for(bi=dftNr-1; bi>=0; bi--) dftEmpty(dftlist+bi);
412 free(dftlist);
413 free(bolusv); return(11);
414 }
415 /* Remove comments from interpolated data */
416 strcpy(idft.comments, "");
417 /* Set extrapolated values to NaN */
418 f=dftlist[bi].x[dftlist[bi].frameNr-1];
419 for(fi=idft.frameNr-1; fi>0; fi--)
420 if(idft.x[fi-1]>=f) idft.voi[bi].y[fi]=nan(""); else break;
421 /* Add places for the others */
422 ret=dftAddmem(&idft, dftNr-1);
423 if(ret) {
424 fprintf(stderr, "Error %d in memory allocation.\n", ret);
425 str_token_list_empty(&filelist);
426 for(bi=dftNr-1; bi>=0; bi--) dftEmpty(dftlist+bi);
427 free(dftlist); free(bolusv); dftEmpty(&idft); return(11);
428 }
429 /* and interpolate those */
430 for(bi=1; bi<dftNr; bi++) {
431 ret=interpolate4pet(dftlist[bi].x, dftlist[bi].voi[0].y, dftlist[bi].frameNr,
432 idft.x1, idft.x2, idft.voi[bi].y, NULL, NULL, idft.frameNr);
433 if(ret) {
434 fprintf(stderr, "Error %d in interpolation of %dth curve.\n", ret, bi+1);
435 str_token_list_empty(&filelist);
436 for(bi=dftNr-1; bi>=0; bi--) dftEmpty(dftlist+bi);
437 free(dftlist); free(bolusv); dftEmpty(&idft); return(12);
438 }
439 idft.voiNr++;
440 /* and set extrapolated values to NaN */
441 f=dftlist[bi].x[dftlist[bi].frameNr-1];
442 for(fi=idft.frameNr-1; fi>0; fi--)
443 if(idft.x[fi-1]>=f) idft.voi[bi].y[fi]=nan(""); else break;
444 }
445 /* Set file and time type to match original (first) file */
446 idft.timetype=dftlist[0].timetype;
447 idft._type=dftlist[0]._type;
448 if(verbose>10) dftPrint(&idft);
449
450 /* Original data is not needed anymore */
451 for(bi=dftNr-1; bi>=0; bi--) dftEmpty(dftlist+bi);
452 free(dftlist); free(bolusv);
453
454
455 /*
456 * Calculate average and SD for each interpolated sample
457 */
458 if(verbose>1) printf("calculating mean and sd\n");
459 for(fi=m=0; fi<idft.frameNr; fi++) {
460 /* Mean */
461 g=h=0.0; n=0;
462 for(bi=0; bi<idft.voiNr; bi++) if(!isnan(idft.voi[bi].y[fi])) {
463 g+=idft.voi[bi].y[fi];
464 h+=idft.voi[bi].y[fi]*idft.voi[bi].y[fi];
465 n++;
466 }
467 if(verbose>6) printf(" sample %d sum=%g n=%d\n", 1+fi, g, n);
468 if(n==0) continue; // leave out samples where no mean could be computed
469 /* mean */
470 idft.voi[0].y2[m]=g/(double)n;
471 /* sd */
472 if(n<2) {idft.voi[1].y2[m]=0.0;} else {
473 g*=g; idft.voi[1].y2[m]=sqrt( (h-g/(double)n)/(double)(n-1) );}
474 /* Next sample */
475 m++;
476 }
477 idft.frameNr=m;
478 if(verbose>9) dftPrint(&idft);
479
480
481 /*
482 * Write average datafile
483 */
484 if(verbose>1) printf("writing average data in %s\n", ofile);
485 if(*studynr=='\0' || strcmp(studynr, ".")==0) strcpy(idft.studynr, "mean");
486 else strcpy(idft.studynr, studynr);
487 /* Set data */
488 if(save_errors) idft.voiNr=2; else idft.voiNr=1;
489 strcpy(idft.voi[0].voiname, "Avg");
490 strcpy(idft.voi[1].voiname, "SD");
491 for(fi=0; fi<idft.frameNr; fi++) {
492 idft.voi[0].y[fi]=idft.voi[0].y2[fi];
493 idft.voi[1].y[fi]=idft.voi[1].y2[fi];
494 }
495 /* Write the file */
496 dftSetComments(&idft);
497 ret=dftWrite(&idft, ofile);
498 if(ret) {
499 fprintf(stderr, "Error in writing '%s': %s\n", ofile, dfterrmsg);
500 str_token_list_empty(&filelist); dftEmpty(&idft);
501 return(15);
502 }
503 dftEmpty(&idft);
504 if(verbose>0) {
505 if(!save_errors) fprintf(stderr, "Average curve written in %s\n", ofile);
506 else fprintf(stderr, "Average and SD curves written in %s\n", ofile);
507 }
508
509 str_token_list_empty(&filelist);
510
511 return(0);
512}
513/*****************************************************************************/
514
515/*****************************************************************************/
int dftAddnullframe(DFT *data)
Definition dft.c:752
void dftInit(DFT *data)
Definition dft.c:38
int dftMinMaxTAC(DFT *dft, int tacindex, double *minx, double *maxx, double *miny, double *maxy, int *mini, int *maxi, int *mins, int *maxs)
Definition dft.c:1024
char dfterrmsg[64]
Definition dft.c:6
int dftAddmem(DFT *dft, int voiNr)
Definition dft.c:107
void dftSetComments(DFT *dft)
Definition dft.c:1326
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
void dftPrint(DFT *data)
Definition dftio.c:538
int dftWrite(DFT *data, char *filename)
Definition dftio.c:594
int dftAutointerpolate(DFT *dft, DFT *dft2, double endtime, int verbose)
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.
Header file for libtpcmisc.
int tpcProcessStdOptions(const char *s, int *print_usage, int *print_version, int *verbose_level)
Definition proginfo.c:40
void str_token_list_empty(STR_TOKEN_LIST *lst)
Definition readfile.c:26
void str_token_list_init(STR_TOKEN_LIST *lst)
Definition readfile.c:13
int str_token_list_add(STR_TOKEN_LIST *lst, char *new_item)
Definition readfile.c:42
size_t strlcpy(char *dst, const char *src, size_t dstsize)
Definition strext.c:245
int str_token_list_read(const char *filename, STR_TOKEN_LIST *lst)
Definition readfile.c:93
#define MAX_STUDYNR_LEN
Definition libtpcmisc.h:163
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 highest_slope(double *x, double *y, int n, int slope_n, double *m, double *c, double *xi, double *xh)
Definition pearson.c:424
Header file for libtpcmodext.
int _type
int timetype
Voi * voi
char studynr[MAX_STUDYNR_LEN+1]
double * x1
char comments[_DFT_COMMENT_LEN+1]
int voiNr
double * x2
int frameNr
double * x
double * y2
char voiname[MAX_REGIONSUBNAME_LEN+1]
double * y