TPCCLIB
|
Procedures for simulating PET time-activity curves. More...
#include "libtpcmodel.h"
Go to the source code of this file.
Functions | |
int | simC3s (double *t, double *ca, int nr, double k1, double k2, double k3, double k4, double k5, double k6, double *ct, double *cta, double *ctb, double *ctc) |
int | simC3p (double *t, double *ca, int nr, double k1, double k2, double k3, double k4, double k5, double k6, double *ct, double *cta, double *ctb, double *ctc) |
int | simC3vs (double *t, double *ca, double *cb, int nr, double k1, double k2, double k3, double k4, double k5, double k6, double f, double vb, double fa, double *cpet, double *cta, double *ctb, double *ctc, double *ctab, double *ctvb) |
int | simC3vp (double *t, double *ca, double *cb, int nr, double k1, double k2, double k3, double k4, double k5, double k6, double f, double vb, double fa, double *cpet, double *cta, double *ctb, double *ctc, double *ctab, double *ctvb) |
int | simC2l (double *t, double *ca, int nr, double k1, double k2, double k3, double kLoss, double *ct, double *cta, double *ctb) |
int | simC2vl (double *t, double *ca, double *cb, int nr, double k1, double k2, double k3, double kL, double f, double vb, double fa, double *cpet, double *cta, double *ctb, double *ctab, double *ctvb) |
int | simC3vpKLoss (double *t, double *ca, double *cb, int nr, double k1, double k2, double k3, double k4, double k5, double k6, double kLoss, double f, double vb, double fa, double *cpet, double *cta, double *ctb, double *ctc, double *ctab, double *ctvb) |
int | simRTCM (double *t, double *cr, int nr, double R1, double k2, double k3, double k4, double *ct, double *cta, double *ctb) |
int | simSRTM (double *t, double *cr, int nr, double R1, double k2, double BP, double *ct) |
int | simTRTM (double *t, double *cr, int nr, double R1, double k2, double k3, double *ct) |
int | simHuangmet (double *t, double *ctot, int nr, double k01, double k12, double k21, double k03, double k34, double k43, double *c0, double *c1, double *c3) |
int | simTPCMOD0009c (double *t, double *ctot, int nr, double km, double k1m, double k2m, double k3m, double k4m, double *ca, double *cm) |
int | simMBF (double *t, double *ci, int nr, double k1, double k2, double Vfit, double *ct) |
int | simC1 (double *t, double *ca, int nr, double k1, double k2, double *ct) |
int | simC3DIvs (double *t, double *ca1, double *ca2, double *cb, int nr, double k1, double k2, double k3, double k4, double k5, double k6, double k1b, double k2b, double f, double vb, double fa, double *scpet, double *sct1, double *sct2, double *sct3, double *sct1b, double *sctab, double *sctvb) |
int | simC4DIvp (double *t, double *ca1, double *ca2, double *cb, int nr, double k1, double k2, double k3, double k4, double k5, double k6, double k7, double km, double k1b, double k2b, double f, double vb, double fa, double *scpet, double *sct1, double *sct2, double *sct3, double *sct1b, double *sctab, double *sctvb, int verbose) |
int | simC4DIvs (double *t, double *ca1, double *ca2, double *cb, int nr, double k1, double k2, double k3, double k4, double k5, double k6, double k7, double km, double k1b, double k2b, double f, double vb, double fa, double *scpet, double *sct1, double *sct2, double *sct3, double *sct1b, double *sctab, double *sctvb, int verbose) |
int | simDispersion (double *x, double *y, int n, double tau1, double tau2, double *tmp) |
int | simOxygen (double *t, double *ca1, double *ca2, double *ca1i, double *ca2i, const int n, const double k1a, const double k2a, const double km, const double k1b, const double k2b, const double vb, const double fa, double *scpet, double *sct1, double *sct2, double *sctab, double *sctvb1, double *sctvb2, double *scvb1, double *scvb2, const int verbose) |
Procedures for simulating PET time-activity curves.
Definition in file simulate.c.
int simC1 | ( | double * | t, |
double * | ca, | ||
int | nr, | ||
double | k1, | ||
double | k2, | ||
double * | ct ) |
Simulates tissue TAC using 1 tissue compartment model plasma TAC, at plasma TAC times.
Memory for ct must be allocated in the calling program.
The units of rate constants must be related to the time unit; 1/min and min, or 1/sec and sec.
t | Array of time values |
ca | Array of arterial activities |
nr | Number of values in TACs |
k1 | Rate constant of the model |
k2 | Rate constant of the model |
ct | Pointer for TAC array to be simulated; must be allocated |
Definition at line 1317 of file simulate.c.
Referenced by bf_srtm(), bfIrr2TCM(), bfRadiowater(), and simDispersion().
int simC2l | ( | double * | t, |
double * | ca, | ||
int | nr, | ||
double | k1, | ||
double | k2, | ||
double | k3, | ||
double | kLoss, | ||
double * | ct, | ||
double * | cta, | ||
double * | ctb ) |
Simulates tissue TAC using 2 tissue compartment model (in series) and plasma TAC, at plasma TAC times. In contrary to the common model, kLoss represents a direct loss rate from the 2nd tissue compartment to venous plasma.
Memory for ct must be allocated in the calling program. To retrieve the separate tissue compartment TACs, pointer to allocated memory for cta and ctb can be given; if compartmental TACs are not required, NULL pointer can be given instead.
The units of rate constants must be related to the time unit; 1/min and min, or 1/sec and sec.
t | Array of time values |
ca | Array of arterial activities |
nr | Number of values in TACs |
k1 | Rate constant of the model |
k2 | Rate constant of the model |
k3 | Rate constant of the model |
kLoss | Rate constant of the model |
ct | Pointer for TAC array to be simulated; must be allocated |
cta | Pointer for 1st compartment TAC to be simulated, or NULL |
ctb | Pointer for 2nd compartment TAC to be simulated, or NULL |
Definition at line 500 of file simulate.c.
int simC2vl | ( | double * | t, |
double * | ca, | ||
double * | cb, | ||
int | nr, | ||
double | k1, | ||
double | k2, | ||
double | k3, | ||
double | kL, | ||
double | f, | ||
double | vb, | ||
double | fa, | ||
double * | cpet, | ||
double * | cta, | ||
double * | ctb, | ||
double * | ctab, | ||
double * | ctvb ) |
Simulates tissue TAC using 2 tissue compartment model and plasma TAC, at plasma TAC times, considering also arterial and venous vasculature. The efflux from 2nd tissue compartment (at rate kL) goes directly to blood.
Memory for cpet must be allocated in the calling program. To retrieve the separate tissue compartment TACs, pointer to allocated memory for cta, ctb, ctab and/or ctvb can be given; if compartmental TACs are not required, NULL pointer can be given instead.
The units of rate constants must be related to the time unit; 1/min and min, or 1/sec and sec.
If blood flow is set to 0, function assumes that f>>k1, and Cvb=Cab.,
t | Array of time values |
ca | Array of arterial plasma activities |
cb | Array of arterial blood activities |
nr | Number of values in TACs |
k1 | Rate constant of the model |
k2 | Rate constant of the model |
k3 | Rate constant of the model |
kL | Rate constant of the model |
f | Blood flow; if 0, function assumes that f>>k1, and Cvb=Cab. |
vb | Vascular volume fraction |
fa | Arterial fraction of vascular volume |
cpet | Pointer for TAC array to be simulated; must be allocated |
cta | Pointer for 1st compartment TAC to be simulated, or NULL |
ctb | Pointer for 2nd compartment TAC to be simulated, or NULL |
ctab | Pointer for arterial TAC in tissue, or NULL |
ctvb | Pointer for venous TAC in tissue, or NULL |
Definition at line 592 of file simulate.c.
int simC3DIvs | ( | double * | t, |
double * | ca1, | ||
double * | ca2, | ||
double * | cb, | ||
int | nr, | ||
double | k1, | ||
double | k2, | ||
double | k3, | ||
double | k4, | ||
double | k5, | ||
double | k6, | ||
double | k1b, | ||
double | k2b, | ||
double | f, | ||
double | vb, | ||
double | fa, | ||
double * | scpet, | ||
double * | sct1, | ||
double * | sct2, | ||
double * | sct3, | ||
double * | sct1b, | ||
double * | sctab, | ||
double * | sctvb ) |
Simulates tissue TAC using dual-input tissue compartment model (1-3 compartments in series for tracer1, and 1 compartment for tracer2) at plasma TAC times, considering also contribution of arterial and venous vasculature, but no exchange between compartments for tracer1 and tracer2. The units of rate constants must be related to the time unit; 1/min and min, or 1/sec and sec. If blood flow is set to 0, function assumes that f>>k1, and Cvb=Cab.
t | Array of time values |
ca1 | Array of arterial plasma activities of tracer1 |
ca2 | Array of arterial plasma activities of tracer2 |
cb | Array of arterial blood activities |
nr | Number of values in TACs |
k1 | Rate constant of the model for tracer1 (from plasma to C1) |
k2 | Rate constant of the model for tracer1 (from C1 to plasma) |
k3 | Rate constant of the model for tracer1 (from C1 to C2) |
k4 | Rate constant of the model for tracer1 (from C2 to C1) |
k5 | Rate constant of the model for tracer1 (from C2 to C3) |
k6 | Rate constant of the model for tracer1 (from C3 to C2) |
k1b | Rate constant of the model for tracer2 (from plasma to C4) |
k2b | Rate constant of the model for tracer2 (from C4 to plasma) |
f | Blood flow; if 0, function assumes that f>>k1, and Cvb=Cab. |
vb | Vascular volume fraction |
fa | Arterial fraction of vascular volume |
scpet | Pointer for TAC array to be simulated; must be allocated |
sct1 | Pointer for 1st tracer1 compartment TAC, or NULL if not needed |
sct2 | Pointer for 2nd tracer1 compartment TAC, or NULL if not needed |
sct3 | Pointer for 3rd tracer1 compartment TAC, or NULL if not needed |
sct1b | Pointer for 1st tracer2 compartment TAC, or NULL if not needed |
sctab | Pointer for arterial TAC in tissue, or NULL if not needed |
sctvb | Pointer for venous TAC in tissue, or NULL if not needed |
Definition at line 1387 of file simulate.c.
int simC3p | ( | double * | t, |
double * | ca, | ||
int | nr, | ||
double | k1, | ||
double | k2, | ||
double | k3, | ||
double | k4, | ||
double | k5, | ||
double | k6, | ||
double * | ct, | ||
double * | cta, | ||
double * | ctb, | ||
double * | ctc ) |
Simulates tissue TAC using 1-3 tissue compartment model (2nd and 3rd compartments in parallel) and plasma TAC, at plasma TAC times.
Memory for ct must be allocated in the calling program. To retrieve the separate tissue compartment TACs, pointer to allocated memory for cta, ctb and/or ctc can be given; if compartmental TACs are not required, NULL pointer can be given instead.
The units of rate constants must be related to the time unit; 1/min and min, or 1/sec and sec.
t | Array of time values |
ca | Array of arterial activities |
nr | Number of values in TACs |
k1 | Rate constant of the model |
k2 | Rate constant of the model |
k3 | Rate constant of the model |
k4 | Rate constant of the model |
k5 | Rate constant of the model |
k6 | Rate constant of the model |
ct | Pointer for TAC array to be simulated; must be allocated |
cta | Pointer for 1st compartment TAC to be simulated, or NULL |
ctb | Pointer for 2nd compartment TAC to be simulated, or NULL |
ctc | Pointer for 3rd compartment TAC to be simulated, or NULL |
Definition at line 136 of file simulate.c.
int simC3s | ( | double * | t, |
double * | ca, | ||
int | nr, | ||
double | k1, | ||
double | k2, | ||
double | k3, | ||
double | k4, | ||
double | k5, | ||
double | k6, | ||
double * | ct, | ||
double * | cta, | ||
double * | ctb, | ||
double * | ctc ) |
Simulates tissue TAC using 1-3 tissue compartment model (in series) and plasma TAC, at plasma TAC times.
Memory for ct must be allocated in the calling program. To retrieve the separate tissue compartment TACs, pointer to allocated memory for cta, ctb and/or ctc can be given; if compartmental TACs are not required, NULL pointer can be given instead.
The units of rate constants must be related to the time unit; 1/min and min, or 1/sec and sec.
t | Array of time values |
ca | Array of arterial activities |
nr | Number of values in TACs |
k1 | Rate constant of the model |
k2 | Rate constant of the model |
k3 | Rate constant of the model |
k4 | Rate constant of the model |
k5 | Rate constant of the model |
k6 | Rate constant of the model |
ct | Pointer for TAC array to be simulated; must be allocated |
cta | Pointer for 1st compartment TAC to be simulated, or NULL |
ctb | Pointer for 2nd compartment TAC to be simulated, or NULL |
ctc | Pointer for 3rd compartment TAC to be simulated, or NULL |
Definition at line 27 of file simulate.c.
int simC3vp | ( | double * | t, |
double * | ca, | ||
double * | cb, | ||
int | nr, | ||
double | k1, | ||
double | k2, | ||
double | k3, | ||
double | k4, | ||
double | k5, | ||
double | k6, | ||
double | f, | ||
double | vb, | ||
double | fa, | ||
double * | cpet, | ||
double * | cta, | ||
double * | ctb, | ||
double * | ctc, | ||
double * | ctab, | ||
double * | ctvb ) |
Simulates tissue TAC using 1-3 tissue compartment model (2nd and 3rd compartments in parallel) and plasma TAC, at plasma TAC times, considering also arterial and venous vasculature.
Memory for cpet must be allocated in the calling program. To retrieve the separate tissue compartment TACs, pointer to allocated memory for cta, ctb, ctc, ctab and/or ctvb can be given; if compartmental TACs are not required, NULL pointer can be given instead.
The units of rate constants must be related to the time unit; 1/min and min, or 1/sec and sec.
If blood flow is set to 0, function assumes that f>>k1, and Cvb=Cab.,
t | Array of time values |
ca | Array of arterial plasma activities |
cb | Array of arterial blood activities |
nr | Number of values in TACs |
k1 | Rate constant of the model |
k2 | Rate constant of the model |
k3 | Rate constant of the model |
k4 | Rate constant of the model |
k5 | Rate constant of the model |
k6 | Rate constant of the model |
f | Blood flow; if 0, function assumes that f>>k1, and Cvb=Cab. |
vb | Vascular volume fraction |
fa | Arterial fraction of vascular volume |
cpet | Pointer for TAC array to be simulated; must be allocated |
cta | Pointer for 1st compartment TAC to be simulated, or NULL |
ctb | Pointer for 2nd compartment TAC to be simulated, or NULL |
ctc | Pointer for 3rd compartment TAC to be simulated, or NULL |
ctab | Pointer for arterial TAC in tissue, or NULL |
ctvb | Pointer for venous TAC in tissue, or NULL |
Definition at line 373 of file simulate.c.
int simC3vpKLoss | ( | double * | t, |
double * | ca, | ||
double * | cb, | ||
int | nr, | ||
double | k1, | ||
double | k2, | ||
double | k3, | ||
double | k4, | ||
double | k5, | ||
double | k6, | ||
double | kLoss, | ||
double | f, | ||
double | vb, | ||
double | fa, | ||
double * | cpet, | ||
double * | cta, | ||
double * | ctb, | ||
double * | ctc, | ||
double * | ctab, | ||
double * | ctvb ) |
Simulates tissue TAC using 3 tissue compartmental model with two parallel compartments, and plasma TAC, at plasma TAC sample times, considering also arterial and venous vasculature. The efflux from 3rd tissue compartment (C) goes directly to blood at rate kLoss.
Memory for cpet must be allocated in the calling program. To retrieve the separate tissue compartment TACs, pointer to allocated memory for cta, ctb, ctab and/or ctvb can be given; if compartmental TACs are not required, NULL pointer can be given instead.
The units of rate constants must be related to the time unit; 1/min and min, or 1/sec and sec.
If blood flow is set to 0, function assumes that f>>k1, and Cvb=Cab.,
t | Array of sample times |
ca | Array of arterial plasma activities |
cb | Array of arterial blood activities |
nr | Number of sample values in TACs |
k1 | Rate constant of the model |
k2 | Rate constant of the model |
k3 | Rate constant of the model |
k4 | Rate constant of the model |
k5 | Rate constant of the model |
k6 | Rate constant of the model |
kLoss | Rate constant of the model |
f | Blood flow; if 0, function assumes that f>>k1, and Cvb=Cab. |
vb | Vascular volume fraction |
fa | Arterial fraction of vascular volume |
cpet | Pointer for TAC array to be simulated; must be allocated |
cta | Pointer for 1st tissue compartment TAC to be simulated, or NULL |
ctb | Pointer for 2nd compartment TAC to be simulated, or NULL |
ctc | Pointer for 3rd compartment TAC to be simulated, or NULL |
ctab | Pointer for arterial TAC in tissue, or NULL |
ctvb | Pointer for venous TAC in tissue, or NULL |
Definition at line 707 of file simulate.c.
int simC3vs | ( | double * | t, |
double * | ca, | ||
double * | cb, | ||
int | nr, | ||
double | k1, | ||
double | k2, | ||
double | k3, | ||
double | k4, | ||
double | k5, | ||
double | k6, | ||
double | f, | ||
double | vb, | ||
double | fa, | ||
double * | cpet, | ||
double * | cta, | ||
double * | ctb, | ||
double * | ctc, | ||
double * | ctab, | ||
double * | ctvb ) |
Simulates tissue TAC using 1-3 tissue compartment model (in series) and plasma TAC, at plasma TAC times, considering also arterial and venous vasculature.
Memory for cpet must be allocated in the calling program. To retrieve the separate tissue compartment TACs, pointer to allocated memory for cta, ctb, ctc, ctab and/or ctvb can be given; if compartmental TACs are not required, NULL pointer can be given instead.
The units of rate constants must be related to the time unit; 1/min and min, or 1/sec and sec.
If blood flow is set to 0, function assumes that f>>k1, and Cvb=Cab.,
t | Array of time values |
ca | Array of arterial plasma activities |
cb | Array of arterial blood activities |
nr | Number of values in TACs |
k1 | Rate constant of the model |
k2 | Rate constant of the model |
k3 | Rate constant of the model |
k4 | Rate constant of the model |
k5 | Rate constant of the model |
k6 | Rate constant of the model |
f | Blood flow; if 0, function assumes that f>>k1, and Cvb=Cab. |
vb | Vascular volume fraction |
fa | Arterial fraction of vascular volume |
cpet | Pointer for TAC array to be simulated; must be allocated |
cta | Pointer for 1st compartment TAC to be simulated, or NULL |
ctb | Pointer for 2nd compartment TAC to be simulated, or NULL |
ctc | Pointer for 3rd compartment TAC to be simulated, or NULL |
ctab | Pointer for arterial TAC in tissue, or NULL |
ctvb | Pointer for venous TAC in tissue, or NULL |
Definition at line 243 of file simulate.c.
int simC4DIvp | ( | double * | t, |
double * | ca1, | ||
double * | ca2, | ||
double * | cb, | ||
int | nr, | ||
double | k1, | ||
double | k2, | ||
double | k3, | ||
double | k4, | ||
double | k5, | ||
double | k6, | ||
double | k7, | ||
double | km, | ||
double | k1b, | ||
double | k2b, | ||
double | f, | ||
double | vb, | ||
double | fa, | ||
double * | scpet, | ||
double * | sct1, | ||
double * | sct2, | ||
double * | sct3, | ||
double * | sct1b, | ||
double * | sctab, | ||
double * | sctvb, | ||
int | verbose ) |
Simulates tissue TAC using dual-input tissue compartment model (compartments 2 and 3 in parallel for tracer1, and 1 compartment for tracer2) at plasma TAC sample times, considering also contribution of arterial and venous vasculature, and transfer of tracer1 to tracer2. The units of rate constants must be related to the time unit; 1/min and min, or 1/sec and sec. If blood flow is set to 0, function assumes that f>>k1, and Cvb=Cab. Reference: TPCMOD0001 Appendix C. Tested with program p2t_di -parallel.
t | Array of time values |
ca1 | Array of arterial plasma activities of tracer1 (parent tracer) |
ca2 | Array of arterial plasma activities of tracer2 (metabolite) |
cb | Array of (total) arterial blood activities |
nr | Number of values in TACs |
k1 | Rate constant of the model for tracer1 (from plasma to C1) |
k2 | Rate constant of the model for tracer1 (from C1 to plasma) |
k3 | Rate constant of the model for tracer1 (from C1 to C2) |
k4 | Rate constant of the model for tracer1 (from C2 to C1) |
k5 | Rate constant of the model for tracer1 (from C1 to C3) |
k6 | Rate constant of the model for tracer1 (from C3 to C1) |
k7 | Rate constant of the model for tracer1 (from C3 to plasma) |
km | Rate constant of the model (from tracer1 in C1 to tracer2 in C4) |
k1b | Rate constant of the model for tracer2 (from plasma to C4) |
k2b | Rate constant of the model for tracer2 (from C4 to plasma) |
f | Blood flow; if 0, function assumes that f>>k1, and Cvb=Cab |
vb | Vascular volume fraction (0<=Vb<1) |
fa | Arterial fraction of vascular volume (0<=fa<=1) |
scpet | Pointer for TAC array to be simulated; must be allocated |
sct1 | Pointer for 1st tracer1 compartment TAC, or NULL if not needed |
sct2 | Pointer for 2nd tracer1 compartment TAC, or NULL if not needed |
sct3 | Pointer for 3rd tracer1 compartment TAC, or NULL if not needed |
sct1b | Pointer for 1st tracer2 compartment TAC, or NULL if not needed |
sctab | Pointer for arterial TAC in tissue, or NULL if not needed |
sctvb | Pointer for venous TAC in tissue, or NULL if not needed |
verbose | Verbose level; if zero, then nothing is printed into stdout or stderr |
Definition at line 1533 of file simulate.c.
int simC4DIvs | ( | double * | t, |
double * | ca1, | ||
double * | ca2, | ||
double * | cb, | ||
int | nr, | ||
double | k1, | ||
double | k2, | ||
double | k3, | ||
double | k4, | ||
double | k5, | ||
double | k6, | ||
double | k7, | ||
double | km, | ||
double | k1b, | ||
double | k2b, | ||
double | f, | ||
double | vb, | ||
double | fa, | ||
double * | scpet, | ||
double * | sct1, | ||
double * | sct2, | ||
double * | sct3, | ||
double * | sct1b, | ||
double * | sctab, | ||
double * | sctvb, | ||
int | verbose ) |
Simulates tissue TAC using dual-input tissue compartment model (1-3 compartments in series for tracer1, and 1 compartment for tracer2) at plasma TAC times, considering also contribution of arterial and venous vasculature, and transfer of tracer1 to tracer2. The units of rate constants must be related to the time unit; 1/min and min, or 1/sec and sec. If blood flow is set to 0, function assumes that f>>k1, and Cvb=Cab. Reference: TPCMOD0001 Appendix B. Tested with program p2t_di -series.
t | Array of time values |
ca1 | Array of arterial plasma activities of tracer1 (parent tracer) |
ca2 | Array of arterial plasma activities of tracer2 (metabolite) |
cb | Array of (total) arterial blood activities |
nr | Number of values in TACs |
k1 | Rate constant of the model for tracer1 (from plasma to C1) |
k2 | Rate constant of the model for tracer1 (from C1 to plasma) |
k3 | Rate constant of the model for tracer1 (from C1 to C2) |
k4 | Rate constant of the model for tracer1 (from C2 to C1) |
k5 | Rate constant of the model for tracer1 (from C2 to C3) |
k6 | Rate constant of the model for tracer1 (from C3 to C2) |
k7 | Rate constant of the model for tracer1 (from C3 to plasma) |
km | Rate constant of the model (from tracer1 in C1 to tracer2 in C4) |
k1b | Rate constant of the model for tracer2 (from plasma to C4) |
k2b | Rate constant of the model for tracer2 (from C4 to plasma) |
f | Blood flow; if 0, function assumes that f>>k1, and Cvb=Cab. |
vb | Vascular volume fraction |
fa | Arterial fraction of vascular volume |
scpet | Pointer for TAC array to be simulated; must be allocated |
sct1 | Pointer for 1st tracer1 compartment TAC, or NULL if not needed |
sct2 | Pointer for 2nd tracer1 compartment TAC, or NULL if not needed |
sct3 | Pointer for 3rd tracer1 compartment TAC, or NULL if not needed |
sct1b | Pointer for 1st tracer2 compartment TAC, or NULL if not needed |
sctab | Pointer for arterial TAC in tissue, or NULL if not needed |
sctvb | Pointer for venous TAC in tissue, or NULL if not needed |
verbose | Verbose level; if zero, then nothing is printed into stdout or stderr |
Definition at line 1724 of file simulate.c.
int simDispersion | ( | double * | x, |
double * | y, | ||
int | n, | ||
double | tau1, | ||
double | tau2, | ||
double * | tmp ) |
Simulate the effect of dispersion on a time-activity curve.
x | Array of sample times. |
y | Array of sample values, which will be replaced here by dispersion added values. |
n | Nr of samples. |
tau1 | First dispersion time constant (zero if no dispersion); in same time unit as sample times. |
tau2 | 2nd dispersion time constant (zero if no dispersion); in same time unit as sample times. |
tmp | Array for temporary data, for at least n samples; enter NULL to let function to allocate and free the temporary space. |
Definition at line 1911 of file simulate.c.
Referenced by fitEvaltac().
int simHuangmet | ( | double * | t, |
double * | ctot, | ||
int | nr, | ||
double | k01, | ||
double | k12, | ||
double | k21, | ||
double | k03, | ||
double | k34, | ||
double | k43, | ||
double * | c0, | ||
double * | c1, | ||
double * | c3 ) |
Simulation of TACs of parent tracer, and 1-2 of its metabolites in plasma using Huang's compartmental model.
The units of model parameters must be related to the sample time unit; 1/min and min, or 1/sec and sec.
Pointers to memory for output TACs must be specified, or NULL if TAC is not needed.
t | Input: Sample times (preferably with short intervals) |
ctot | Input: Measured total plasma TAC |
nr | Input: Nr of samples |
k01 | Input: Model parameters |
k12 | Input: Model parameters |
k21 | Input: Model parameters |
k03 | Input: Model parameters |
k34 | Input: Model parameters |
k43 | Input: Model parameters |
c0 | Output: unchanged (parent) tracer TAC |
c1 | Output: TAC of the 1st metabolite |
c3 | Output: TAC of the 2nd metabolite |
Definition at line 1054 of file simulate.c.
int simMBF | ( | double * | t, |
double * | ci, | ||
int | nr, | ||
double | k1, | ||
double | k2, | ||
double | Vfit, | ||
double * | ct ) |
Simulate myocardial tissue TAC using Iida's compartment model. Memory for ct must be allocated in the calling program. The units of rate constants must be related to the time unit; 1/min and min, or 1/sec and sec.
t | Array of time values |
ci | Input activities |
nr | Number of values in TACs |
k1 | Apparent k1 |
k2 | Apparent k2 |
Vfit | Vfit |
ct | Pointer for TAC array to be simulated; must be allocated |
Definition at line 1253 of file simulate.c.
int simOxygen | ( | double * | t, |
double * | ca1, | ||
double * | ca2, | ||
double * | ca1i, | ||
double * | ca2i, | ||
const int | n, | ||
const double | k1a, | ||
const double | k2a, | ||
const double | km, | ||
const double | k1b, | ||
const double | k2b, | ||
const double | vb, | ||
const double | fa, | ||
double * | scpet, | ||
double * | sct1, | ||
double * | sct2, | ||
double * | sctab, | ||
double * | sctvb1, | ||
double * | sctvb2, | ||
double * | scvb1, | ||
double * | scvb2, | ||
const int | verbose ) |
Simulate tissue and venous blood TACs using dual-input compartment model for [O-15]O2 (one tissue compartment for [O-15]O2, and another tissue compartment for its metabolite [O-15]H2O).
The units of rate constants must be related to the time unit of the data; 1/min and min, or 1/sec and sec.
t | Array of sample times |
ca1 | Array of arterial blood activities of tracer1 ([O-15]O2) |
ca2 | Array of arterial blood activities of tracer2 ([O-15]H2O) |
ca1i | Array of AUC 0-t of arterial tracer1 activities; NULL if not available |
ca2i | Array of AUC 0-t of arterial tracer2 activities; NULL if not available |
n | Nr of samples (array lengths) |
k1a | Rate constant of the model for tracer1 (from blood to C1) |
k2a | Rate constant of the model for tracer1 (from C1 to blood) |
km | Rate constant of the model (from tracer1 in C1 to tracer2 in C2) |
k1b | Rate constant of the model for tracer2 (from blood to C2) |
k2b | Rate constant of the model for tracer2 (from C2 to blood) |
vb | Vascular volume fraction [0-1) |
fa | Arterial fraction of vascular volume [0-1] |
scpet | Pointer for TTAC array to be simulated; allocate in the calling program or set to NULL if not needed |
sct1 | Simulated TAC of tracer1 in tissue; allocate in the calling program or set to NULL if not needed |
sct2 | Simulated TAC of tracer2 in tissue; allocate in the calling program or set to NULL if not needed |
sctab | Total arterial contribution to PET TTAC; allocate in the calling program or set to NULL if not needed |
sctvb1 | Venous tracer1 contribution to PET TAC; allocate in the calling program or set to NULL if not needed |
sctvb2 | Venous tarcer1 contribution to PET TAC; allocate in the calling program or set to NULL if not needed |
scvb1 | Venous BTAC of tracer1; allocate in the calling program or set to NULL if not needed |
scvb2 | Venous BTAC of tracer2; allocate in the calling program or set to NULL if not needed |
verbose | Verbose level; if zero, then nothing is printed into stdout or stderr |
Definition at line 1978 of file simulate.c.
int simRTCM | ( | double * | t, |
double * | cr, | ||
int | nr, | ||
double | R1, | ||
double | k2, | ||
double | k3, | ||
double | k4, | ||
double * | ct, | ||
double * | cta, | ||
double * | ctb ) |
Simulates tissue TAC using reference tissue compartment model (original) and reference region TAC, at reference region TAC times.
Memory for ct must be allocated in the calling program. To retrieve the separate tissue compartment TACs, pointer to allocated memory for cf and/or cb can be given; if compartmental TACs are not required, NULL pointer can be given instead.
The units of rate constants must be related to the time unit; 1/min and min, or 1/sec and sec.
t | Array of time values |
cr | Reference region activities |
nr | Number of values in TACs |
R1 | Ratio K1/K1' |
k2 | Rate constant of the model |
k3 | Rate constant of the model |
k4 | Rate constant of the model |
ct | Pointer for TAC array to be simulated; must be allocated |
cta | Pointer for 1st compartment TAC to be simulated, or NULL |
ctb | Pointer for 2nd compartment TAC to be simulated, or NULL |
Definition at line 835 of file simulate.c.
int simSRTM | ( | double * | t, |
double * | cr, | ||
int | nr, | ||
double | R1, | ||
double | k2, | ||
double | BP, | ||
double * | ct ) |
Simulates tissue TAC using reference tissue compartment model (simplified) and reference region TAC, at reference region TAC times.
Memory for ct must be allocated in the calling program.
The units of rate constants must be related to the time unit; 1/min and min, or 1/sec and sec.
t | Array of time values |
cr | Reference region activities |
nr | Number of values in TACs |
R1 | Ratio K1/K1' |
k2 | Rate constant of the model |
BP | Binding potential |
ct | Pointer for TAC array to be simulated; must be allocated |
Definition at line 919 of file simulate.c.
int simTPCMOD0009c | ( | double * | t, |
double * | ctot, | ||
int | nr, | ||
double | km, | ||
double | k1m, | ||
double | k2m, | ||
double | k3m, | ||
double | k4m, | ||
double * | ca, | ||
double * | cm ) |
Simulate parent tracer TAC using plasma metabolite model TPCMOD0009C, https://www.turkupetcentre.net/reports/tpcmod0009_app_c.pdf
t | Sample times |
ctot | Total plasma TAC |
nr | Sample number |
km | km |
k1m | k1m |
k2m | k2m |
k3m | k3m |
k4m | k4m |
ca | Pointer to array where parent tracer TAC will be written; NULL, if not needed. |
cm | Pointer to array where metabolized tracer TAC will be written; NULL, if not needed. |
Definition at line 1165 of file simulate.c.
int simTRTM | ( | double * | t, |
double * | cr, | ||
int | nr, | ||
double | R1, | ||
double | k2, | ||
double | k3, | ||
double * | ct ) |
Simulates tissue TAC using reference tissue compartment model (transport limited in ref region) and reference region TAC, at reference region TAC times.
Memory for ct must be allocated in the calling program.
The units of rate constants must be related to the time unit; 1/min and min, or 1/sec and sec.
t | Array of time values |
cr | Reference region activities |
nr | Number of values in TACs |
R1 | Ratio K1/K1' |
k2 | Rate constant of the model |
k3 | Rate constant of the model |
ct | Pointer for TAC array to be simulated; must be allocated |
Definition at line 986 of file simulate.c.