TPCCLIB
|
Procedures for handling model input data. More...
#include "libtpcmodext.h"
Go to the source code of this file.
Functions | |
int | dftReadinput (DFT *input, DFT *tissue, char *filename, int *filetype, double *ti1, double *ti2, int verifypeak, char *status, int verbose) |
int | dftReadReference (DFT *tissue, char *filename, int *filetype, int *ref_index, char *status, int verbose) |
int | dftReadModelingData (char *tissuefile, char *inputfile1, char *inputfile2, char *inputfile3, double *fitdur, int *fitframeNr, DFT *tis, DFT *inp, FILE *loginfo, int verbose, char *status) |
int | dftRobustMinMaxTAC (DFT *dft, int tacindex, double *minx, double *maxx, double *miny, double *maxy, int *mini, int *maxi, int *mins, int *maxs, int verbose) |
int | dftVerifyPeak (DFT *dft, int index, int verbose, char *status) |
Procedures for handling model input data.
Definition in file dftinput.c.
int dftReadinput | ( | DFT * | input, |
DFT * | tissue, | ||
char * | filename, | ||
int * | filetype, | ||
double * | ti1, | ||
double * | ti2, | ||
int | verifypeak, | ||
char * | status, | ||
int | verbose ) |
Read DFT format input TAC data to match the time frames in the specified tissue DFT file. Instead of input filename, a reference region name can be given: then all the matching tacs (based on roi names) are moved from the roi data to the input data, with the best match as first tac. Input data is interpolated (if necessary) and also integrated to y2[]. Input time and concentration units are tried to be converted to be the same as in tissue data.
input | Input data, previous contents are cleared. |
tissue | PET data containing frames and possible input regions. |
filename | Input data filename, or region name in PET data. |
filetype | Type of input, as found out here; 1 and 2 =tac, 3=fit, 5=region name; enter NULL, if not needed. |
ti1 | First time of input data before interpolation (in tissue time units); use this to check that required time range was measured; NULL if not needed. |
ti2 | Last time of input data before interpolation (in tissue time units); use this to check that required time range was measured; NULL if not needed. |
verifypeak | Set to <>0 to verify that input TAC does not start too late and has decent peak to provide reliable AUC0-T. |
status | Pointer to a string (allocated for at least 64 chars) where error message or other execution status will be written; enter NULL, if not needed. |
verbose | Verbose level; if zero, then nothing is printed to stderr or stdout. |
Definition at line 25 of file dftinput.c.
int dftReadModelingData | ( | char * | tissuefile, |
char * | inputfile1, | ||
char * | inputfile2, | ||
char * | inputfile3, | ||
double * | fitdur, | ||
int * | fitframeNr, | ||
DFT * | tis, | ||
DFT * | inp, | ||
FILE * | loginfo, | ||
int | verbose, | ||
char * | status ) |
Read tissue and input data for modeling. Time units are converted to min and input calibration units to units of tissue data. Input data is NOT interpolated to tissue times. If input data extends much further than fit duration, the last part is removed to save computation time in simulations. Input data is verified not to end too early, and not to start too late.
tissuefile | Tissue data filename; one time sample is sufficient here. |
inputfile1 | 1st input data filename. |
inputfile2 | 2nd input data filename (or NULL if only not needed). |
inputfile3 | 3rd input data filename (or NULL if only not needed). |
fitdur | Fit duration (in minutes); shortened if longer than tissue data. |
fitframeNr | Nr of time frames (samples) in tissue data that are inside fitdur will be written here. |
tis | Pointer to initiated DFT into which tissue data will be written. |
inp | Pointer to initiated DFT into which input data (plasma and/or blood) will be written. |
loginfo | Give file pointer (for example stdout) where log information is printed; NULL if not needed; warnings will be printed in stderr anyway. |
verbose | Verbose level; if zero, then only warnings are printed into stderr. |
status | Pointer to a string (allocated for at least 64 chars) where error message or other execution status will be written; enter NULL, if not needed. |
Definition at line 342 of file dftinput.c.
int dftReadReference | ( | DFT * | tissue, |
char * | filename, | ||
int * | filetype, | ||
int * | ref_index, | ||
char * | status, | ||
int | verbose ) |
Read DFT format reference region TAC data and add it into DFT already containing other tissue TACs, if reference region TAC(s) are be given in a separate file. Alternatively the reference region name can be given, which will then be selected from existing tissue TACs. Reference TACs are marked in DFT with sw=2 (best name match) or sw=1; if reference region file contains several TACs then the one which contains name 'mean' or 'avg' or has shortest total name length is given value sw=2. When necessary, reference data is interpolated and units converted to match the existing tissue DFT. Reference TAC is also integrated into y2[].
tissue | PET data containing existing tissue TACs, possibly also ref regions. |
filename | Reference TAC filename, or region name in previous data. |
filetype | Type of input, as found out here; 1 and 2 =tac, 3=fit, 5=region name; enter NULL, if not needed. |
ref_index | Index of the best reference region; enter NULL if not needed. |
status | Pointer to a string (allocated for at least 64 chars) where error message or other execution status will be written; enter NULL, if not needed. |
verbose | Verbose level; if zero, then nothing is printed to stderr or stdout. |
Definition at line 204 of file dftinput.c.
int dftRobustMinMaxTAC | ( | DFT * | dft, |
int | tacindex, | ||
double * | minx, | ||
double * | maxx, | ||
double * | miny, | ||
double * | maxy, | ||
int * | mini, | ||
int * | maxi, | ||
int * | mins, | ||
int * | maxs, | ||
int | verbose ) |
Robust search of the min and max values of DFT TAC data. Data may contain NaN's, and individual outliers are not taken as min or max.
dft | Pointer to the DFT TAC data to search. |
tacindex | Index of the only TAC which is searched for min and max; <0 if all. |
minx | Pointer to X at TAC min; set to NULL if not needed. |
maxx | Pointer to X at TAC max; set to NULL if not needed. |
miny | Pointer to min Y; set to NULL if not needed. |
maxy | Pointer to max Y; set to NULL if not needed. |
mini | Index of min TAC; set to NULL if not needed. |
maxi | Index of max TAC; set to NULL if not needed. |
mins | Index of min sample; set to NULL if not needed. |
maxs | Index of max sample; set to NULL if not needed. |
verbose | Verbose level; if zero, then nothing is printed to stderr or stdout. |
Definition at line 608 of file dftinput.c.
int dftVerifyPeak | ( | DFT * | dft, |
int | index, | ||
int | verbose, | ||
char * | status ) |
Verify that specified (input) TAC contains peak and that it does not start too late to get reliable estimate of AUC.
dft | Pointer to TAC data which is verified. |
index | Index of TAC to be verified; <0 in case all are (separately) verified. |
verbose | Verbose level; if zero, then nothing is printed to stderr or stdout. |
status | Pointer to a string (allocated for at least 64 chars) where error message or other execution status will be written; enter NULL, if not needed. |
Definition at line 747 of file dftinput.c.
Referenced by dftFixPeak(), dftReadinput(), and imgReadModelingData().