Cli Tac Fitting =============== .. py:module:: petpal.cli.cli_tac_fitting .. autoapi-nested-parse:: Command-line interface (CLI) for fitting Tissue Compartment Models (TCM) to PET Time-Activity Curves (TACs). This module provides a CLI to interact with the tac_fitting module. It utilizes argparse to handle command-line arguments. The user must provide: * Input TAC file path * Region of Interest (ROI) TAC file path * Compartment model name for fitting. Supported models are '1tcm', '2tcm-k4zero', or 'serial-2tcm'. * Filename prefix for the output files * Output directory where the analysis results will be saved * Whether to ignore blood volume contributions while fitting * Threshold in minutes (input fitting threshold) User can optionally provide: * Initial guesses for the fitting parameters * Lower and upper bounds for the fitting parameters * Maximum number of function iterations * Decay constant (in minutes) for per-frame weighting This script utilizes the :class:`TCMAnalysis` class to perform the TAC fitting and save the results accordingly. .. rubric:: Examples In the proceeding example, we assume that we have an input TAC named 'input_tac.txt', and an ROI TAC named 'roi_tac.tsv'. We want to try fitting a serial 2TCM to the ROI tac. .. code-block:: bash petpal-tcm-fit interp -i "input_tac.tsv"\ -r "roi_tac.tsv"\ -m "serial-2tcm"\ -o "./" -p "cli_"\ -t 35.0\ -g 0.1 0.1 0.1 0.1 0.1\ -l 0.0 0.0 0.0 0.0 0.0\ -u 5.0 5.0 5.0 5.0 5.0\ -f 2500 -n 4096 -b --print In this next example, we assume that we have an input TAC named 'input_tac.txt', an ROI TACs directory named './roi_tas/' which contains TACs for different ROIs, and a scan/image metadata file called 'scan_info.json'. We want to try fitting serial 2TCM to the ROI tacs, with the default bounds. .. code-block:: bash petpal-tcm-fit frame_avgd -i "input_tac.tsv"\ -r "./roi_tacs/"\ -s "scan_info.json"\ -m "serial-2tcm"\ -o "./" -p "cli_"\ -f 2500 -n 4096 -b --print .. seealso:: :mod:`petpal.tac_fitting` - module for fitting TACs with TCMs. Attributes ---------- .. autoapisummary:: petpal.cli.cli_tac_fitting._EXAMPLE_ Functions --------- .. toctree:: :hidden: /autoapi/petpal/cli/cli_tac_fitting/add_common_io_args /autoapi/petpal/cli/cli_tac_fitting/add_common_analysis_args /autoapi/petpal/cli/cli_tac_fitting/add_common_print_args /autoapi/petpal/cli/cli_tac_fitting/_generate_args /autoapi/petpal/cli/cli_tac_fitting/_generate_bounds /autoapi/petpal/cli/cli_tac_fitting/fit_props_printer .. autoapisummary:: :nosignatures: petpal.cli.cli_tac_fitting.add_common_io_args petpal.cli.cli_tac_fitting.add_common_analysis_args petpal.cli.cli_tac_fitting.add_common_print_args petpal.cli.cli_tac_fitting._generate_args petpal.cli.cli_tac_fitting._generate_bounds petpal.cli.cli_tac_fitting.fit_props_printer Module Contents --------------- .. py:data:: _EXAMPLE_ :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """Fitting a TAC to the serial 2TCM using the interpolation strategy: petpal-tcm-fit interp -i "input_tac.txt" -r "2tcm_tac.txt" -m "serial-2tcm" -o "./" -p "cli_" -t 35.0 -g 0.1 0.1 0.1 0.1 0.1 -l 0.0 0.0 0.0 0.0 0.0 -u 5.0 5.0 5.0 5.0 5.0 -f 2500 -n 4096 -b --print Fitting a TAC to the serial 2TCM using the frame averaged strategy: petpal-tcm-fit frame_avgd -i "input_tac.txt" -r "2tcm_tac.txt" -s scan_metadata.json -m "serial-2tcm" -o "./" -p "cli_" -g 0.1 0.1 0.1 0.1 0.1 -l 0.0 0.0 0.0 0.0 0.0 -u 5.0 5.0 5.0 5.0 5.0 -f 2500 -n 4096 -b --print""" .. raw:: html