diff --git a/NiChart_DLMUSE/__main__.py b/NiChart_DLMUSE/__main__.py index 8c22107..963e46e 100644 --- a/NiChart_DLMUSE/__main__.py +++ b/NiChart_DLMUSE/__main__.py @@ -126,7 +126,7 @@ def main() -> None: threads = [] for i in range(len(subfolders)): - curr_out_dir = out_dir + f"split_{i}" + curr_out_dir = out_dir + f"/split_{i}" curr_thread = threading.Thread( target=run_pipeline, args=(subfolders[i], curr_out_dir, device) ) diff --git a/NiChart_DLMUSE/utils.py b/NiChart_DLMUSE/utils.py index 100a543..bf87ad5 100644 --- a/NiChart_DLMUSE/utils.py +++ b/NiChart_DLMUSE/utils.py @@ -172,22 +172,22 @@ def remove_subfolders(in_dir: str) -> None: os.system(f"rm -r {in_dir}split_*") def merge_output_data(in_dir: str) -> None: - os.system(f"mkdir {in_dir}results") - os.system(f"mkdir {in_dir}results/s1_reorient_lps") - os.system(f"mkdir {in_dir}results/s2_dlicv") - os.system(f"mkdir {in_dir}results/s3_masked") - os.system(f"mkdir {in_dir}results/s4_dlmuse") - os.system(f"mkdir {in_dir}results/s5_relabeled") - os.system(f"mkdir {in_dir}results/s6_combined") + os.system(f"mkdir {in_dir}/results") + os.system(f"mkdir {in_dir}/results/s1_reorient_lps") + os.system(f"mkdir {in_dir}/results/s2_dlicv") + os.system(f"mkdir {in_dir}/results/s3_masked") + os.system(f"mkdir {in_dir}/results/s4_dlmuse") + os.system(f"mkdir {in_dir}/results/s5_relabeled") + os.system(f"mkdir {in_dir}/results/s6_combined") for dir in os.listdir(in_dir): - os.system(f"mv {in_dir}{dir}/temp_working_dir/s1_reorient_lps/* {in_dir}results/s1_reorient_lps/") - os.system(f"mv {in_dir}{dir}/temp_working_dir/s2_dlicv/* {in_dir}results/s2_dlicv/") - os.system(f"mv {in_dir}{dir}/temp_working_dir/s3_masked/* {in_dir}results/s3_masked/") - os.system(f"mv {in_dir}{dir}/temp_working_dir/s4_dlmuse/* {in_dir}results/s4_dlmuse/") - os.system(f"mv {in_dir}{dir}/temp_working_dir/s5_relabeled/* {in_dir}results/s5_relabeled/") - os.system(f"mv {in_dir}{dir}/temp_working_dir/s6_combined/* {in_dir}results/s6_combined/") - os.system(f"mv {in_dir}*.nii.gz {in_dir}results/") + os.system(f"mv {in_dir}/{dir}/temp_working_dir/s1_reorient_lps/* {in_dir}/results/s1_reorient_lps/") + os.system(f"mv {in_dir}/{dir}/temp_working_dir/s2_dlicv/* {in_dir}/results/s2_dlicv/") + os.system(f"mv {in_dir}/{dir}/temp_working_dir/s3_masked/* {in_dir}/results/s3_masked/") + os.system(f"mv {in_dir}/{dir}/temp_working_dir/s4_dlmuse/* {in_dir}/results/s4_dlmuse/") + os.system(f"mv {in_dir}/{dir}/temp_working_dir/s5_relabeled/* {in_dir}/results/s5_relabeled/") + os.system(f"mv {in_dir}/{dir}/temp_working_dir/s6_combined/* {in_dir}/results/s6_combined/") + os.system(f"mv {in_dir}/*.nii.gz {in_dir}/results/") for dir in os.listdir(in_dir): os.system(f"rm -r {dir}")