diff --git a/xcp_d/utils/concatenation.py b/xcp_d/utils/concatenation.py index f5bae27eb..cb2783c2f 100644 --- a/xcp_d/utils/concatenation.py +++ b/xcp_d/utils/concatenation.py @@ -2,6 +2,7 @@ # vi: set ft=python sts=4 ts=4 sw=4 et: """Functions for concatenating scans across runs.""" +import os from contextlib import suppress import nibabel as nb @@ -58,6 +59,4 @@ def concatenate_niimgs(files, out_file): concat_preproc_img = concat_imgs(files) concat_preproc_img.to_filename(out_file) else: - import subprocess - cmd = ['wb_command', '-cifti-merge', out_file, '-cifti'] + files - subprocess.run(cmd, check=True) + os.system(f"wb_command -cifti-merge {out_file} -cifti {' -cifti '.join(files)}")