avgbolus - tpcclib 0.8.0 © 2023 by Turku PET Centre
Calculate an average curve of several bolus input curves with different
sample times. For simulations.
Usage: avgbolus [Options] meanfile tacfiles
Set the nr of samples to use for bolus appearance time; default is 2.
Set nr=0, if different appearance time is not to be considered.
Peak time is used to align TACs instead of bolus appearance time.
TACs are not scaled to a common AUC.
Standard deviations are not written in output file.
Display usage information on standard output and exit.
Display version and compile information on standard output and exit.
-d[n], --debug[=n], --verbose[=n]
Set the level (n) of debugging messages and listings.
Suppress displaying normal results on standard output.
Suppress displaying anything except errors.
avgbolus apmean.kbq up????ap.kbq
Example 2 (Windows OS):
dir /b *.kbq > filelist.txt
avgbolus apmean.dat filelist.txt
TAC datafiles must contain a time column, and one or more concentration
columns separated by space(s) or tabulator(s). Only the first concentration
column is used in calculations.
If only one input datafile is given, it is assumed to contain a list of
bolus datafiles with paths if necessary. Tabs, commas and newlines can be
used to separate filenames in the list file.
Output datafile will contain three columns: time, avg concentration and s.d.
Program will determine the new sample times based on the shortest of input
Detailed program description:
1) Read first curve from each datafile
2) Replace NaNs with interpolated values.
3) Determine bolus appearance time in each curve based on certain number
of samples with highest slope.
4) Move all curves in time to have a common appearance time.
5) Search the bolus curve with shortest sampling duration.
6) Calculate AUC from 0 to that time from all curves separately.
7) Scale all bolus curves to have the same average AUC.
8) Interpolate all bolus curves to common sample times.
9) Calculate the mean and s.d. curve of all bolus curves.
10) Write the mean and s.d. data in a specified ASCII datafile.
See also: avgttac, avgfract, dftavg, tacadd, interpol, tac2svg, tacformat
Keywords: TAC, simulation, modelling, input