fMRIPrep crashes after bold-to-t1 transform

Summary of what happened:

Dear Community,

I tried the preprocessing which the dataset downloaded from openneuro.

Command used (and if a helper script was used, a link to the helper script or the command generated):

Here is the command I ran.

sudo docker run --rm \
    -ti \
    -v /media/share/Member/eden/retinotopy:/data:ro \
    -v /media/share/Member/eden/retinotopy/step1:/out \
    -v /media/share/Member/eden/retinotopy/work:/work \
    -v /home/eden/license.txt:/opt/freesurfer/license.txt \
    --shm-size="10g" \
    nipreps/fmriprep:latest \
    /data /out/out \
    participant \
    --ignore fieldmaps \
    --fs-license-file /opt/freesurfer/license.txt \
    --output-spaces T1w \
    --fs-no-reconall \
    --use-syn-sdc \
    --work-dir /work \
    --bids-database-dir /media/share/Member/eden/retinotopy \
    --participant_label sub-AG10 sub-AW05

Version:

23.0.0

Environment (Docker, Singularity, custom installation):

Docker

Data formatted according to a validatable standard? Please provide the output of the validator:

Relevant log outputs (up to 20 lines):

But it got the following error:

_AG10_wf/func_preproc_ses_stanfordCNI_task_prf_run_03_wf/bold_std_trans_wf/bold_reference_wf/enhance_and_skullstrip_bold_wf/_std_target_MNI152NLin2009cAsym./skullstrip_second_pass".
230316-04:38:59,328 nipype.workflow INFO:
	 [Node] Executing "first_mask" <niworkflows.interfaces.nibabel.ApplyMask>
230316-04:38:59,378 nipype.workflow INFO:
	 [Node] Executing "skullstrip_second_pass" <nipype.interfaces.afni.preprocess.Automask>
230316-04:38:59,519 nipype.workflow INFO:
	 [Node] Finished "first_mask", elapsed time 0.190078s.
230316-04:38:59,860 nipype.workflow INFO:
	 [Node] Finished "skullstrip_second_pass", elapsed time 0.480572s.
230316-04:39:01,246 nipype.workflow INFO:
	 [Node] Setting-up "fmriprep_23_0_wf.single_subject_AG10_wf.func_preproc_ses_stanfordCNI_task_prf_run_04_wf.bold_std_trans_wf.bold_reference_wf.enhance_and_skullstrip_bold_wf.unifize" in "/work/fmriprep_23_0_wf/single_subject_AG10_wf/func_preproc_ses_stanfordCNI_task_prf_run_04_wf/bold_std_trans_wf/bold_reference_wf/enhance_and_skullstrip_bold_wf/_std_target_MNI152NLin2009cAsym./unifize".
230316-04:39:01,249 nipype.workflow INFO:
	 [Node] Setting-up "fmriprep_23_0_wf.single_subject_AG10_wf.func_preproc_ses_stanfordCNI_task_prf_run_03_wf.bold_std_trans_wf.bold_reference_wf.enhance_and_skullstrip_bold_wf.fixhdr_skullstrip2" in "/work/fmriprep_23_0_wf/single_subject_AG10_wf/func_preproc_ses_stanfordCNI_task_prf_run_03_wf/bold_std_trans_wf/bold_reference_wf/enhance_and_skullstrip_bold_wf/_std_target_MNI152NLin2009cAsym./fixhdr_skullstrip2".
230316-04:39:01,339 nipype.workflow INFO:
	 [Node] Executing "fixhdr_skullstrip2" <niworkflows.interfaces.header.CopyXForm>
230316-04:39:01,370 nipype.workflow INFO:
	 [Node] Executing "unifize" <nipype.interfaces.afni.utils.Unifize>
230316-04:39:01,498 nipype.workflow INFO:
	 [Node] Finished "fixhdr_skullstrip2", elapsed time 0.150893s.
230316-04:39:03,253 nipype.workflow INFO:
	 [Node] Setting-up "fmriprep_23_0_wf.single_subject_AG10_wf.func_preproc_ses_stanfordCNI_task_prf_run_03_wf.bold_std_trans_wf.bold_reference_wf.enhance_and_skullstrip_bold_wf.combine_masks" in "/work/fmriprep_23_0_wf/single_subject_AG10_wf/func_preproc_ses_stanfordCNI_task_prf_run_03_wf/bold_std_trans_wf/bold_reference_wf/enhance_and_skullstrip_bold_wf/_std_target_MNI152NLin2009cAsym./combine_masks".
230316-04:39:03,284 nipype.workflow INFO:
	 [Node] Executing "combine_masks" <nipype.interfaces.fsl.maths.BinaryMaths>
230316-04:39:03,449 nipype.workflow INFO:
	 [Node] Finished "combine_masks", elapsed time 0.164404s.
230316-04:39:05,251 nipype.workflow INFO:
	 [Node] Setting-up "fmriprep_23_0_wf.single_subject_AG10_wf.func_preproc_ses_stanfordCNI_task_prf_run_03_wf.bold_std_trans_wf.bold_reference_wf.enhance_and_skullstrip_bold_wf.apply_mask" in "/work/fmriprep_23_0_wf/single_subject_AG10_wf/func_preproc_ses_stanfordCNI_task_prf_run_03_wf/bold_std_trans_wf/bold_reference_wf/enhance_and_skullstrip_bold_wf/_std_target_MNI152NLin2009cAsym./apply_mask".
230316-04:39:05,492 nipype.workflow INFO:
	 [Node] Executing "apply_mask" <niworkflows.interfaces.nibabel.ApplyMask>
230316-04:39:05,570 nipype.workflow INFO:
	 [Node] Finished "unifize", elapsed time 4.200309s.
230316-04:39:05,667 nipype.workflow INFO:
	 [Node] Finished "apply_mask", elapsed time 0.17389s.
230316-04:39:07,255 nipype.workflow INFO:
	 [Node] Setting-up "fmriprep_23_0_wf.single_subject_AG10_wf.func_preproc_ses_stanfordCNI_task_prf_run_04_wf.bold_std_trans_wf.bold_reference_wf.enhance_and_skullstrip_bold_wf.fixhdr_unifize" in "/work/fmriprep_23_0_wf/single_subject_AG10_wf/func_preproc_ses_stanfordCNI_task_prf_run_04_wf/bold_std_trans_wf/bold_reference_wf/enhance_and_skullstrip_bold_wf/_std_target_MNI152NLin2009cAsym./fixhdr_unifize".
230316-04:39:07,280 nipype.workflow INFO:
	 [Node] Executing "fixhdr_unifize" <niworkflows.interfaces.header.CopyXForm>
230316-04:39:07,773 nipype.workflow INFO:
	 [Node] Finished "fixhdr_unifize", elapsed time 0.492218s.
230316-04:39:09,261 nipype.workflow INFO:
	 [Node] Setting-up "fmriprep_23_0_wf.single_subject_AG10_wf.func_preproc_ses_stanfordCNI_task_prf_run_04_wf.bold_std_trans_wf.bold_reference_wf.enhance_and_skullstrip_bold_wf.skullstrip_second_pass" in "/work/fmriprep_23_0_wf/single_subject_AG10_wf/func_preproc_ses_stanfordCNI_task_prf_run_04_wf/bold_std_trans_wf/bold_reference_wf/enhance_and_skullstrip_bold_wf/_std_target_MNI152NLin2009cAsym./skullstrip_second_pass".
230316-04:39:09,317 nipype.workflow INFO:
	 [Node] Executing "skullstrip_second_pass" <nipype.interfaces.afni.preprocess.Automask>
230316-04:39:09,790 nipype.workflow INFO:
	 [Node] Finished "skullstrip_second_pass", elapsed time 0.472321s.
230316-04:39:11,264 nipype.workflow INFO:
	 [Node] Setting-up "fmriprep_23_0_wf.single_subject_AG10_wf.func_preproc_ses_stanfordCNI_task_prf_run_04_wf.bold_std_trans_wf.bold_reference_wf.enhance_and_skullstrip_bold_wf.fixhdr_skullstrip2" in "/work/fmriprep_23_0_wf/single_subject_AG10_wf/func_preproc_ses_stanfordCNI_task_prf_run_04_wf/bold_std_trans_wf/bold_reference_wf/enhance_and_skullstrip_bold_wf/_std_target_MNI152NLin2009cAsym./fixhdr_skullstrip2".
230316-04:39:11,290 nipype.workflow INFO:
	 [Node] Executing "fixhdr_skullstrip2" <niworkflows.interfaces.header.CopyXForm>
230316-04:39:12,143 nipype.workflow INFO:
	 [Node] Finished "fixhdr_skullstrip2", elapsed time 0.852421s.
230316-04:39:13,263 nipype.workflow INFO:
	 [Node] Setting-up "fmriprep_23_0_wf.single_subject_AG10_wf.func_preproc_ses_stanfordCNI_task_prf_run_04_wf.bold_std_trans_wf.bold_reference_wf.enhance_and_skullstrip_bold_wf.combine_masks" in "/work/fmriprep_23_0_wf/single_subject_AG10_wf/func_preproc_ses_stanfordCNI_task_prf_run_04_wf/bold_std_trans_wf/bold_reference_wf/enhance_and_skullstrip_bold_wf/_std_target_MNI152NLin2009cAsym./combine_masks".
230316-04:39:13,287 nipype.workflow INFO:
	 [Node] Executing "combine_masks" <nipype.interfaces.fsl.maths.BinaryMaths>
230316-04:39:13,451 nipype.workflow INFO:
	 [Node] Finished "combine_masks", elapsed time 0.162186s.
230316-04:39:15,271 nipype.workflow INFO:
	 [Node] Setting-up "fmriprep_23_0_wf.single_subject_AG10_wf.func_preproc_ses_stanfordCNI_task_prf_run_04_wf.bold_std_trans_wf.bold_reference_wf.enhance_and_skullstrip_bold_wf.apply_mask" in "/work/fmriprep_23_0_wf/single_subject_AG10_wf/func_preproc_ses_stanfordCNI_task_prf_run_04_wf/bold_std_trans_wf/bold_reference_wf/enhance_and_skullstrip_bold_wf/_std_target_MNI152NLin2009cAsym./apply_mask".
230316-04:39:15,296 nipype.workflow INFO:
	 [Node] Executing "apply_mask" <niworkflows.interfaces.nibabel.ApplyMask>
230316-04:39:15,409 nipype.workflow INFO:
	 [Node] Finished "apply_mask", elapsed time 0.112201s.
230316-04:39:19,111 nipype.workflow ERROR:
	 could not run node: fmriprep_23_0_wf.single_subject_AW05_wf.func_preproc_ses_stanfordCNI_task_prf_run_01_wf.bold_t1_trans_wf.bold_to_t1w_transform
230316-04:39:19,114 nipype.workflow ERROR:
	 could not run node: fmriprep_23_0_wf.single_subject_AG10_wf.func_preproc_ses_stanfordCNI_task_prf_run_02_wf.bold_t1_trans_wf.bold_to_t1w_transform
230316-04:39:19,117 nipype.workflow ERROR:
	 could not run node: fmriprep_23_0_wf.single_subject_AG10_wf.func_preproc_ses_stanfordCNI_task_prf_run_03_wf.bold_t1_trans_wf.bold_to_t1w_transform
230316-04:39:19,119 nipype.workflow ERROR:
	 could not run node: fmriprep_23_0_wf.single_subject_AG10_wf.func_preproc_ses_stanfordCNI_task_prf_run_04_wf.bold_t1_trans_wf.bold_to_t1w_transform
230316-04:39:19,309 nipype.workflow CRITICAL:
	 fMRIPrep failed: 4 raised. Re-raising first.
230316-04:39:25,630 cli ERROR:
	 Preprocessing did not finish successfully. Errors occurred while processing data from participants: AG10 (4), AW05 (1). Check the HTML reports for details.
230316-04:39:25,630 cli ERROR:
	 Preprocessing did not finish successfully. Errors occurred while processing data from participants: AG10 (4), AW05 (1). Check the HTML reports for details.

Bids validator was available, I tried the command again but still happened.

Screenshots / relevant information:

Thank you in advance for your reply.

Eden

I have moved this to the software support category and copied in the template. Please fill that out.

And:

Check the HTML reports for details.

Could you provide the details at the bottom of the HTML report?

Sure, here is the error descrption.

Errors
Node Name: fmriprep_23_0_wf.single_subject_wlsubj023_wf.func_preproc_ses_nyu3t01_task_prf_acq_PA_run_01_wf.ica_aroma_wf.ica_aroma

File: /out/sub-wlsubj023/log/20230317-000730_33642929-b1d6-44f0-bf97-598785f7a6bf/crash-20230317-021843-root-ica_aroma-8332d71f-b22d-4de1-a09c-f338e69fdd2b.txt
Working Directory: /work/fmriprep_23_0_wf/single_subject_wlsubj023_wf/func_preproc_ses_nyu3t01_task_prf_acq_PA_run_01_wf/ica_aroma_wf/ica_aroma
Inputs:
* TR: 1.0
* args: -np
* compress_report: auto
* denoise_type: nonaggr
* dim:
* environ: {}
* feat_dir:
* fnirt_warp_file:
* in_file:
* mask:
* mat_file:
* melodic_dir:
* motion_parameters:
* out_dir: out
* out_report: ica_aroma_reportlet.svg
* report_mask:
Traceback (most recent call last):
  File "/opt/conda/lib/python3.9/site-packages/nipype/pipeline/plugins/multiproc.py", line 67, in run_node
    result["result"] = node.run(updatehash=updatehash)
  File "/opt/conda/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
    result = self._run_interface(execute=True)
  File "/opt/conda/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
    return self._run_command(execute)
  File "/opt/conda/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 771, in _run_command
    raise NodeExecutionError(msg)
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node ica_aroma.

Cmdline:
	ICA_AROMA.py -tr 1.000 -np -den nonaggr -i /work/fmriprep_23_0_wf/single_subject_wlsubj023_wf/func_preproc_ses_nyu3t01_task_prf_acq_PA_run_01_wf/ica_aroma_wf/smooth/vol0000_xform-00000_clipped_merged_smooth.nii.gz -m /work/fmriprep_23_0_wf/single_subject_wlsubj023_wf/func_preproc_ses_nyu3t01_task_prf_acq_PA_run_01_wf/bold_std_trans_wf/_std_target_MNI152NLin6Asym.res2/mask_std_tfm/vol0000_unwarped_merged_valid_average_corrected_brain_mask_maths_trans.nii.gz -meldir /work/fmriprep_23_0_wf/single_subject_wlsubj023_wf/func_preproc_ses_nyu3t01_task_prf_acq_PA_run_01_wf/ica_aroma_wf/melodic -mc /work/fmriprep_23_0_wf/single_subject_wlsubj023_wf/func_preproc_ses_nyu3t01_task_prf_acq_PA_run_01_wf/bold_hmc_wf/normalize_motion/motion_params.txt -o /work/fmriprep_23_0_wf/single_subject_wlsubj023_wf/func_preproc_ses_nyu3t01_task_prf_acq_PA_run_01_wf/ica_aroma_wf/ica_aroma/out
Stdout:

	------------------------------- RUNNING ICA-AROMA ------------------------------- 
	--------------- 'ICA-based Automatic Removal Of Motion Artifacts' --------------- 

	Warning! Please check whether the determined TR (of 1.0s) is correct!

	Step 1) MELODIC
	  - The existing/specified MELODIC directory will be used.
Stderr:
	Traceback (most recent call last):
	  File "/opt/ICA-AROMA/ICA_AROMA.py", line 204, in 
	    aromafunc.runICA(fslDir, inFile, outDir, melDir, mask, dim, TR)
	  File "/opt/ICA-AROMA/ICA_AROMA_functions.py", line 55, in runICA
	    os.symlink(melDirIn, melDir)
	OSError: [Errno 95] Operation not supported: '/work/fmriprep_23_0_wf/single_subject_wlsubj023_wf/func_preproc_ses_nyu3t01_task_prf_acq_PA_run_01_wf/ica_aroma_wf/melodic' -> '/work/fmriprep_23_0_wf/single_subject_wlsubj023_wf/func_preproc_ses_nyu3t01_task_prf_acq_PA_run_01_wf/ica_aroma_wf/ica_aroma/out/melodic.ica'
Traceback:
	Traceback (most recent call last):
	  File "/opt/conda/lib/python3.9/site-packages/nipype/interfaces/base/core.py", line 454, in aggregate_outputs
	    setattr(outputs, key, val)
	  File "/opt/conda/lib/python3.9/site-packages/nipype/interfaces/base/traits_extension.py", line 330, in validate
	    value = super(File, self).validate(objekt, name, value, return_pathlike=True)
	  File "/opt/conda/lib/python3.9/site-packages/nipype/interfaces/base/traits_extension.py", line 135, in validate
	    self.error(objekt, name, str(value))
	  File "/opt/conda/lib/python3.9/site-packages/traits/base_trait_handler.py", line 74, in error
	    raise TraitError(
	traits.trait_errors.TraitError: The 'nonaggr_denoised_file' trait of a _ICA_AROMAOutputSpecRPT instance must be a pathlike object or string representing an existing file, but a value of '/work/fmriprep_23_0_wf/single_subject_wlsubj023_wf/func_preproc_ses_nyu3t01_task_prf_acq_PA_run_01_wf/ica_aroma_wf/ica_aroma/out/denoised_func_data_nonaggr.nii.gz'  was specified.

	During handling of the above exception, another exception occurred:

	Traceback (most recent call last):
	  File "/opt/conda/lib/python3.9/site-packages/nipype/interfaces/base/core.py", line 399, in run
	    runtime = self._post_run_hook(runtime)
	  File "/opt/conda/lib/python3.9/site-packages/niworkflows/interfaces/reportlets/segmentation.py", line 231, in _post_run_hook
	    outputs = self.aggregate_outputs(runtime=runtime)
	  File "/opt/conda/lib/python3.9/site-packages/nipype/interfaces/base/core.py", line 461, in aggregate_outputs
	    raise FileNotFoundError(msg)
	FileNotFoundError: No such file or directory '/work/fmriprep_23_0_wf/single_subject_wlsubj023_wf/func_preproc_ses_nyu3t01_task_prf_acq_PA_run_01_wf/ica_aroma_wf/ica_aroma/out/denoised_func_data_nonaggr.nii.gz' for output 'nonaggr_denoised_file' of a ICA_AROMARPT interface
Node Name: fmriprep_23_0_wf.single_subject_wlsubj023_wf.func_preproc_ses_nyu3t01_task_prf_acq_PA_run_02_wf.ica_aroma_wf.ica_aroma

In case of viewing the error too hard, I uploaded the txt file.

report.txt (49.6 KB)

The issue is your working directory not supporting symlinks. It seems ICA-AROMA in particular will not work on filesystems that don’t support symlinks.

Thank you for the reply.

I mounted a working directory from a remote server through cifs. Because if I don’t save the intermediate results in the large space of the working directory, my local space will be overwhelmed.

Unfortunately, CIFS is not a fully-featured network filesystem, and ICA-AROMA is not equipped to fall back. Your options are going to be disabling ICA-AROMA (it can be run after the fact, if you resample to MNI152NLin6Asym) or finding a computer where you can run locally.