|
TPCCLIB
|
Header file for libtpcbfm. More...
#include "tpcclibConfig.h"#include <stdio.h>#include <stdlib.h>#include <string.h>#include <time.h>#include <math.h>#include "tpcextensions.h"#include "tpccm.h"#include "tpctac.h"Go to the source code of this file.
Functions | |
| int | spectralDExp (const double *x, const double *y, double *w, const int snr, const double kmin, const double kmax, const int bnr, double *k, double *a, double *yfit, TPCSTATUS *status) |
| int | spectralKRange (double *k, double *a, const int n, double *kmin, double *kmax, TPCSTATUS *status) |
| int | spectralBFNr (double *k, double *a, const int n) |
| int | spectralBFExtract (double *k, double *a, const int n, double *ke, double *ae, const int ne) |
| int | spectralDMSurge (const double *x, const double *x2, const double *y, double *w, const int sNr, const double kMin, const double kMax, const int fNr, const double dtMin, const double dtMax, const double dtStep, double *k, double *a, double *dtEst, double *yfit, TPCSTATUS *status) |
| int | bfm1TCM (TAC *input, TAC *tissue, const int bfNr, const double k2min, const double k2max, const int distr, TAC *bf, TPCSTATUS *status) |
| int | bfmSRTM (double *t, double *cri, const int n, const int bfNr, const double t3min, const double t3max, TAC *bf, TPCSTATUS *status) |
Header file for libtpcbfm.
Header file for template library libtpcbfm.
Definition in file tpcbfm.h.
| int bfm1TCM | ( | TAC * | input, |
| TAC * | tissue, | ||
| int | bfNr, | ||
| const double | k2min, | ||
| const double | k2max, | ||
| const int | distr, | ||
| TAC * | bf, | ||
| TPCSTATUS * | status ) |
Calculate set of basis functions for generic radiowater model.
| input | Pointer to blood input TAC (not modified). If frame start and end times are available (->isframes!=0), then BTAC integral is calculated and used as input. |
| tissue | Pointer to PET TTAC data, which must contain the sample (frame) times. |
| bfNr | Nr of basis functions to calculate. |
| k2min | Minimum of k2 (sec-1 or min-1, corresponding to TAC time units). If set to a negative value, |k2min| is used, but basis function with k2=0 is included. |
| k2max | Maximum of k2 (sec-1 or min-1, corresponding to TAC time units). |
| distr | Distribution of k2 values: 0=log-based; 1=even. |
| bf | Pointer to output TAC, to be allocated and filled with basis functions in here. |
| status | Pointer to status data; enter NULL if not needed. |
Definition at line 27 of file bf_1tcm.c.
| int bfmSRTM | ( | double * | t, |
| double * | cri, | ||
| const int | n, | ||
| const int | bfNr, | ||
| const double | t3min, | ||
| const double | t3max, | ||
| TAC * | bf, | ||
| TPCSTATUS * | status ) |
Calculate set of basis functions for SRTM.
| t | Pointer to array containing PET sample (frame middle) times. |
| cri | Pointer to array containing integral of reference tissue input concentration values at each sample time, AUC 0-t. AUC must have been calculated using values that are NOT corrected for decay. |
| n | Nr of samples (array lengths). |
| bfNr | Nr of basis functions to calculate. |
| t3min | Minimum of theta3. |
| t3max | Maximum of theta3. |
| bf | Pointer to output TAC, to be allocated and filled with basis functions in here. |
| status | Pointer to status data; enter NULL if not needed |
Definition at line 26 of file bf_srtm.c.
| int spectralBFExtract | ( | double * | k, |
| double * | a, | ||
| const int | n, | ||
| double * | ke, | ||
| double * | ae, | ||
| const int | ne ) |
After spectral x,y-data fitting to the sum of decaying exponential functions, extract the zero-separated (positive a) basis functions we actually got.
The maximum number of basis function parameters to be extracted must be specified; if more are found, then the ones with smallest a are averaged. If less are found, then the rest of output arrays are filled with zeroes, and the returned actual number is smaller than the requested number.
| k | Pointer to k array of length n; must be sorted to either order, as those usually are. Contents are not modified. |
| a | Pointer to a array of length n; not modified. |
| n | Length of k and a arrays. |
| ke | Pointer to an allocated array of extracted k values of length ne. |
| ae | Pointer to an allocated array of extracted a values of length ne; not modified. |
| ne | Length of k and a arrays, and the maximum number of parameters to extract. |
Definition at line 227 of file bf_dexp.c.
| int spectralBFNr | ( | double * | k, |
| double * | a, | ||
| const int | n ) |
After spectral x,y-data fitting to the sum of decaying exponential functions, determine the number of zero-separated (positive a) basis functions we actually got.
| k | Pointer to k array of length n; does not need to be in specific order, although those usually are. Contents are not modified. |
| a | Pointer to a array of length n; not modified. |
| n | Length of k and a arrays. |
Definition at line 193 of file bf_dexp.c.
Referenced by spectralBFExtract().
| int spectralDExp | ( | const double * | x, |
| const double * | y, | ||
| double * | w, | ||
| const int | snr, | ||
| const double | kmin, | ||
| const double | kmax, | ||
| const int | bnr, | ||
| double * | k, | ||
| double * | a, | ||
| double * | yfit, | ||
| TPCSTATUS * | status ) |
Spectral x,y-data fitting to the sum of decaying exponential functions.
f(x) = a1*exp(-k1*x) + a2*exp(-k2*x) + a3*exp(-k3*x) + ... where aN>=0 and kN>0.
| x | Pointer to TAC x data (not modified). Data must be sorted by increasing x. Negative or missing x values are not allowed. |
| y | Pointer to TAC y data (not modified). Data must be sorted by increasing x. Missing y values are not allowed. |
| w | Pointer to TAC sample weights (not modified). Enter NULL if not needed. |
| snr | Number of samples in x[] and y[]; at least 3. |
| kmin | Minimum of k (set based on sample range and unit); must be >0. |
| kmax | Maximum of k (set based on sample range and unit); must be >kmin. |
| bnr | Number of basis functions to calculate; also the length of arrays k[] and a[]; at least 4. |
| k | Pointer to array of length bnr for k values, filled in by this function. |
| a | Pointer to array of length bnr for a values, filled in by this function; notice that most values may be set to zero. |
| yfit | Pointer to array for fitted y values. Enter NULL if not needed. |
| status | Pointer to status data; enter NULL if not needed |
Definition at line 28 of file bf_dexp.c.
| int spectralDMSurge | ( | const double * | x, |
| const double * | x2, | ||
| const double * | y, | ||
| double * | w, | ||
| const int | sNr, | ||
| const double | kMin, | ||
| const double | kMax, | ||
| const int | fNr, | ||
| const double | dtMin, | ||
| const double | dtMax, | ||
| const double | dtStep, | ||
| double * | k, | ||
| double * | a, | ||
| double * | dtEst, | ||
| double * | yfit, | ||
| TPCSTATUS * | status ) |
Spectral x,y-data fitting to the sum of surge functions and delay time.
f(x) = a1*x*exp(-k1*x) + a2*x*exp(-k2*x) + a3*x*exp(-k3*x) + ... where a and k parameters are larger than zero.
| x | Pointer to TAC x (sample times or frame mid times), or x1 (frame start times) when x2 are given, too. Data is not modified in this function. Data must be sorted by increasing x. Negative or missing x values are not allowed. |
| x2 | Pointer to TAC x2 data (frame end times), or NULL if frame start and end times are not available. Data is not modified. |
| y | Pointer to TAC y data (not modified). Data must be sorted by increasing x. Missing y values are not allowed. |
| w | Pointer to TAC sample weights (not modified). Enter NULL if not needed. |
| sNr | Number of samples in x[], y[], and possibly x2[] and w[]; at least 4. |
| kMin | Minimum of k; 0<kMin<kMax. |
| kMax | Maximum of k; 0<kMin<kMax. |
| fNr | Number of basis functions to calculate; also the length of arrays k[] and a[]; at least 4. |
| dtMin | Min delay time. To fix delay time enter dtMin=dtMax, and dtStep=0. |
| dtMax | Max delay time. To fix delay time enter dtMin=dtMax, and dtStep=0. |
| dtStep | Delay time step size. Enter zero to use delay time fixed to dtMin&dtMax. |
| k | Pointer to array of length fNr for k values, filled in by this function. Enter NULL if not needed. |
| a | Pointer to array of length fNr for a values, filled in by this function; notice that most values may be set to zero. Enter NULL if not needed. |
| dtEst | Pointer to delay time estimate; NULL if not needed. |
| yfit | Pointer to array for fitted y values. Enter NULL if not needed. |
| status | Pointer to status data; enter NULL if not needed |
Definition at line 27 of file bf_dms.c.
| int spectralKRange | ( | double * | k, |
| double * | a, | ||
| const int | n, | ||
| double * | kmin, | ||
| double * | kmax, | ||
| TPCSTATUS * | status ) |
After spectral x,y-data fitting to the sum of decaying exponential functions, determine the min and max of k values with positive a value.
| k | Pointer to k array of length n; does not need to be in specific order, although those usually are. Contents are not modified. |
| a | Pointer to a array of length n; not modified. |
| n | Length of k and a arrays. |
| kmin | Pointer min k value. Enter NULL if not needed. |
| kmax | Pointer max k value. Enter NULL if not needed. |
| status | Pointer to status data; enter NULL if not needed |
Definition at line 145 of file bf_dexp.c.