I’m running fmriprep on multiple subjects. For one subject, it gives error during the N4BiasFieldCorrection. It runs okay when I do not require correction, but whenever I try bias correction, it gives the same nipype error. It does not seem to be a memory issue as I tried increasing it. Do you have any suggestions on how to find the exact problem or solve this?
Version:
23.0.2
Environment (Docker, Singularity / Apptainer, custom installation):
Docker
Data formatted according to a validatable standard? Please provide the output of the validator:
Data structure passes BIDS validation successfully.
Relevant log outputs (up to 20 lines):
240911-20:38:39,766 nipype.workflow INFO:
[Node] Setting-up "fmriprep_23_0_wf.single_subject_M137_wf.func_preproc_ses_01_task_centerSurroundGap_dir_AP_run_01_wf.initial_boldref_wf.enhance_and_skullstrip_bold_wf.n4_correct" in "/Users/tonglab/Desktop/Irem/FigGroundGapFMRI/FigGroundGapFMRI/derivatives/fmriprep_work/fmriprep_23_0_wf/single_subject_M137_wf/func_preproc_ses_01_task_centerSurroundGap_dir_AP_run_01_wf/initial_boldref_wf/enhance_and_skullstrip_bold_wf/n4_correct".
240911-20:38:39,768 nipype.workflow INFO:
[Node] Executing "n4_correct" <niworkflows.interfaces.fixes.FixN4BiasFieldCorrection>
240911-20:38:40,74 nipype.workflow INFO:
[Node] Finished "n4_correct", elapsed time 0.303184s.
240911-20:38:40,74 nipype.workflow WARNING:
Storing result file without outputs
240911-20:38:40,75 nipype.workflow WARNING:
[Node] Error on "fmriprep_23_0_wf.single_subject_M137_wf.func_preproc_ses_01_task_centerSurroundGap_dir_AP_run_01_wf.initial_boldref_wf.enhance_and_skullstrip_bold_wf.n4_correct" (/Users/tonglab/Desktop/Irem/FigGroundGapFMRI/FigGroundGapFMRI/derivatives/fmriprep_work/fmriprep_23_0_wf/single_subject_M137_wf/func_preproc_ses_01_task_centerSurroundGap_dir_AP_run_01_wf/initial_boldref_wf/enhance_and_skullstrip_bold_wf/n4_correct)
240911-20:38:41,630 nipype.workflow ERROR:
Node n4_correct failed to run on host 6fa12d2505d2.
240911-20:38:41,634 nipype.workflow ERROR:
Saving crash info to /out/sub-M137/log/20240911-203128_e149e893-d3a7-4735-8b1f-29c88c4aad2a/crash-20240911-203841-root-n4_correct-c0d3d4d6-0ab9-450c-a069-85ff18203d13.txt
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 n4_correct.
Cmdline:
N4BiasFieldCorrection --bspline-fitting [ 200 ] -d 3 --input-image /Users/tonglab/Desktop/Irem/FigGroundGapFMRI/FigGroundGapFMRI/derivatives/fmriprep_work/fmriprep_23_0_wf/single_subject_M137_wf/func_preproc_ses_01_task_centerSurroundGap_dir_AP_run_01_wf/initial_boldref_wf/gen_avg/sub-M137_ses-01_task-centerSurroundGap_dir-AP_run-01_bold_average.nii --output sub-M137_ses-01_task-centerSurroundGap_dir-AP_run-01_bold_average_corrected.nii -r --weight-image /Users/tonglab/Desktop/Irem/FigGroundGapFMRI/FigGroundGapFMRI/derivatives/fmriprep_work/fmriprep_23_0_wf/single_subject_M137_wf/func_preproc_ses_01_task_centerSurroundGap_dir_AP_run_01_wf/initial_boldref_wf/enhance_and_skullstrip_bold_wf/check_hdr/tpl-MNI152NLin2009cAsym_res-01_label-brain_probseg_trans_hdr.nii.gz
Stdout:
Stderr:
Traceback:
Traceback (most recent call last):
File "/opt/conda/lib/python3.9/site-packages/nipype/interfaces/base/core.py", line 453, 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 'output_image' trait of a _FixN4BiasFieldCorrectionOutputSpec instance must be a pathlike object or string representing an existing file, but a value of '/Users/tonglab/Desktop/Irem/FigGroundGapFMRI/FigGroundGapFMRI/derivatives/fmriprep_work/fmriprep_23_0_wf/single_subject_M137_wf/func_preproc_ses_01_task_centerSurroundGap_dir_AP_run_01_wf/initial_boldref_wf/enhance_and_skullstrip_bold_wf/n4_correct/sub-M137_ses-01_task-centerSurroundGap_dir-AP_run-01_bold_average_corrected.nii' <class 'str'> was specified.
Screenshots / relevant information:
I tried bias correction using PEPOLAR (epi) or b0 fieldmap files, both failed. I tried macStudio or Linux computers with 64 or 128G memory and 12, 16 or 24 cores, and changed the memory and number of parallel processing to a few options, the same error came up every time. I had no problems with the other 3 subjects with similar data.