roi_tac ============================================== .. py:function:: petpal.preproc.regional_tac_extraction.roi_tac(input_image_path: str, roi_image_path: str, region: list[int] | int, out_tac_path: str | None = None, time_frame_keyword: str = 'FrameReferenceTime') -> petpal.utils.time_activity_curve.TimeActivityCurve Function to write Tissue Activity Curves for a single region, given a mask, 4D PET image, and region mapping. Computes the average of the PET image within each region. Writes a tsv table with region name, frame start time, and mean value within region. :param input_image_path: Path to the 4D PET image from which the regional TAC will be extracted. :type input_image_path: str :param roi_image_path: Path to the segmentation image containing ROIs. Must be in the same space as input_image. :type roi_image_path: str :param region: The region or regions that will be extracted as a TAC. If a list of regions are provided, the function combines all listed regions and calculates the TAC from the merged region. :type region: list[int] | int :param out_tac_dir: Path to the TSV where the regional TAC will be written to. :type out_tac_dir: str :param time_frame_keyword: Keyword corresponding to either 'FrameReferenceTime' or 'FrameTimesStart' to get the frame timing. Default 'FrameReferenceTime'. :type time_frame_keyword: str :returns: *region_tac (TimeActivityCurve)* -- The mean time activity curve for the region.