TPCCLIB
|
Multiple-time graphical analysis (including Patlak and Logan plots). More...
#include "libtpcmodel.h"
Go to the source code of this file.
Functions | |
int | patlak_data (int data_nr, double *i, double *ii, double *c, double *x, double *y) |
int | logan_data (int data_nr, double *i, double *ii, double *c, double *ci, double k2, double *x, double *y) |
int | mtga_best_perp (double *x, double *y, int nr, double *slope, double *ic, double *ssd, int *fnr) |
Multiple-time graphical analysis (including Patlak and Logan plots).
Definition in file mtga.c.
int logan_data | ( | int | data_nr, |
double * | i, | ||
double * | ii, | ||
double * | c, | ||
double * | ci, | ||
double | k2, | ||
double * | x, | ||
double * | y ) |
Calculates Logan plot x,y values from the measured input and ROI concentration TACs.
Plot will not include data where: 1) any of the values is not available (NaN), 2) integral is negative at this or later point, 3) divider is too close to zero.
data_nr | Nr of samples. |
i | Array of input concentrations. |
ii | Array of integrals (from zero to sample time) of input concentrations; if reference region input, then remember to consider the frame length. |
c | Array of ROI concentrations. |
ci | Array of ROI integrals (from zero to frame middle time). |
k2 | Reference region k2; set to <=0 if not needed. |
x | Pointer to preallocated memory (at least size dnr) where MTGA plot x values will be written. |
y | Pointer to preallocated memory (at least size dnr) where MTGA plot y values will be written. |
Definition at line 81 of file mtga.c.
Referenced by img_logan().
int mtga_best_perp | ( | double * | x, |
double * | y, | ||
int | nr, | ||
double * | slope, | ||
double * | ic, | ||
double * | ssd, | ||
int * | fnr ) |
Finds the best regression line to (x,y)-data, leaving points out from the beginning, because Gjedde-Patlak and Logan plots reach linearity at some later phase.
This function applies llsqperp() which is a non-iterative perpendicular line fitting routine.
x | Plot x axis values. |
y | Plot y axis values. |
nr | Nr of plot data points. |
slope | Slope is returned in here. |
ic | Y axis intercept is returned in here. |
ssd | Sum of squared distances / fnr, or NULL if not needed. |
fnr | Number of points in the best fit, or NULL if not needed. |
Definition at line 141 of file mtga.c.
Referenced by img_logan(), and img_patlak().
int patlak_data | ( | int | data_nr, |
double * | i, | ||
double * | ii, | ||
double * | c, | ||
double * | x, | ||
double * | y ) |
Calculates Gjedde-Patlak plot x,y values from the measured input and ROI concentration TACs.
Plot will not include data where: 1) any of the values is not available (NaN), 2) integral is negative at this or later point, 3) divider is too close to zero, 4) plot x value is negative.
data_nr | Nr of samples. |
i | Array of input concentrations. |
ii | Array of integrals (from zero to sample time) of input concentrations; if reference region input, then remember to consider the frame length. |
c | Array of ROI concentrations. |
x | Pointer to preallocated memory (at least size dnr) where MTGA plot x values will be written. |
y | Pointer to preallocated memory (at least size dnr) where MTGA plot y values will be written. |
Definition at line 22 of file mtga.c.
Referenced by img_patlak().