Skip to content

Commit 7f32220

Browse files
committed
FIX: apply changes from code review
1 parent 3e2257d commit 7f32220

File tree

1 file changed

+0
-28
lines changed

1 file changed

+0
-28
lines changed

petdeface/petdeface.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1397,33 +1397,5 @@ def main(): # noqa: max-complexity: 12
13971397
print("QA report generation failed, but defacing completed successfully.")
13981398

13991399

1400-
def collect_subject_files(file_list: list) -> dict:
1401-
"""Collect files that share the same subject ID into a dictionary.
1402-
1403-
Parameters
1404-
----------
1405-
file_list : list
1406-
List of file paths to process
1407-
1408-
Returns
1409-
-------
1410-
dict
1411-
Dictionary mapping subject IDs to lists of their files
1412-
Format: {"sub-*": ["file1", "file2", ...]}
1413-
"""
1414-
subject_files = {}
1415-
1416-
for file_path in file_list:
1417-
# Extract subject ID using regex - matches 'sub-' followed by alphanumeric chars until underscore
1418-
match = re.search(r"sub-[a-zA-Z0-9]+(?=_)", str(file_path))
1419-
if match:
1420-
sub_id = match.group(0)
1421-
if sub_id not in subject_files:
1422-
subject_files[sub_id] = []
1423-
subject_files[sub_id].append(str(file_path))
1424-
1425-
return subject_files
1426-
1427-
14281400
if __name__ == "__main__":
14291401
main()

0 commit comments

Comments
 (0)