Fmriprep antsApplyTransforms error: 'Could not create IO object'

Dear fmriprep experts,

Hi! I’m running fmriprep on the Healthy Brain Network dataset for preprocessing, and keep running into a same problem in a random manner.

I am using the following command:

fmriprep-docker my/input/directory my/output/directory participant --participant-label NDAREU890CYJ --skull-strip-template MNIPediatricAsym:cohort-1 --output-spaces MNIPediatricAsym:cohort-1:res-2 --skip_bids_validation --fs-license-file Desktop/license.txt --nthreads 12 --low-mem --work-dir Desktop/HBN/MRI/temp

and I have added the pediatric template as the output space since I am using a developmental dataset.

fmriprep has been working with most of the subject data pretty well, except for some where it says that it failed and the workflow did not execute cleanly. This is the error description I found in the html :

Traceback (most recent call last):
  File "/opt/conda/lib/python3.8/site-packages/nipype/pipeline/plugins/multiproc.py", line 67, in run_node
    result["result"] = node.run(updatehash=updatehash)
  File "/opt/conda/lib/python3.8/site-packages/nipype/pipeline/engine/nodes.py", line 516, in run
    result = self._run_interface(execute=True)
  File "/opt/conda/lib/python3.8/site-packages/nipype/pipeline/engine/nodes.py", line 635, in _run_interface
    return self._run_command(execute)
  File "/opt/conda/lib/python3.8/site-packages/nipype/pipeline/engine/nodes.py", line 741, in _run_command
    result = self._interface.run(cwd=outdir)
  File "/opt/conda/lib/python3.8/site-packages/nipype/interfaces/base/core.py", line 428, in run
    runtime = self._run_interface(runtime)
  File "/opt/conda/lib/python3.8/site-packages/niworkflows/interfaces/fixes.py", line 64, in _run_interface
    runtime = super(FixHeaderApplyTransforms, self)._run_interface(
  File "/opt/conda/lib/python3.8/site-packages/nipype/interfaces/base/core.py", line 822, in _run_interface
    self.raise_exception(runtime)
  File "/opt/conda/lib/python3.8/site-packages/nipype/interfaces/base/core.py", line 749, in raise_exception
    raise RuntimeError(
RuntimeError: Command:
antsApplyTransforms --default-value 0 --float 0 --input
/scratch/fmriprep_wf/single_subject_NDAREU890CYJ_wf/anat_preproc_wf/surface_recon_wf/segs_to_native_aparc_aseg/resample/
 --interpolation MultiLabel --output seg_trans.nii.gz --reference-image /home/fmriprep/.cache/templateflow/tpl-
MNIPediatricAsym/cohort-1/tpl-MNIPediatricAsym_cohort-1_res-2_T1w.nii.gz --transform
/scratch/fmriprep_wf/single_subject_NDAREU890CYJ_wf/anat_preproc_wf/anat_norm_wf/_template_MNIPediatricAsymcohort-
1/registration/ants_t1_to_mniComposite.h5
Standard output:
Standard error:
Exception caught during reference file reading
itk::ImageFileReaderException (0x3d74740)
Location: "unknown"
File: /src/ants/build/staging/include/ITK-5.1/itkImageFileReader.hxx
Line: 133
Description:  Could not create IO object for reading file /home/fmriprep/.cache/templateflow/tpl-
MNIPediatricAsym/cohort-1/tpl-MNIPediatricAsym_cohort-1_res-2_T1w.nii.gz
  Tried to create one of the following:
    BMPImageIO
    BioRadImageIO
    Bruker2dseqImageIO
    GDCMImageIO
    GE4ImageIO
    GE5ImageIO
    GiplImageIO
    HDF5ImageIO
    JPEGImageIO
    JPEG2000ImageIO
    LSMImageIO
    MGHImageIO
    MINCImageIO
    MRCImageIO
    MetaImageIO
    NiftiImageIO
    NrrdImageIO
    PNGImageIO
    StimulateImageIO
    TIFFImageIO
    VTKImageIO
  You probably failed to set a file suffix, or
    set the suffix to an unsupported type.
 file /home/fmriprep/.cache/templateflow/tpl-MNIPediatricAsym/cohort-1/tpl-MNIPediatricAsym_cohort-1_res-2_T1w.nii.gz
Segmentation fault
Return code: 139

I am suspecting that it’s an issue about ANTS using a non-default template (according to https://neurostars.org/t/moving-images-from-mni-to-bold-epi-native-space/ and https://neurostars.org/t/fmriprep-potentially-antsapplytransforms-and-hd5-issue/ ),
but what is puzzling is that when I remove all output files and rerun fmriprep on the same data with the same commands, it sometimes works.
So, I am growing suspicions that it might be a memory issue since I have been encountering some lately.

Would anyone have any suggestions about the problem? It would be a big help.
Thank you in advance!

Sujin.

Hi,

As a check, have you tried rerunning these subjects with a a clean working directory? Also what version of fMRIprep are you using?

Best,
Steven

Thanks for asking!

Yes, I did rerun with a clean working directory and my fmriprep version is 21.0.2 :slight_smile: