Tcms As Convolutions#

This module contains a collection of functions to compute Time-Activity Curves (TACs) for common Tissue Compartment Models (TCMs). These models are commonly used for kinetic analysis of PET TACs.

Note

All response functions in this module are decorated with numba.jit(). It compiles the function to machine code at runtime (Just-In-Time compilation), which usually provides a significant speed-up.

Requires:

The module relies on the numpy and numba modules.

Todo

Add the derivations of the solutions to the Tissue Compartment Models in the module docstring.

Functions#

calc_convolution_with_check(→ numpy.ndarray)

Performs a discrete convolution of two arrays, assumed to represent time-series data. Checks if the arrays are

discrete_convolution_with_exponential(func_times, ...)

Computes the convolution of the given function with an exponential kernel.

response_function_1tcm_c1(→ numpy.ndarray)

The response function for the 1TCM \(f(t)=k_1 e^{-k_{2}t}\)

response_function_2tcm_with_k4zero_c1(→ numpy.ndarray)

The response function for first compartment in the serial 2TCM with

response_function_2tcm_with_k4zero_c2(→ numpy.ndarray)

The response function for second compartment in the serial 2TCM with \(k_{4}=0\);

response_function_serial_2tcm_c1(→ numpy.ndarray)

The response function for first compartment in the serial 2TCM.

response_function_serial_2tcm_c2(→ numpy.ndarray)

The response function for second compartment in the serial 2TCM.

gen_tac_1tcm_cpet_from_tac(→ list[numpy.ndarray, ...)

Calculate the TTAC, given the input TAC, for a 1TCM as an explicit convolution.

generate_tac_2tcm_with_k4zero_c1_from_tac(→ numpy.ndarray)

Calculate the TTAC of the first comparment, given the input TAC, for a 2TCM (with \(k_{4}=0\)) as an explicit

generate_tac_2tcm_with_k4zero_c2_from_tac(→ numpy.ndarray)

Calculate the TTAC of the second comparment, given the input TAC, for a 2TCM (with \(k_{4}=0\)) as an

gen_tac_2tcm_with_k4zero_cpet_from_tac(...)

Calculate the PET-TTAC (sum of both compartments), given the input TAC, for a 2TCM (with \(k_{4}=0\)) as an

generate_tac_serial_2tcm_c1_from_tac(→ numpy.ndarray)

Calculate the TTAC of the first compartment, given the input TAC, for a serial 2TCM as an explicit convolution.

generate_tac_serial_2tcm_c2_from_tac(→ numpy.ndarray)

Calculate the TTAC of the second comparment, given the input TAC, for a serial 2TCM as an explicit convolution.

gen_tac_2tcm_cpet_from_tac(→ list[numpy.ndarray, ...)

Generates PET TAC values using the serial 2TCM.

model_serial_1tcm_frame_avgd(→ numpy.ndarray)

model_serial_2tcm_frame_avgd(→ numpy.ndarray)