Skip to content

Commit

Permalink
Fix HCP ingression for non-rest tasks (#986)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsalo authored Oct 31, 2023
1 parent 66a8fe3 commit f38dae2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions xcp_d/utils/hcp2fmriprep.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,13 @@ def convert_hcp_to_bids_single_subject(in_dir, out_dir, sub_ent):
# NOTE: What is the first element in the folder name?
_, base_task_id, dir_id = base_task_name.split("_")
match = re.match(r"([A-Za-z0-9]+[a-zA-Z]+)(\d+)$", base_task_id)
task_id = match.group(1).lower()
run_id = int(match.group(2))
if match:
task_id = match.group(1).lower()
run_id = int(match.group(2))
else:
task_id = base_task_id.lower()
run_id = 1

task_ent = f"task-{task_id}"
run_ent = f"run-{run_id}"
dir_ent = f"dir-{dir_id}"
Expand Down

0 comments on commit f38dae2

Please sign in to comment.