TcmModelConfig ================================================== .. py:class:: petpal.kinetic_modeling.tac_fitting.TcmModelConfig(func: Callable, param_names: list[str], default_bounds: numpy.ndarray, pretty_param_names: list[str] | None = None) Base configuration class for Tissue Compartment Model (TCM) specifications. This class encapsulates the essential properties of a TCM including the model function, parameter names, default bounds, and pretty-printed parameter names for visualization. It provides utilities for normalizing model names and resolving model names to their corresponding functions. :ivar func: The TCM function implementation. :vartype func: Callable :ivar param_names: List of parameter names (e.g., ['k1', 'k2', 'vb']). :vartype param_names: list[str] :ivar pretty_param_names: List of formatted parameter names for display (e.g., [r'$K_1$', r'$k_2$']). :vartype pretty_param_names: list[str] :ivar default_bounds: Default bounds for parameters with shape (num_params, 3) where each row contains [initial_guess, lower_bound, upper_bound]. :vartype default_bounds: np.ndarray :ivar num_params: Number of parameters in the model. :vartype num_params: int .. seealso:: * :class:`~.ConvTcmModelConfig` * :class:`~.FrameAvgdTcmModelConfig` Initialize a TCM model configuration. :param func: The tissue compartment model function. :type func: Callable :param param_names: List of parameter names. :type param_names: list[str] :param default_bounds: Default parameter bounds array with shape (num_params, 3). :type default_bounds: np.ndarray :param pretty_param_names: Pretty-printed parameter names for display. If None, uses param_names. Defaults to None. :type pretty_param_names: list[str] or None, optional .. py:method:: normalize_name(name: str) -> str :staticmethod: 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. :param name: The model name to normalize. :type name: str :returns: *str* -- The normalized model name. .. rubric:: Example .. code-block:: python from petpal.kinetic_modeling.tac_fitting import TcmModelConfig TcmModelConfig.normalize_name("Serial 2TCM") # Returns "serial-2tcm" TcmModelConfig.normalize_name("1TCM") # Returns "1tcm" .. py:method:: valid_model_names() -> list[str] :classmethod: Get a sorted list of all valid model names. :returns: *list[str]* -- Sorted list of valid model name strings. .. py:method:: resolve_model_name(model_name: str) -> Callable :classmethod: Resolve a model name string to its corresponding TCM function. :param model_name: The name of the compartment model. :type model_name: str :returns: *Callable* -- The TCM function corresponding to the model name. :raises ValueError: If the model_name does not correspond to a known model. .. rubric:: Example .. code-block:: python from petpal.kinetic_modeling.tac_fitting import TcmModelConfig func = TcmModelConfig.resolve_model_name("2tcm") # Returns the 2TCM function