Skip to content

osipi.aif_parker

AIF model as defined by Parker et al (2005)

Parameters:

Name Type Description Default
t ndarray

array of time points in units of sec. [OSIPI code Q.GE1.004]

required
BAT float

Time in seconds before the bolus arrives. Defaults to 0. [OSIPI code Q.BA1.001]

0.0
Hct float

Hematocrit. Defaults to 0.0. [OSIPI code Q.PH1.012]

0.0

Returns:

Type Description
ndarray

np.ndarray: Concentrations in mM for each time point in t.

See Also

aif_georgiou aif_weinmann

References
Example

Create an array of time points covering 6 min in steps of 1 sec, calculate the Parker AIF at these time points and plot the results.

Import packages:

import matplotlib.pyplot as plt import osipi

Calculate AIF and plot

t = np.arange(0, 6 * 60, 1) ca = osipi.aif_parker(t) plt.plot(t, ca) plt.show()

Source code in src/osipi/_aif.py
def aif_parker(t: np.ndarray, BAT: float = 0.0, Hct: float = 0.0) -> np.ndarray:
    """AIF model as defined by Parker et al (2005)

    Args:
        t (np.ndarray): array of time points in units of sec. [OSIPI code Q.GE1.004]
        BAT (float, optional):
            Time in seconds before the bolus arrives. Defaults to 0. [OSIPI code Q.BA1.001]
        Hct (float, optional):
            Hematocrit. Defaults to 0.0. [OSIPI code Q.PH1.012]

    Returns:
        np.ndarray: Concentrations in mM for each time point in t.

    See Also:
        `aif_georgiou`
        `aif_weinmann`

    References:
        - Lexicon url:
            https://osipi.github.io/OSIPI_CAPLEX/perfusionModels/#arterial-input-function-models
        - Lexicon code: M.IC2.001
        - OSIPI name: Parker AIF model
        - Adapted from contribution by: MB_QBI_UoManchester_UK

    Example:
        Create an array of time points covering 6 min in steps of 1 sec,
        calculate the Parker AIF at these time points and plot the results.

        Import packages:

        >>> import matplotlib.pyplot as plt
        >>> import osipi

        Calculate AIF and plot

        >>> t = np.arange(0, 6 * 60, 1)
        >>> ca = osipi.aif_parker(t)
        >>> plt.plot(t, ca)
        >>> plt.show()

    """
    # Convert from OSIPI units (sec) to units used internally (mins)
    t_min = t / 60
    bat_min = BAT / 60

    t_offset = t_min - bat_min

    # A1/(SD1*sqrt(2*PI)) * exp(-(t_offset-m1)^2/(2*var1))
    # A1 = 0.833, SD1 = 0.055, m1 = 0.171
    gaussian1 = 5.73258 * np.exp(
        -1.0 * (t_offset - 0.17046) * (t_offset - 0.17046) / (2.0 * 0.0563 * 0.0563)
    )

    # A2/(SD2*sqrt(2*PI)) * exp(-(t_offset-m2)^2/(2*var2))
    # A2 = 0.336, SD2 = 0.134, m2 = 0.364
    gaussian2 = 0.997356 * np.exp(
        -1.0 * (t_offset - 0.365) * (t_offset - 0.365) / (2.0 * 0.132 * 0.132)
    )
    # alpha*exp(-beta*t_offset) / (1+exp(-s(t_offset-tau)))
    # alpha = 1.064, beta = 0.166, s = 37.772, tau = 0.482
    sigmoid = 1.050 * np.exp(-0.1685 * t_offset) / (1.0 + np.exp(-38.078 * (t_offset - 0.483)))

    pop_aif = (gaussian1 + gaussian2 + sigmoid) / (1.0 - Hct)

    return pop_aif

Example using osipi.aif_parker