get_graphical_analysis_method#
- petpal.kinetic_modeling.graphical_analysis.get_graphical_analysis_method(method_name: str) collections.abc.Callable#
Function for obtaining the appropriate graphical analysis method.
This function accepts a string specifying a graphical time-activity curve (TAC) analysis method. It returns a reference to the function that performs the selected analysis method.
- Parameters:
method_name (str) – The name of the graphical method. This should be one of the following strings: ‘patlak’, ‘logan’, ‘logan_ref’, or ‘alt_logan’.
- Returns:
function – A reference to the function that performs the corresponding graphical TAC analysis. The returned function will take arguments specific to the analysis method, such as input TAC values, tissue TAC values, TAC times in minutes, and threshold time in minutes.
- Raises:
ValueError – If method_name is not one of the supported graphical analysis methods, i.e., ‘patlak’, ‘logan’, ‘logan_ref’, or ‘alt_logan’.
Example
from petpal.graphical_analysis import get_graphical_analysis_method as get_method from petpal.utils.image_io import safe_load_tac as load_tac selected_func = get_method('logan') input_tac_values, tac_times_in_minutes = load_tac("PATH/TO/PLASMA/TAC.tsv") tissue_tac_values, _ = load_tac("PATH/TO/ROI/TAC.tsv") results = selected_func(tac_times_in_minutes, input_tac_values, tissue_tac_values, t_thresh_in_minutes) print(results)