11#include "tpcclibConfig.h"
27static char *info[] = {
28 "Calculate the distribution volume (Vt) or distribution volume ratio (DVR)",
29 "using multiple-time graphical analysis (MTGA) for reversible PET",
30 "ligands (Logan plot) (1,2,3) from regional PET time-activity curves (TTACs).",
32 "Usage: @P [Options] ttac_file input start_time end_time result_file",
34 "Input can be either a TAC file containing arterial plasma PTAC or reference",
35 "region TAC, or name or number of reference region in the TTAC file.",
36 "Start and end times of the line fit to the plot must be given in minutes.",
39 " -k2=<reference region k2>",
40 " With reference region input, the population average of reference",
41 " region k2 (or k2/(1+k5/k6) in 3-compartment model) is set.",
43 " With reference input, BPnd (=DVR-1) is reported instead of DVR",
44 " -BPnd=<reference region name>",
45 " With plasma input, BPnd can be calculated as DVroi/DVref-1",
46 " -DVR=<reference region name>",
47 " With plasma input, DVR can be calculated as DVroi/DVref",
48 " -BPp=<reference region name>",
49 " With plasma input, BPp can be calculated as DVroi-DVref",
51 " Standard deviations are saved (y, default) or not saved (n) in results.",
53 " Mid frame times are used (y) or not used (n, default) even if frame",
54 " start and end times are available. For compatibility with old software.",
56 " Plots are written in specified file in Scalable Vector Graphics (SVG) 1.1",
57 " format; specification in https://www.w3.org/TR/SVG/",
59 " Black-and-white plot.",
60 " -plotdata=<Filename>",
61 " Data for plots is written in specified file in XHTML table format for",
62 " easy importing in Excel or OpenOffice spreadsheet, where the data can",
63 " be viewed; if file name extension is .dft, data is written in DFT format.",
66 "Options for selecting the least-squares line fit method:",
67 " -C Traditional regression model",
68 " -M Median of two-point slopes and intercepts (Cornish-Bowden)",
69 " -P Perpendicular regression model (4)",
70 " -R Iterative method (York 1966, Lybanon 1984, Reed 1992); default",
71 " If tissue file contains weights, the iterative method (-R) is weighted.",
72 " With other fitting methods the weights are not used.",
73 " With options -C and -R program can automatically find the linear plot",
74 " range, if fit start time is set to zero.",
76 "Example 1: tissue curves are in ut2345.tac and plasma curve in ut2345ap.dat;",
77 "fitted data range is from 10 to 60 min; standard deviations are not needed,",
78 "plot is saved in file ut2345logan.svg",
79 " @P -sd=n -svg=ut2345logan.svg ut2345.tac ut2345ap.dat 10 60 ut2345.res",
81 "Example 2: tissue curves in ut1234.tac, including reference region 'cer';",
82 "reference tissue k2 is assumed to equal 0.163",
83 " @P -k2=0.163 ut2345.tac cer 20 60 ut2345.res",
86 "1. Logan J, Fowler JS, Volkow ND, Wolf AP, Dewey SL, Schlyer DJ,",
87 " MacGregor RR, Hitzemann R, Bendriem B, Gatley SJ, Christman DR.",
88 " Graphical analysis of reversible radioligand binding from time-activity",
89 " measurements applied to [N-11C-methyl]-(-)-cocaine PET studies in human",
90 " subjects. J Cereb Blood Flow Metab 1990; 10: 740-747.",
91 "2. Logan J, Fowler JS, Volkow ND, Wang GJ, Ding YS, Alexoff DL.",
92 " Distribution volume ratios without blood sampling from graphical",
93 " analysis of PET data. J Cereb Blood Flow Metab. 1996; 16: 834-840.",
94 "3. Logan J. Graphical analysis of PET data applied to reversible and",
95 " irreversible tracers. Nucl Med Biol 2000; 27:661-670.",
96 "4. Varga J & Szabo Z. Modified regression model for the Logan plot.",
97 " J Cereb Blood Flow Metab 2002; 22:240-244.",
99 "See also: imgdv, fitk2, fitk4, patlak, rescoll",
101 "Keywords: TAC, MTGA, Logan plot, modelling, distribution volume, DVR",
108 double *x,
double *y,
double *wx,
double *wy,
int nr,
int min_nr,
109 double *slope,
double *ic,
double *nwss,
double *sslope,
double *sic,
110 double *cx,
double *cy,
int *bnr,
int verbose
113 double *x,
double *y,
double *wx,
double *wy,
int nr,
int min_nr,
114 double *slope,
double *ic,
double *r,
double *sslope,
double *sic,
int *bnr,
123int main(
int argc,
char **argv)
125 int ai, help=0, version=0, verbose=1;
128 int inputtype=0, dataNr=0, first, last, llsq_model=1;
129 int save_stat=1, dvr_roi=-1, n, always_mid=0;
133 char dfile[FILENAME_MAX], ifile[FILENAME_MAX], rfile[FILENAME_MAX],
134 pfile[FILENAME_MAX], sfile[FILENAME_MAX],
135 dvrname[FILENAME_MAX], tmp[1024], *cptr;
136 double tstart, tstop, DV, DVSD, Ic, IcSD, SWSS;
141 double *ci, *ici, *ct, *ict;
150 if(argc==1) {
tpcPrintUsage(argv[0], info, stderr);
return(1);}
151 dfile[0]=ifile[0]=rfile[0]=pfile[0]=sfile[0]=dvrname[0]=(char)0;
154 for(ai=1; ai<argc; ai++)
if(*argv[ai]==
'-') {
155 cptr=argv[ai]+1;
if(*cptr==
'-') cptr++;
if(cptr==NULL)
continue;
158 if(strncasecmp(cptr,
"K2=", 3)==0) {
159 k2=
atof_dpi(cptr+3);
if(k2>0.0)
continue;
160 }
else if(strncasecmp(cptr,
"DVR=", 4)==0) {
161 bp_type=1; strcpy(dvrname, cptr+4);
if(strlen(dvrname)>0.0)
continue;
162 }
else if(strcasecmp(cptr,
"BPnd")==0) {
163 dvr_minus_one=1;
continue;
164 }
else if(strncasecmp(cptr,
"BPnd=", 5)==0) {
165 bp_type=2; strcpy(dvrname, cptr+5);
if(strlen(dvrname)>0.0)
continue;
166 }
else if(strncasecmp(cptr,
"BPp=", 4)==0||strncasecmp(cptr,
"DV3=", 4)==0){
167 bp_type=3; strcpy(dvrname, cptr+4);
if(strlen(dvrname)>0.0)
continue;
168 }
else if(strncasecmp(cptr,
"SD=", 3)==0) {
169 save_stat=1; cptr+=3;
if(strlen(cptr)<1)
continue;
170 if(strncasecmp(cptr,
"yes", 1)==0) {save_stat=1;
continue;}
171 else if(strncasecmp(cptr,
"no", 1)==0) {save_stat=0;
continue;}
172 }
else if(strncasecmp(cptr,
"MID", 3)==0) {
173 always_mid=1; cptr+=3;
if(strlen(cptr)<2)
continue;
174 if(*cptr==
'=') cptr++;
175 if(strncasecmp(cptr,
"yes", 1)==0) {
176 always_mid=1;
continue;
177 }
else if(strncasecmp(cptr,
"no", 1)==0) {
178 always_mid=0;
continue;
180 }
else if(strncasecmp(cptr,
"SVG=", 4)==0) {
181 strlcpy(sfile, cptr+4, FILENAME_MAX);
if(strlen(sfile)>0)
continue;
182 }
else if(strncasecmp(cptr,
"PLOTDATA=", 9)==0) {
183 strlcpy(pfile, cptr+9, FILENAME_MAX);
if(strlen(pfile)>0)
continue;
185 }
else if(strcasecmp(cptr,
"C")==0) {
186 llsq_model=0;
continue;
187 }
else if(strcasecmp(cptr,
"R")==0) {
188 llsq_model=1;
continue;
189 }
else if(strcasecmp(cptr,
"P")==0) {
190 llsq_model=2;
continue;
191 }
else if(strcasecmp(cptr,
"M")==0) {
192 llsq_model=0;
continue;
193 }
else if(strcasecmp(cptr,
"BW")==0) {
194 color_scale=2;
continue;
196 fprintf(stderr,
"Error: invalid option '%s'.\n", argv[ai]);
201 if(help==2) {
tpcHtmlUsage(argv[0], info,
"");
return(0);}
206 for(; ai<argc; ai++) {
207 if(!dfile[0]) {
strlcpy(dfile, argv[ai], FILENAME_MAX);
continue;}
208 if(!ifile[0]) {
strlcpy(ifile, argv[ai], FILENAME_MAX);
continue;}
209 if(tstart<0) {tstart=
atof_dpi(argv[ai]);
continue;}
210 if(tstop<0) {tstop=
atof_dpi(argv[ai]);
continue;}
211 if(!rfile[0]) {
strlcpy(rfile, argv[ai], FILENAME_MAX);
continue;}
212 if(!pfile[0]) {
strlcpy(pfile, argv[ai], FILENAME_MAX);
continue;}
213 fprintf(stderr,
"Error: invalid argument '%s'.\n", argv[ai]);
219 fprintf(stderr,
"Error: missing result file name.\n");
223 fprintf(stderr,
"Error: illegal time range %g-%g\n", tstart, tstop);
227 if(dvrname[0] && k2>0.0) {
228 fprintf(stderr,
"Error: use options -DVR, -BPnd and -BPp only with plasma input.\n");
234 printf(
"%s", argv[0]);
for(ai=1; ai<argc; ai++) printf(
" %s", argv[ai]);
238 printf(
"llsq_model := %d\n", llsq_model);
239 printf(
"dfile := %s\n", dfile);
240 printf(
"pfile := %s\n", pfile);
241 printf(
"rfile := %s\n", rfile);
242 printf(
"ifile := %s\n", ifile);
243 printf(
"sfile := %s\n", sfile);
244 printf(
"tstart := %g\ntstop := %g\n", tstart, tstop);
245 printf(
"always_mid := %d\n", always_mid);
246 printf(
"k2 := %g\n", k2);
247 printf(
"bp_type := %d\n", bp_type);
248 printf(
"dvr_minus_one := %d\n", dvr_minus_one);
249 printf(
"dvrname := %s\n", dvrname);
250 if(color_scale==2) printf(
"color_scale := black-and-white\n");
258 if(verbose>1) printf(
"reading %s\n", dfile);
260 fprintf(stderr,
"Error in reading '%s': %s\n", dfile,
dfterrmsg);
267 fprintf(stderr,
"Error: missing values in %s\n", dfile);
274 if(verbose>1) fprintf(stdout,
"checking frame overlap in %s\n", dfile);
277 fprintf(stderr,
"Error: %s has overlapping frame times.\n", dfile);
283 if(ret) fprintf(stderr,
284 "Warning: check that regional data times are in minutes.\n");
288 printf(
"dataNr_in_range := %d\n", dataNr);
289 printf(
"first_in_range := %d\n", first);
290 printf(
"last_in_range := %d\n", last);
293 fprintf(stderr,
"Error: data does not contain the specified time range.\n");
295 }
else if(dataNr<2) {
296 fprintf(stderr,
"Error: cannot make plot from less than 2 points.\n");
298 }
else if(dataNr==2) {
299 fprintf(stderr,
"Warning: only two samples in the time range.\n");
302 printf(
"dataNr := %d\n", dataNr);
303 printf(
"tstart := %g\ntstop := %g\n", tstart, tstop);
304 printf(
"first := %d\nlast := %d\n", first, last);
313 if(verbose>1) printf(
"reading input\n");
314 if((ret=
dftReadinput(&input, &data, ifile, &inputtype, &istart,
315 NULL, 1, tmp, verbose-6))) {
317 if(inputtype==5) fprintf(stderr,
"Error: %s.\n", tmp);
318 else fprintf(stderr,
"Error in reading '%s': %s\n", ifile, tmp);
319 dftEmpty(&data); fflush(stderr);
return(3);
324 if(verbose>1) printf(
"trying to fix tissue frame nr.\n");
326 if(((ret=
dftReadinput(&input, &data, ifile, &inputtype, &istart, NULL, 1, tmp, verbose-6)))!=0)
328 fprintf(stderr,
"Error in reading '%s': %s\n", ifile, tmp);
329 if(verbose>0) printf(
"dftReadinput() := %d\n", ret);
335 printf(
"\nInput data:\n");
337 printf(
"\nTissue data:\n");
341 if(verbose>0) fprintf(stdout,
"selected reference region := %s\n", input.
voi[0].
name);
342 for(ri=1; ri<input.
voiNr; ri++)
343 fprintf(stderr,
"Warning: reference region %s unused.\n", input.
voi[ri].
name);
345 if(input.
voiNr>1) fprintf(stderr,
"Warning: only the first of input curves is used.\n");
347 if(inputtype!=5 && k2>0.0) {
348 fprintf(stderr,
"Error: reference region k2 must be used only with reference tissue.\n");
355 fprintf(stderr,
"Warning: input TAC should start at time zero.\n");
363 if(verbose>1) {printf(
"integrating tissue data\n"); fflush(stdout);}
364 for(ri=0; ri<data.
voiNr; ri++) {
370 fprintf(stderr,
"Error in integration of tissue data.\n");
382 if(verbose>1) printf(
"selecting reference curve\n");
385 fprintf(stderr,
"Error: Cannot find ref voi '%s'.\n", dvrname);
391 fprintf(stderr,
"Error: Cannot find ref voi '%s'.\n", dvrname);
395 fprintf(stderr,
"Warning: several ref regions match; %s is selected.\n",
398 for(ri=0; ri<data.
voiNr; ri++)
if(data.
voi[ri].
sw) {dvr_roi=ri;
break;}
401 printf(
"Reference region: %s (voi=%d)\n", data.
voi[dvr_roi].
name, dvr_roi);
410 if(verbose>1) printf(
"initializing result data\n");
412 fprintf(stderr,
"Error: cannot setup memory for results.\n");
433 if(k2>0) {sprintf(tmp,
" refk2=%g", k2); strcat(res.
datarange, tmp);}
435 if(llsq_model==0) strcpy(res.
fitmethod,
"Traditional regression model");
436 else if(llsq_model==1) strcpy(res.
fitmethod,
"Iterative method");
437 else if(llsq_model==2) strcpy(res.
fitmethod,
"Perpendicular regression model");
438 else if(llsq_model==3) strcpy(res.
fitmethod,
"Median of two-point slopes");
447 if(dvr_minus_one==0) strcpy(res.
parname[pi],
"DVR");
448 else strcpy(res.
parname[pi],
"BPnd");
458 if(llsq_model==1 || llsq_model==3) {
459 strcpy(res.
parname[pi],
"SqrtWSS");
461 }
else if(llsq_model==0) {
464 }
else if(llsq_model==2) {
465 strcpy(res.
parname[pi],
"SSD");
469 if(dvrname[0] && bp_type>0) {
472 strcpy(res.
parname[pi],
"DVR");
474 }
else if(bp_type==2) {
475 strcpy(res.
parname[pi],
"BPnd");
478 strcpy(res.
parname[pi],
"BPp");
501 for(ri=0; ri<data.
voiNr; ri++) {
502 if(verbose>2) printf(
"calculating %s\n", data.
voi[ri].
name);
508 for(fi=0; fi<data.
frameNr; fi++) {
509 if(data.
isweight) wx[fi]=wy[fi]=data.
w[fi];
else wx[fi]=wy[fi]=1.0;
511 wx[fi]*=data.
x2[fi];
else wx[fi]*=data.
x[fi];
517 theta=data.
voi[ri].
y2;
521 for(fi=data.
frameNr-1; fi>=0; fi--)
if(ct[fi]!=0.0) {
523 printf(
"%03d %8.3f : ici=%g ci=%g ict=%g ct=%g\n",
524 fi+1, data.
x[fi], ici[fi], ci[fi], ict[fi], ct[fi] );
527 dv[fi]=ict[fi]/ct[fi];
529 if(k2>0) theta[fi]=(ici[fi]+ci[fi]/k2)/ct[fi];
530 else theta[fi]=ici[fi]/ct[fi];
532 if(data.
x[fi]<0.1*data.
x[data.
frameNr-1]) {
533 if(theta[fi]>theta[data.
frameNr-1] || dv[fi]>dv[data.
frameNr-1]) {
535 printf(
"Possible close-to-zero plot point at %g -> set to zero.\n", data.
x[fi]);
536 theta[fi]=dv[fi]=wx[fi]=wy[fi]=0.0;
539 }
else theta[fi]=dv[fi]=wx[fi]=wy[fi]=0.0;
542 for(fi=first; fi<=last; fi++)
543 printf(
"%03d %8.3f : %g %g (%g %g)\n",
544 fi+1, data.
x[fi], theta[fi], dv[fi], wx[fi], wy[fi] );
548 DVSD=DV=Ic=IcSD=SWSS=0.0; ret=0;
553 &theta[first], &dv[first], &wx[first], &wy[first], dataNr, 5,
554 &DV, &Ic, &SWSS, &DVSD, &IcSD, cx, cy, &fi, verbose-4
556 if(verbose>7) printf(
"Min NWSS with %d data points.\n", fi);
562 &theta[first], &dv[first], dataNr, &wx[first], &wy[first],
567 &Ic, &DV, &SWSS, &IcSD, &DVSD, cx, cy
571 printf(
"%s:\n", data.
voi[ri].
name);
572 for(fi=first; fi<=last; fi++)
573 printf(
"%03d %8.3f : %g %g (%g %g -> %g)\n",
574 fi+1, data.
x[fi], theta[fi], dv[fi], wx[fi], wy[fi], w[fi] );
576 }
else if(llsq_model==2) {
578 for(fi=first; fi<=last; fi++)
if(theta[fi]<0.0) theta[fi]=nan(
"");
582 &theta[first], &dv[first], dataNr,
586 }
else if(llsq_model==0) {
590 &theta[first], &dv[first], &wx[first], &wy[first], dataNr, 5,
591 &DV, &Ic, &SWSS, &DVSD, &IcSD, &fi, verbose-4
596 for(fi=first; fi<=last; fi++)
if(theta[fi]<0.0) theta[fi]=nan(
"");
600 &theta[first], &dv[first], dataNr,
602 &DV, &DVSD, &Ic, &IcSD, &SWSS, &f
605 }
else if(llsq_model==3) {
607 for(fi=first; fi<=last; fi++)
if(theta[fi]<0.0) theta[fi]=nan(
"");
610 &theta[first], &dv[first], dataNr, &DV, &Ic
615 if(inputtype==5 && dvr_minus_one!=0) {
620 if(verbose>2) printf(
"DV := %g (%g)\n", DV, DVSD);
622 fprintf(stderr,
"Error (%d) in linear fit of %s\n", ret, data.
voi[ri].
name);
628 for(ri=0; ri<data.
voiNr; ri++) {
644 else fprintf(stdout,
"Logan plot calculated from %d regional TACs.\n", res.
voiNr);
650 for(fi=first; fi<=last; fi++)
651 printf(
"%03d %8.3f : %g %g\n", fi+1, data.
x[fi], data.
voi[ri].
y2[fi], data.
voi[ri].
y3[fi] );
658 if(verbose>0) printf(
"saving results\n");
659 ret=
resWrite(&res, rfile, verbose-3);
661 fprintf(stderr,
"Error in writing '%s': %s\n", rfile,
reserrmsg);
671 if(inputtype==5 && dvr_minus_one!=0) {
676 if(verbose>0) printf(
"saving plots\n");
677 sprintf(tmp,
"Logan-plot ");
679 ret=
plotdata(&data, &res, first, last, tmp,
680 "Input integral / Tissue",
"Tissue integral / Tissue", pfile);
682 fprintf(stderr,
"Error in writing '%s': %s\n", pfile,
reserrmsg);
686 if(verbose>=0) printf(
"Plots written in %s\n", pfile);
690 if(verbose>0) printf(
"saving SVG plot\n");
691 sprintf(tmp,
"Logan-plot ");
694 ret=
plot_svg(&data, &res, first, last, tmp,
695 "Input integral / Tissue",
"Tissue integral / Tissue", color_scale, sfile, verbose-8);
698 fprintf(stderr,
"Error (%d) in writing '%s'.\n", ret, sfile);
702 if(verbose>=0) printf(
"Plots written in %s\n", sfile);
749 int from, to, ret, from_min, to_min;
750 double *w, lic, lslope, lnwss, nwss_min;
752 if(verbose>0) printf(
"best_logan_reed()\n");
754 if(x==NULL || y==NULL || nr<min_nr || nr<2)
return(1);
756 if(min_nr<4)
return(2);
759 w=(
double*)malloc(nr*
sizeof(
double));
if(w==NULL)
return(3);
762 nwss_min=9.99E+99; from_min=to_min=-1;
763 for(from=0, to=nr-1; from<nr-min_nr; from++) {
764 ret=
llsqwt(x+from, y+from, (to-from)+1, wx+from, wy+from, 1.0E-10, w,
765 &lic, &lslope, &lnwss, NULL, NULL, cx+from, cy+from);
767 printf(
" range: %d-%d ; nwss=%g ; min=%g ; ret=%d\n",
768 from, to, lnwss, nwss_min, ret);
770 if(ret==0 && lslope>0.0 && lnwss<nwss_min) {
771 nwss_min=lnwss; from_min=from; to_min=to;}
773 if(from_min<0) {free(w);
return(5);}
777 from=from_min; to=to_min;
778 ret=
llsqwt(x+from, y+from, (to-from)+1, wx+from, wy+from, 1.0E-12, w,
779 ic, slope, nwss, sic, sslope, cx+from, cy+from);
780 free(w);
if(ret)
return(6);
820 int fi, from, to, ret, from_min, to_min, n;
821 double lic, lslope, lic_sd, lslope_sd, cv, cv_min, f;
824 if(verbose>0) printf(
"best_logan_regr()\n");
826 if(x==NULL || y==NULL || nr<min_nr || nr<2)
return(1);
828 if(min_nr<4)
return(2);
831 cx=(
double*)malloc(nr*
sizeof(
double));
832 cy=(
double*)malloc(nr*
sizeof(
double));
833 if(cx==NULL || cy==NULL)
return(3);
834 for(fi=n=0; fi<nr; fi++)
835 if(wx[fi]>0 && wy[fi]>0 && !isnan(x[fi]) && !isnan(y[fi])) {
836 cx[n]=x[fi]; cy[n]=y[fi]; n++;}
837 if(n<min_nr) {free(cx); free(cy);
return(4);}
840 cv_min=9.99E+99; from_min=to_min=-1;
841 for(from=0, to=n-1; from<n-min_nr; from++) {
844 cx+from, cy+from, (to-from)+1,
845 &lslope, &lslope_sd, &lic, &lic_sd, r, &f
847 if(ret==0 && lslope>0) {
851 cv_min=cv; from_min=from; to_min=to;}
853 if(from_min<0) {free(cx); free(cy);
return(5);}
856 from=from_min; to=to_min;
858 cx+from, cy+from, (to-from)+1,
859 slope, sslope, ic, sic, r, &f
861 free(cx); free(cy);
if(ret)
return(6);
double atof_dpi(char *str)
int dftDeleteFrameOverlap(DFT *dft)
int dftSelectBestReference(DFT *dft)
int dft_nr_of_NA(DFT *dft)
int dftSelectRegions(DFT *dft, char *region_name, int reset)
int dftRead(char *filename, DFT *data)
int res_allocate_with_dft(RES *res, DFT *dft)
int dftTimeunitConversion(DFT *dft, int tunit)
int fittime_from_dft(DFT *dft, double *startTime, double *endTime, int *first, int *last, int verbose)
int petintegral(double *x1, double *x2, double *y, int nr, double *ie, double *iie)
Integrate PET TAC data to frame mid times.
int integrate(double *x, double *y, int nr, double *yi)
Header file for libtpccurveio.
int resWrite(RES *res, char *filename, int verbose)
#define DFT_TIME_STARTEND
Header file for libtpcmisc.
int tpcProcessStdOptions(const char *s, int *print_usage, int *print_version, int *verbose_level)
int studynr_from_fname2(char *fname, char *studynr, int force)
char * petCunit(int cunit)
size_t strlcpy(char *dst, const char *src, size_t dstsize)
void tpcProgramName(const char *program, int version, int copyright, char *prname, int n)
char * petTunit(int tunit)
int tpcHtmlUsage(const char *program, char *text[], const char *path)
void tpcPrintBuild(const char *program, FILE *fp)
void tpcPrintUsage(const char *program, char *text[], FILE *fp)
Header file for libtpcmodel.
int llsqperp3(double *x, double *y, int nr, double *slope, double *ic, double *ssd)
int medianline(double *x, double *y, int nr, double *slope, double *ic)
int llsqwt(double *x, double *y, int n, double *wx, double *wy, double tol, double *w, double *ic, double *slope, double *nwss, double *sic, double *sslope, double *cx, double *cy)
int pearson(double *x, double *y, int nr, double *k, double *kSD, double *b, double *bSD, double *r, double *ySD)
int pearson3(double *x, double *y, int nr, double *k, double *kSD, double *b, double *bSD, double *r, double *ySD)
Header file for libtpcmodext.
int plotdata(DFT *dft, RES *res, int first, int last, char *mtitle, char *xtitle, char *ytitle, char *fname)
int plot_svg(DFT *dft, RES *res, int first, int last, char *main_title, char *x_title, char *y_title, int color_scale, char *fname, int verbose)
Header file for libtpcsvg.
int best_logan_reed(double *x, double *y, double *wx, double *wy, int nr, int min_nr, double *slope, double *ic, double *nwss, double *sslope, double *sic, double *cx, double *cy, int *bnr, int verbose)
int best_logan_regr(double *x, double *y, double *wx, double *wy, int nr, int min_nr, double *slope, double *ic, double *r, double *sslope, double *sic, int *bnr, int verbose)
char studynr[MAX_STUDYNR_LEN+1]
char parname[MAX_RESPARAMS][MAX_RESPARNAME_LEN+1]
char plasmafile[FILENAME_MAX]
char datafile[FILENAME_MAX]
char parunit[MAX_RESPARAMS][MAX_RESPARNAME_LEN+1]
double parameter[MAX_RESPARAMS]
char name[MAX_REGIONNAME_LEN+1]