ConvTcmModelConfig#

class petpal.kinetic_modeling.tac_fitting.ConvTcmModelConfig(func: Callable, param_names: list[str], default_bounds: numpy.ndarray, pretty_param_names: list[str] | None = None)#

Bases: TcmModelConfig

Configuration for convolution-based TCM models.

This subclass of TcmModelConfig provides configurations specific to TCM models that use convolution-based implementations. Supported models include 1TCM, 2TCM with k4=0, and serial 2TCM.

Variables:

_NAME_TO_FUNC (dict[str, Callable]) – Mapping of normalized model names to their corresponding convolution-based TCM functions.

Initialize a TCM model configuration.

Parameters:
  • func (Callable) – The tissue compartment model function.

  • param_names (list[str]) – List of parameter names.

  • default_bounds (np.ndarray) – Default parameter bounds array with shape (num_params, 3).

  • pretty_param_names (list[str] or None, optional) – Pretty-printed parameter names for display. If None, uses param_names. Defaults to None.

static normalize_name(name: str) str#

Normalize a model name to a standard format.

Converts the name to lowercase and replaces spaces and underscores with hyphens for consistent model name lookup.

Parameters:

name (str) – The model name to normalize.

Returns:

str – The normalized model name.

Example

from petpal.kinetic_modeling.tac_fitting import TcmModelConfig
TcmModelConfig.normalize_name("Serial 2TCM")  # Returns "serial-2tcm"
TcmModelConfig.normalize_name("1TCM")  # Returns "1tcm"
classmethod valid_model_names() list[str]#

Get a sorted list of all valid model names.

Returns:

list[str] – Sorted list of valid model name strings.

classmethod resolve_model_name(model_name: str) Callable#

Resolve a model name string to its corresponding TCM function.

Parameters:

model_name (str) – The name of the compartment model.

Returns:

Callable – The TCM function corresponding to the model name.

Raises:

ValueError – If the model_name does not correspond to a known model.

Example

from petpal.kinetic_modeling.tac_fitting import TcmModelConfig
func = TcmModelConfig.resolve_model_name("2tcm")
# Returns the 2TCM function