infer_sub_ses_from_tac_path#
- petpal.utils.image_io.infer_sub_ses_from_tac_path(tac_path: str)#
Infers subject and session IDs from a TAC file path by analyzing the filename.
This method extracts subject and session IDs from the filename of a TAC file. It checks the presence of a sub- and ses- marker in the filename, which is followed by the subject and session respectively. This segment name is then formatted with each part capitalized. If no subject or session is found a generic value of UNK is returned.
- Parameters:
tac_path (str) – Path of the TAC file.
tac_id (int) – ID of the TAC.
- Returns:
tuple – Inferred subject and session IDs.