Using fslroi to remove volumes

Hi all! I am trying to use the fslroi command to remove the first 22 volumes from a scan. This is the command I am entering (the data has already been preprocessed through fmriprep):

fslroi sub-63_task-rest_space-MNI152NLin2009cAsym_desc-smoothAROMAnonaggr_bold.nii.gz sub-63_task-rest_space-MNI152NLin2009cAsym_desc-smoothAROMAnonaggr_bold2.nii.gz 22 218

And this is the error I am receiving:

Cannot open volume sub-63_task-rest_space-MNI152NLin2009cAsym_desc-smoothAROMAnonaggr_bold for reading!

It is not a permissions error, or at least, it shouldn’t be as all rwx permissions are present! Just wondering if anyone had any insight! Thanks so much.

I’m not really sure. Have you checked the file with something like mricron to be sure that it has contents? Or some CLI tools that might help:

du -sh sub-63_task-rest_space-MNI152NLin2009cAsym_desc-smoothAROMAnonaggr_bold.nii.gz
nib-ls sub-63_task-rest_space-MNI152NLin2009cAsym_desc-smoothAROMAnonaggr_bold.nii.gz