fit_frtm_to_tac#

petpal.kinetic_modeling.reference_tissue_models.fit_frtm_to_tac(tac_times_in_minutes: numpy.ndarray, tgt_tac_vals: numpy.ndarray, ref_tac_vals: numpy.ndarray, r1_start: float = 0.5, k2_start: float = 0.5, k3_start: float = 0.5, k4_start: float = 0.5) tuple#

Fit FRTM to the provided target Time Activity Curve (TAC), given the reference TAC, times, and starting guesses for the kinetic parameters.

Important

This function assumes that the reference TAC is uniformly sampled with respect to time since we perform convolutions.

This is a simple wrapper around scipy.optimize.curve_fit() and does not use any bounds for the different parameters.

Parameters:
  • tac_times_in_minutes (np.ndarray) – The array representing the time-points for both TACs.

  • tgt_tac_vals (np.ndarray) – Target TAC to fit with the SRTM.

  • ref_tac_vals (np.ndarray) – Reference (and Target) TAC times.

  • r1_start (float) – Starting guess for the \(R_1\equiv\frac{k_1^\prime}{k_1}\) parameter.

  • k2_start (float) – Starting guess for \(k_2\) parameter.

  • k3_start (float) – Starting guess for \(k_3\) parameter.

  • k4_start (float) – Starting guess for \(k_4\) parameter.

Returns:

tuple

(fit_parameters, fit_covariance). Output from

scipy.optimize.curve_fit()

Raises:

AssertionError – If the reference TAC and times are different dimensions.

See also