TPCCLIB
Loading...
Searching...
No Matches
yokoi.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 <string.h>
15#include <math.h>
16/*****************************************************************************/
17#include "tpcextensions.h"
18#include "tpctac.h"
19#include "tpcpar.h"
20#include "tpcli.h"
21#include "tpctacmod.h"
22#include "tpclinopt.h"
23/*****************************************************************************/
24
25/*****************************************************************************/
26static char *info[] = {
27 "Calculate K1, k2, and K1/k2 using multiple-time graphical analysis (MTGA)",
28 "for reversible PET ligands (Yokoi plot) (1,2,3) from regional PET TACs.",
29 " ",
30 "Usage: @P [options] tacfile input starttime endtime resultfile",
31 " ",
32 "Options:",
33 " -sd=<y|N>",
34 " Standard deviations are saved (y) or not saved (n, default) in results.",
35 " -svg=<Filename>",
36 " Plots are written in specified file in Scalable Vector Graphics (SVG) 1.1",
37 " format; specification in https://www.w3.org/TR/SVG/",
38 " -plot=<Filename>",
39 " Data for plots is written in TSV format for easy importing in Excel",
40 " or OpenOffice spreadsheet, where the data can be viewed.",
41 " -stdoptions", // List standard options like --help, -v, etc
42 " ",
43 "References:",
44 "1. Yokoi T, Iida H, Itoh H, Kanno I. A new graphic plot analysis for cerebral",
45 " blood flow and partition coefficient with iodine-123-iodoamphetamine",
46 " and dynamic SPECT validation studies using oxygen-15-water and PET.",
47 " J Nucl Med. 1993; 34(3): 498-505.",
48 "2. Ito H, Yokoi T, Ikoma Y, et al. A new graphic plot analysis for",
49 " determination of neuroreceptor binding in positron emission tomography",
50 " studies. NeuroImage 2010; 49(1): 578-586.",
51 "3. Ito H, Ikoma Y, Seki C, et al. Visual evaluation of kinetic",
52 " characteristics of PET probe for neuroreceptors using a two-phase graphic",
53 " plot analysis. Ann Nucl Med. 2017; 31(4): 273-282.",
54 " ",
55 "See also: logan, patlak, fitk2, lhsol",
56 " ",
57 "Keywords: TAC, MTGA, modelling, K1, Vt",
58 0};
59/*****************************************************************************/
60
61/*****************************************************************************/
62/* Turn on the globbing of the command line, since it is disabled by default in
63 mingw-w64 (_dowildcard=0); in MinGW32 define _CRT_glob instead, if necessary;
64 In Unix&Linux wildcard command line processing is enabled by default. */
65/*
66#undef _CRT_glob
67#define _CRT_glob -1
68*/
69int _dowildcard = -1;
70/*****************************************************************************/
71
72/*****************************************************************************/
76int main(int argc, char **argv)
77{
78 int ai, help=0, version=0, verbose=1;
79 char tacfile[FILENAME_MAX], inpfile[FILENAME_MAX], resfile[FILENAME_MAX];
80 char svgfile[FILENAME_MAX], plotfile[FILENAME_MAX];
81 int save_stat=0; // 0=do not save, 1=save SD and/or other fit statistics
82 double tstart=nan(""), tstop=nan(""); // fit start and end times
83
84 /*
85 * Get arguments
86 */
87 if(argc==1) {tpcPrintUsage(argv[0], info, stderr); return(1);}
88 tacfile[0]=inpfile[0]=resfile[0]=svgfile[0]=plotfile[0]=(char)0;
89 /* Options */
90 for(ai=1; ai<argc; ai++) if(*argv[ai]=='-') {
91 if(tpcProcessStdOptions(argv[ai], &help, &version, &verbose)==0) continue;
92 char *cptr=argv[ai]+1; if(*cptr=='-') cptr++; if(!*cptr) continue;
93 if(strncasecmp(cptr, "SVG=", 4)==0) {
94 strlcpy(svgfile, cptr+4, FILENAME_MAX); if(strlen(svgfile)>0) continue;
95 } else if(strncasecmp(cptr, "PLOT=", 5)==0) {
96 strlcpy(plotfile, cptr+5, FILENAME_MAX); if(strlen(plotfile)>0) continue;
97 } else if(strncasecmp(cptr, "SD=", 3)==0) {
98 save_stat=tpcYesNo(cptr+3); if(save_stat>=0) continue;
99 }
100 fprintf(stderr, "Error: invalid option '%s'\n", argv[ai]);
101 return(1);
102 } else break; // later arguments may start with '-'
103
104 TPCSTATUS status; statusInit(&status);
105 statusSet(&status, __func__, __FILE__, __LINE__, TPCERROR_OK);
106 status.verbose=verbose-10;
107
108 /* Print help or version? */
109 if(help==2) {tpcHtmlUsage(argv[0], info, ""); return(0);}
110 if(help) {tpcPrintUsage(argv[0], info, stdout); return(0);}
111 if(version) {tpcPrintBuild(argv[0], stdout); return(0);}
112
113 /* Process other arguments, starting from the first non-option */
114 if(ai<argc) strlcpy(tacfile, argv[ai++], FILENAME_MAX);
115 if(ai<argc) strlcpy(inpfile, argv[ai++], FILENAME_MAX);
116 if(ai<argc) {
117 if(atofCheck(argv[ai], &tstart)) {
118 fprintf(stderr, "Error: invalid start time '%s'.\n", argv[ai]); return(1);}
119 ai++;
120 }
121 if(ai<argc) {
122 if(atofCheck(argv[ai], &tstop)) {
123 fprintf(stderr, "Error: invalid stop time '%s'.\n", argv[ai]); return(1);}
124 ai++;
125 }
126 if(ai<argc) strlcpy(resfile, argv[ai++], FILENAME_MAX);
127 if(ai<argc) {
128 fprintf(stderr, "Error: invalid argument '%s'.\n", argv[ai]);
129 return(1);
130 }
131 /* Did we get all the information that we need? */
132 if(!resfile[0]) {
133 fprintf(stderr, "Error: missing command-line argument; use option --help\n");
134 return(1);
135 }
136 /* Is something wrong? */
137 if(!isnan(tstart) && !isnan(tstop) && tstop<=tstart) {
138 fprintf(stderr, "Error: illegal time range %g-%g\n", tstart, tstop);
139 return(1);
140 }
141
142
143 /* In verbose mode print arguments and options */
144 if(verbose>1) {
145 printf("tacfile := %s\n", tacfile);
146 printf("inpfile := %s\n", inpfile);
147 printf("resfile := %s\n", resfile);
148 if(svgfile[0]) printf("svgfile := %s\n", svgfile);
149 if(plotfile[0]) printf("plotfile := %s\n", plotfile);
150 printf("tstart := %g\n", tstart);
151 printf("tstop := %g\n", tstop);
152 printf("save_stat := %d\n", save_stat);
153 }
154
155
156 /*
157 * Read tissue and input data
158 */
159 if(verbose>0) printf("reading tissue and input data\n");
160 TAC tac, input; tacInit(&tac); tacInit(&input);
161 int fitSampleNr;
162 double fitdur;
163 if(tstop>0.01) fitdur=tstop; else fitdur=1.0E+10;
164
165 if(tacReadModelingData(tacfile, inpfile, NULL, NULL, &fitdur, 0,
166 &fitSampleNr, &tac, &input, &status)!=TPCERROR_OK) {
167 fprintf(stderr, "Error: %s\n", errorMsg(status.error));
168 tacFree(&tac); tacFree(&input); return(2);
169 }
170 if(verbose>2) {
171 printf("fileformat := %s\n", tacFormattxt(tac.format));
172 printf("tacNr := %d\n", tac.tacNr);
173 printf("tac.sampleNr := %d\n", tac.sampleNr);
174 printf("input.sampleNr := %d\n", input.sampleNr);
175 printf("fitSampleNr := %d\n", fitSampleNr);
176 printf("xunit := %s\n", unitName(tac.tunit));
177 printf("yunit := %s\n", unitName(tac.cunit));
178 printf("fitdur := %g s\n", fitdur);
179 }
180
181 /* Get the indices of line fit range */
182 int istart=doubleGEIndex(tac.x, fitSampleNr, tstart);
183 int istop=doubleGTIndex(tac.x, fitSampleNr, tstop) - 1;
184 if(verbose>3) {
185 printf("istart := %d\n", istart);
186 printf("istop := %d\n", istop);
187 }
188 int fitNr=1+istop-istart;
189 if(fitNr<2) {
190 fprintf(stderr, "Error: invalid line fit range.\n");
191 tacFree(&tac); tacFree(&input); return(2);
192 }
193
194
195 /*
196 * Interpolate and integrate PTAC to TTAC times
197 */
198 if(verbose>1) printf("integrating and interpolating input TAC\n");
199 TAC input0; tacInit(&input0); // interpolated PTAC
200 TAC input1; tacInit(&input1); // 1st integral
201 if(tacInterpolate(&input, &tac, &input0, &input1, NULL, &status)!=TPCERROR_OK) {
202 fprintf(stderr, "Error: %s\n", errorMsg(status.error));
203 tacFree(&tac); tacFree(&input); tacFree(&input0); tacFree(&input1);
204 return(3);
205 }
206 /* Original input TAC should not be needed any more */
207 tacFree(&input);
208
209 /* Integrate TTAC */
210 if(verbose>1) printf("integrating TTAC\n");
211 TAC tac1; tacInit(&tac1); // 1st integral
212 if(tacInterpolate(&tac, &tac, NULL, &tac1, NULL, &status)!=TPCERROR_OK) {
213 fprintf(stderr, "Error: %s\n", errorMsg(status.error));
214 tacFree(&tac); tacFree(&input0); tacFree(&input1); tacFree(&tac1);
215 return(3);
216 }
217
218
219
220 /*
221 * Prepare the room for parameters.
222 */
223 if(verbose>1) {printf("initializing parameter data\n"); fflush(stdout);}
224 PAR par; parInit(&par);
225 if(parAllocateWithTAC(&par, &tac, 3, &status)!=TPCERROR_OK) {
226 fprintf(stderr, "Error: %s\n", errorMsg(status.error));
227 tacFree(&tac); tacFree(&input0); tacFree(&input1); tacFree(&tac1);
228 return(4);
229 }
230 iftFree(&par.h); // remove stupid header info
231 /* Copy titles & file names */
232 {
233 int i;
234 char buf[256];
235 time_t t=time(NULL);
236 /* set program name */
237 tpcProgramName(argv[0], 1, 1, buf, 256);
238 iftPut(&par.h, "program", buf, 0, NULL);
239 /* set file names */
240 iftPut(&par.h, "datafile", tacfile, 0, NULL);
241 iftPut(&par.h, "inputfile", inpfile, 0, NULL);
242 /* Study number */
243 if(tacGetHeaderStudynr(&tac.h, buf, NULL)==TPCERROR_OK)
244 iftPut(&par.h, "study_number", buf, 0, NULL);
245 /* Model */
246 iftPut(&par.h, "model", "Yokoi plot", 0, NULL);
247 /* Set current time to results */
248 iftPut(&par.h, "analysis_time", ctime_r_int(&t, buf), 0, NULL);
249 /* Set the parameter names and units */
250 par.parNr=3;
251 i=0; strcpy(par.n[i].name,"K1"); par.n[i].unit=UNIT_ML_PER_ML_MIN;
252 i++; strcpy(par.n[i].name,"k2"); par.n[i].unit=UNIT_PER_MIN;
253 i++; strcpy(par.n[i].name,"K1/k2");
254 }
255
256 /*
257 * Prepare the room for plots
258 */
259 MTAC plots; mtacInit(&plots);
260 if(mtacAllocate(&plots, tac.tacNr)!=TPCERROR_OK) {
261 fprintf(stderr, "Error: cannot allocate space for plots.\n");
262 tacFree(&tac); tacFree(&input0); tacFree(&input1); tacFree(&tac1); parFree(&par);
263 return(5);
264 }
265
266
267
268 /*
269 * Analyse each regional TTAC
270 */
271 if(verbose>1) {printf("\ncalculating one TTAC at a time...\n"); fflush(stdout);}
272 int okNr=0;
273 for(int ti=0; ti<tac.tacNr; ti++) {
274 if(verbose>2 && tac.tacNr>1) {printf("Region %d %s\n", 1+ti, tac.c[ti].name); fflush(stdout);}
275 /* Calculate plot x axis */
276 double plotx[fitSampleNr];
277 for(int i=0; i<fitSampleNr; i++) plotx[i]=tac1.c[ti].y[i]/input1.c[0].y[i];
278 /* Calculate plot y axis */
279 double ploty[fitSampleNr];
280 for(int i=0; i<fitSampleNr; i++) ploty[i]=tac.c[ti].y[i]/input1.c[0].y[i];
281 if(verbose>4) {
282 printf("\tX\tY\tCt\tiCt\tiCp\tT\n");
283 for(int i=0; i<fitSampleNr; i++) if(i>=istart && i<=istop)
284 printf("\t%.3g\t%.3g\t%.3g\t%.3g\t%.3g\t%g\n", plotx[i], ploty[i], tac.c[ti].y[i],
285 tac1.c[ti].y[i], input1.c[0].y[i], tac.x[i]);
286 }
287 /* Fit regression line */
288 double slope, ic, slope_sd, ic_sd, xic, xic_sd, y_sd;
289 int n;
290 if(save_stat==0)
291 n=fitLine(plotx+istart, ploty+istart, fitNr, &slope, &ic);
292 else
293 n=fitLinePearson(plotx+istart, ploty+istart, fitNr,
294 &slope, &slope_sd, &ic, &ic_sd, &xic, &xic_sd, NULL, &y_sd);
295 if(n==0 || isnan(slope) || isnan(ic)) {
296 fprintf(stderr, "Error: cannot fit %s\n", tac.c[ti].name); fflush(stderr);
297 continue;
298 }
299 par.r[ti].p[0]=ic;
300 par.r[ti].p[1]=-slope;
301 par.r[ti].p[2]=-ic/slope;
302 if(save_stat!=0) {
303 par.r[ti].sd[0]=ic_sd;
304 par.r[ti].sd[1]=slope_sd;
305 par.r[ti].sd[2]=xic_sd;
306 }
307 par.r[ti].dataNr=n;
308 par.r[ti].start=tac.x[istart];
309 par.r[ti].end=tac.x[istop];
310 par.r[ti].fitNr=2;
311
312 /* Store the data for plots */
313 if(tacAllocate(&plots.tac[plots.nr], fitSampleNr, 3)!=TPCERROR_OK) {
314 fprintf(stderr, "Error: cannot copy plot data.\n"); fflush(stderr);
315 continue;
316 }
317 plots.tac[plots.nr].sampleNr=fitSampleNr;
318 plots.tac[plots.nr].tacNr=3;
319 for(int i=0; i<fitSampleNr; i++)
320 if(isfinite(plotx[i])) plots.tac[plots.nr].x[i]=plotx[i];
321 else plots.tac[plots.nr].x[i]=nan("");
322 strcpy(plots.tac[plots.nr].c[0].name, tac.c[ti].name);
323 strcpy(plots.tac[plots.nr].c[1].name, tac.c[ti].name);
324 for(int i=0; i<fitSampleNr; i++) {
325 plots.tac[plots.nr].c[0].y[i]=plots.tac[plots.nr].c[1].y[i]=nan("");
326 if(isfinite(ploty[i])) {
327 if(i>=istart && i<=istop) plots.tac[plots.nr].c[0].y[i]=ploty[i];
328 else plots.tac[plots.nr].c[1].y[i]=ploty[i];
329 }
330 /* Regression line point */
331 plots.tac[plots.nr].c[2].y[i]=ic+slope*plotx[i];
332 }
333 plots.nr++;
334 okNr++;
335 } // next TAC
336 if(okNr==0) {
337 fprintf(stderr, "Error: cannot calculate Yokoi MTGA.\n");
338 tacFree(&tac); tacFree(&input0); tacFree(&input1); tacFree(&tac1); parFree(&par);
339 mtacFree(&plots); return(8);
340 }
341 if(verbose>1) {printf("... done.\n"); fflush(stdout);}
342
343 /*
344 * Print parameters on screen
345 */
346 if(verbose>0 && par.tacNr<80) parWrite(&par, stdout, PAR_FORMAT_TSV_UK, 0, &status);
347
348
349 /*
350 * Save CM results
351 */
352 {
353 if(verbose>1) {printf("writing %s\n", resfile); fflush(stdout);}
354 int ret=TPCERROR_FAIL;
355 par.format=parFormatFromExtension(resfile);
356 if(verbose>2) printf("result file format := %s\n", parFormattxt(par.format));
358 FILE *fp; fp=fopen(resfile, "w");
359 if(fp==NULL) {
360 fprintf(stderr, "Error: cannot open file for writing parameters.\n");
361 } else {
362 ret=parWrite(&par, fp, PAR_FORMAT_UNKNOWN, 1, &status);
363 fclose(fp);
364 if(ret!=TPCERROR_OK) fprintf(stderr, "Error: %s\n", errorMsg(status.error));
365 }
366 if(ret!=TPCERROR_OK) {
367 tacFree(&tac); tacFree(&input0); tacFree(&input1); tacFree(&tac1); parFree(&par);
368 mtacFree(&plots); return(11);
369 }
370 if(verbose>0) {printf("Results saved in %s.\n", resfile); fflush(stdout);}
371 }
372
373
374 /*
375 * Write plot data, if requested
376 */
377 if(plotfile[0]) {
378 if(verbose>1) {printf("writing %s\n", plotfile); fflush(stdout);}
379 FILE *fp; fp=fopen(plotfile, "w");
380 if(fp==NULL) {
381 fprintf(stderr, "Error: cannot open file for writing plot data.\n");
382 tacFree(&tac); tacFree(&input0); tacFree(&input1); tacFree(&tac1); parFree(&par);
383 mtacFree(&plots); return(12);
384 }
385 fprintf(fp, "Yokoi plot");
386 char buf[256];
387 if(tacGetHeaderStudynr(&par.h, buf, NULL)==TPCERROR_OK) fprintf(fp, "\t%s", buf);
388 fprintf(fp, "\n");
389 for(int ti=0; ti<plots.nr; ti++) if(plots.tac[ti].sampleNr>0) {
390 fprintf(fp, "\n%s\n", plots.tac[ti].c[0].name);
391 fprintf(fp, "X\tFitted\tIgnored\tRegression\n");
392 for(int i=0; i<plots.tac[ti].sampleNr; i++) {
393 if(isfinite(plots.tac[ti].x[i])) fprintf(fp, "%g", plots.tac[ti].x[i]);
394 fprintf(fp, "\t");
395 if(isfinite(plots.tac[ti].c[0].y[i])) fprintf(fp, "%g", plots.tac[ti].c[0].y[i]);
396 fprintf(fp, "\t");
397 if(isfinite(plots.tac[ti].c[1].y[i])) fprintf(fp, "%g", plots.tac[ti].c[1].y[i]);
398 fprintf(fp, "\t");
399 if(isfinite(plots.tac[ti].c[2].y[i])) fprintf(fp, "%g", plots.tac[ti].c[2].y[i]);
400 fprintf(fp, "\n");
401 }
402 }
403 fclose(fp);
404 if(verbose>0) {printf("Plot data saved in %s.\n", plotfile); fflush(stdout);}
405 }
406
407
408 /*
409 * Write SVG plot, if requested
410 */
411 if(svgfile[0]) {
412 if(verbose>1) {printf("writing %s\n", svgfile); fflush(stdout);}
413 char mtitle[256]; strcpy(mtitle, "Yokoi plot");
414 char buf[256];
415 if(tacGetHeaderStudynr(&par.h, buf, NULL)==TPCERROR_OK) {
416 strcat(mtitle, " "); strcat(mtitle, buf);
417 }
418 if(mtgaPlotSVG(&plots, mtitle, svgfile, &status)!=TPCERROR_OK) {
419 fprintf(stderr, "Error: %s\n", errorMsg(status.error));
420 tacFree(&tac); tacFree(&input0); tacFree(&input1); tacFree(&tac1); parFree(&par);
421 mtacFree(&plots);
422 return(13);
423 }
424 if(verbose>0) {printf("Plot saved in %s.\n", svgfile); fflush(stdout);}
425 }
426
427
428 tacFree(&tac); tacFree(&input0); tacFree(&input1); tacFree(&tac1); parFree(&par);
429 mtacFree(&plots);
430 return(0);
431}
432/*****************************************************************************/
433
434/*****************************************************************************/
char * ctime_r_int(const time_t *t, char *buf)
Convert calendar time t into a null-terminated string of the form YYYY-MM-DD hh:mm:ss,...
Definition datetime.c:119
int atofCheck(const char *s, double *v)
Definition decpoint.c:94
unsigned int doubleGEIndex(double *a, const unsigned int n, double lim)
Definition doubleutil.c:435
unsigned int doubleGTIndex(double *a, const unsigned int n, double lim)
Definition doubleutil.c:452
void iftFree(IFT *ift)
Definition ift.c:37
int iftPut(IFT *ift, const char *key, const char *value, char comment, TPCSTATUS *status)
Definition ift.c:63
int tacInterpolate(TAC *inp, TAC *xinp, TAC *tac, TAC *itac, TAC *iitac, TPCSTATUS *status)
Interpolate and/or integrate TACs from one TAC structure into a new TAC structure,...
Definition litac.c:141
int mtacAllocate(MTAC *mtac, int nr)
Definition mtac.c:56
void mtacFree(MTAC *mtac)
Definition mtac.c:38
void mtacInit(MTAC *mtac)
Definition mtac.c:23
void parFree(PAR *par)
Definition par.c:75
void parInit(PAR *par)
Definition par.c:25
char * parFormattxt(parformat c)
Definition pario.c:59
int parWrite(PAR *par, FILE *fp, parformat format, int extra, TPCSTATUS *status)
Definition pario.c:148
int parFormatFromExtension(const char *s)
Definition pario.c:102
int parAllocateWithTAC(PAR *par, TAC *tac, int parNr, TPCSTATUS *status)
Allocate PAR based on data in TAC.
Definition partac.c:90
int tpcProcessStdOptions(const char *s, int *print_usage, int *print_version, int *verbose_level)
Definition proginfo.c:47
void tpcProgramName(const char *program, int version, int copyright, char *prname, int n)
Definition proginfo.c:406
int tpcYesNo(const char *s)
Definition proginfo.c:459
int tpcHtmlUsage(const char *program, char *text[], const char *path)
Definition proginfo.c:169
void tpcPrintBuild(const char *program, FILE *fp)
Definition proginfo.c:339
void tpcPrintUsage(const char *program, char *text[], FILE *fp)
Definition proginfo.c:114
int fitLinePearson(double *x, double *y, const int n, double *m, double *msd, double *c, double *csd, double *d, double *dsd, double *r, double *ysd)
Definition regression.c:72
int fitLine(double *x, double *y, const int n, double *m, double *c)
Definition regression.c:23
void statusInit(TPCSTATUS *s)
Definition statusmsg.c:104
char * errorMsg(tpcerror e)
Definition statusmsg.c:68
void statusSet(TPCSTATUS *s, const char *func, const char *srcfile, int srcline, tpcerror error)
Definition statusmsg.c:142
size_t strlcpy(char *dst, const char *src, size_t dstsize)
Definition stringext.c:632
Definition tpctac.h:149
TAC * tac
Definition tpctac.h:151
int nr
Definition tpctac.h:153
Definition tpcpar.h:100
int format
Definition tpcpar.h:102
IFT h
Optional (but often useful) header information.
Definition tpcpar.h:147
int parNr
Definition tpcpar.h:108
int tacNr
Definition tpcpar.h:104
PARR * r
Definition tpcpar.h:114
PARN * n
Definition tpcpar.h:112
int unit
Definition tpcpar.h:86
char name[MAX_PARNAME_LEN+1]
Definition tpcpar.h:82
int fitNr
Definition tpcpar.h:58
int dataNr
Definition tpcpar.h:62
double * p
Definition tpcpar.h:64
double start
Definition tpcpar.h:52
double * sd
Definition tpcpar.h:66
double end
Definition tpcpar.h:54
char name[MAX_TACNAME_LEN+1]
Definition tpctac.h:81
double * y
Definition tpctac.h:75
Definition tpctac.h:87
double * x
Definition tpctac.h:97
unit cunit
Definition tpctac.h:105
tacformat format
Definition tpctac.h:93
int sampleNr
Definition tpctac.h:89
IFT h
Optional (but often useful) header information.
Definition tpctac.h:141
TACC * c
Definition tpctac.h:117
unit tunit
Definition tpctac.h:109
int tacNr
Definition tpctac.h:91
int verbose
Verbose level, used by statusPrint() etc.
tpcerror error
Error code.
void tacFree(TAC *tac)
Definition tac.c:106
int tacAllocate(TAC *tac, int sampleNr, int tacNr)
Definition tac.c:130
void tacInit(TAC *tac)
Definition tac.c:24
int mtgaPlotSVG(MTAC *mtac, const char *main_title, const char *fname, TPCSTATUS *status)
Definition tacfitplot.c:489
int tacGetHeaderStudynr(IFT *h, char *s, TPCSTATUS *status)
Definition tacift.c:26
char * tacFormattxt(tacformat c)
Definition tacio.c:98
int tacReadModelingData(const char *tissuefile, const char *inputfile1, const char *inputfile2, const char *inputfile3, double *fitdur, int cutInput, int *fitSampleNr, TAC *tis, TAC *inp, TPCSTATUS *status)
Read tissue and input data for modelling.
Header file for library libtpcextensions.
@ UNIT_ML_PER_ML_MIN
mL/(mL*min)
@ UNIT_PER_MIN
1/min
@ TPCERROR_FAIL
General error.
@ TPCERROR_OK
No error.
char * unitName(int unit_code)
Definition units.c:143
Header file for libtpcli.
Header file for libtpclinopt.
Header file for libtpcpar.
@ PAR_FORMAT_UNKNOWN
Unknown format.
Definition tpcpar.h:28
@ PAR_FORMAT_TSV_UK
UK TSV (point as decimal separator).
Definition tpcpar.h:35
Header file for library libtpctac.
Header file for libtpctacmod.