FrameAvgdTcmModelConfig#
- class petpal.kinetic_modeling.tac_fitting.FrameAvgdTcmModelConfig(func: Callable, param_names: list[str], default_bounds: numpy.ndarray, pretty_param_names: list[str] | None = None)#
Bases:
TcmModelConfigConfiguration for frame-averaged TCM models.
This subclass of
TcmModelConfigprovides configurations specific to TCM models that operate on frame-averaged data. These models internally use convolution-based models as inConvTcmModelConfig, but expose a different API optimized for frame-averaged fitting.- Variables:
_NAME_TO_FUNC (dict[str, Callable]) – Mapping of normalized model names to their corresponding frame-averaged TCM functions.
Note
These models internally use convolution-based models as in
ConvTcmModelConfig, but expose a different API for frame-averaged fitting.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