Skip to content

Commit

Permalink
Bug in moving the images to the BIDS output
Browse files Browse the repository at this point in the history
  • Loading branch information
spirosmaggioros committed Nov 1, 2024
1 parent 07ac76f commit 1429752
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions NiChart_DLMUSE/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,11 @@ def merge_bids_output_data(out_data: str) -> None:
"""
Move all the images on the s5_relabeled subfolder to the subfolder of their prefix
"""
relabeled_dir = os.path.join(out_data, "s5_relabeled")
for img in os.listdir(relabeled_dir):
img_prefix = get_bids_prefix(img)
os.system(f"mv {relabeled_dir}/{img} {img_prefix}/anat/")
for split in os.listdir(out_data):
if get_bids_prefix(split) == "split_":
s5_relabeled_dir = os.path.join(out_data, split, "temp_working_dir", "s5_relabeled")
for img in s5_relabeled_dir:
os.system(f"mv {s5_relabeled_dir}/{img} {out_data}/{get_bids_prefix(img)}/anat/")

def split_data(in_dir: str, N: int) -> list:
"""
Expand Down

0 comments on commit 1429752

Please sign in to comment.