|
TPCCLIB
|
Reading TACs to be used in modelling. More...
#include "tpcclibConfig.h"#include <stdio.h>#include <stdlib.h>#include <math.h>#include <time.h>#include <string.h>#include "tpcextensions.h"#include "tpcli.h"#include "tpctac.h"#include "tpctacmod.h"Go to the source code of this file.
Functions | |
| int | tacFittime (TAC *d, double *startTime, double *endTime, int *first, int *last, TPCSTATUS *status) |
| int | tacReadModelingData (const char *tissuefile, const char *inputfile1, const char *inputfile2, const char *inputfile3, double *fitdur, int cutInput, int *fitSampleNr, TAC *tis, TAC *inp, TPCSTATUS *status) |
| Read tissue and input data for modelling. | |
| int | tacReadReference (TAC *tis, const char *reference, TAC *ref, int *refIndex, TPCSTATUS *status) |
| Read reference tissue TAC. | |
| int | tacReadModelingInput (const char *inputfile1, const char *inputfile2, const char *inputfile3, TAC *inp, TPCSTATUS *status) |
| Read arterial input data for modelling. | |
Reading TACs to be used in modelling.
Definition in file tacmodelinput.c.
| int tacFittime | ( | TAC * | d, |
| double * | startTime, | ||
| double * | endTime, | ||
| int * | first, | ||
| int * | last, | ||
| TPCSTATUS * | status ) |
Reset user-defined fit time range to comply with TAC data.
| d | Pointer to TAC containing (regional tissue) data; times can be in minutes or seconds, as long as units are defined. TAC sampleNr is not changed in this function. |
| startTime | Pointer containing originally the requested fit start time (min). This is changed to contain the time of the first included frame. Unit must be minutes. Initially, set to <0 to start from the beginning of the data. |
| endTime | Pointer containing originally the requested fit end time (min). This is changed to contain the time of the last included frame. Unit must be minutes. Initially, set to <0 or to a very large value to reach to the end of data. |
| first | Function writes the index of the first included sample (frame) here; enter NULL if not needed. |
| last | Function writes the index of the last included sample (frame) here; enter NULL if not needed. |
| status | Pointer to status data; enter NULL if not needed. |
Definition at line 25 of file tacmodelinput.c.
Referenced by tacReadModelingData().
| int tacReadModelingData | ( | const char * | tissuefile, |
| const char * | inputfile1, | ||
| const char * | inputfile2, | ||
| const char * | inputfile3, | ||
| double * | fitdur, | ||
| int | cutInput, | ||
| int * | fitSampleNr, | ||
| TAC * | tis, | ||
| TAC * | inp, | ||
| TPCSTATUS * | status ) |
Read tissue and input data for modelling.
Time units are converted to min and input calibration units to the units of tissue data. Input data is NOT interpolated to tissue times, but original sample times are kept. If input data extends much further than fit duration, the last part is removed to save computation time in simulations. Input data ranges or TAC shapes are NOT verified.
| tissuefile | Tissue data file name; one time sample is sufficient here; required. |
| inputfile1 | 1st input data file name; required. |
| inputfile2 | 2nd input data file name (or NULL or empty string if not needed); required, if inputfile3 is given. |
| inputfile3 | 3rd input data file name (or NULL or empty string if not needed). |
| fitdur | Fit duration (in minutes); shortened if longer than tissue data; input data is cut (if requested) so that it will not be much longer. Tissue TACs are NOT cut to this time. |
| cutInput | Cut off too many input samples to make calculation faster by entering <>0 here, or 0 to keep all input samples (which may be needed for delay correction). |
| fitSampleNr | Nr of time frames (samples) in tissue data that are inside fitdur will be written here; enter NULL if not needed. |
| tis | Pointer to initiated TAC struct into which tissue data will be written; required. |
| inp | Pointer to initiated TAC struct into which input data (plasma and/or blood) TACs will be written; required. |
| status | Pointer to status data; enter NULL if not needed. |
Definition at line 130 of file tacmodelinput.c.
| int tacReadModelingInput | ( | const char * | inputfile1, |
| const char * | inputfile2, | ||
| const char * | inputfile3, | ||
| TAC * | inp, | ||
| TPCSTATUS * | status ) |
Read arterial input data for modelling.
Time and calibration units to the units of the first data. Input data ranges or TAC shapes are NOT verified.
| inputfile1 | 1st input data file name; required. |
| inputfile2 | 2nd input data file name (or NULL or empty string if not needed); required, if inputfile3 is given. |
| inputfile3 | 3rd input data file name (or NULL or empty string if not needed). |
| inp | Pointer to initiated TAC data structure into which input data (plasma and/or blood) TACs will be written; required. |
| status | Pointer to status data; enter NULL if not needed. |
Definition at line 560 of file tacmodelinput.c.
| int tacReadReference | ( | TAC * | tis, |
| const char * | reference, | ||
| TAC * | ref, | ||
| int * | refIndex, | ||
| TPCSTATUS * | status ) |
Read reference tissue TAC.
Reference tissue TAC is read either from a TAC file or from TAC structure containing all regional TACs based on its name. Reference tissue TACs are then either placed in a separate TAC structure, if provided by the user, or added/marked inside the existing TAC structure. Reference TAC(s) are marked with sw=2 (best or only 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 assumed to be the best guess of true reference region and marked with value sw=2. When necessary, reference data units are converted to match the existing tissue TAC. If reference TAC(s) are read from a file, then this function verifies that the sample times do match the existing TACs. Reference TAC shapes are NOT verified.
| tis | Pointer to TAC structure containing the regional tissue TACs, possibly also the reference TAC(s). If pointer to reference TAC structure is not given (below), then the reference TAC(s) are marked/added in this TAC structure; otherwise reference TAC(s) may be moved from this structure into the reference TAC structure. |
| reference | String containing either the name of reference TAC file, or reference region name or number in the TAC structure (above). |
| ref | Pointer to output TAC structure into which the reference tissue TACs are placed. Enter NULL, if reference TACs are to be placed/kept in the TAC structure with all tissue TACs. TACs in this structure will be marked with either sw=2 (best guess of true reference region) or sw=1 (less probable reference TACs). Any previous contents are deleted. |
| refIndex | Index of the best reference region; enter NULL if not needed. |
| status | Pointer to status data; enter NULL if not needed. |
Definition at line 390 of file tacmodelinput.c.