Hello SCT team,
I am trying to run the command
sct_register_to_template -i fmri_spine_moco_mean.nii.gz -s fmri_spine_moco_mean_seg_corr.nii.gz -l fmri_labels.nii.gz
It works and registers properly, but I keep getting an error when it goes to save the warping fields. The error I get is pasted below and is the same error as in this post, but there is no solution that helps me.
I am running this command through WSL on an external drive. My computer does not have enough storage space for all the data so I have to keep it on the external drive. I have tried the command locally with the full paths to the external drive for the data, but that doesn’t work. However, if I move the data locally on my computer and run it it works.
I am assuming it doesn’t like the external drive, but I don’t have a solution to that so any help is much appreciated.
My next thoughts are to just reinstall SCT and see if that does anything.
Generate output files…
File warp_template2anat.nii.gz already exists. Deleting it…
Traceback (most recent call last):
File “/home/sensel/spinalcordtoolbox/python/envs/venv_sct/lib/python3.7/shutil.py”, line 566, in move
os.rename(src, real_dst)
OSError: [Errno 18] Invalid cross-device link: ‘/tmp/sct-20220706151611.621359-register_to_template-9y2i33xq/warp_template2anat.nii.gz’ → ‘warp_template2anat.nii.gz’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/home/sensel/spinalcordtoolbox/spinalcordtoolbox/scripts/sct_register_to_template.py”, line 1336, in
main(sys.argv[1:])
File “/home/sensel/spinalcordtoolbox/spinalcordtoolbox/scripts/sct_register_to_template.py”, line 767, in main
generate_output_file(os.path.join(path_tmp, “warp_template2anat.nii.gz”), os.path.join(path_output, “warp_template2anat.nii.gz”), verbose=verbose)
File “/home/sensel/spinalcordtoolbox/spinalcordtoolbox/image.py”, line 1480, in generate_output_file
shutil.move(fname_in, fname_out)
File “/home/sensel/spinalcordtoolbox/python/envs/venv_sct/lib/python3.7/shutil.py”, line 580, in move
copy_function(src, real_dst)
File “/home/sensel/spinalcordtoolbox/python/envs/venv_sct/lib/python3.7/shutil.py”, line 267, in copy2
copystat(src, dst, follow_symlinks=follow_symlinks)
File “/home/sensel/spinalcordtoolbox/python/envs/venv_sct/lib/python3.7/shutil.py”, line 206, in copystat
follow_symlinks=follow)
PermissionError: [Errno 1] Operation not permitted