fmriprep: traits.trait_errors.TraitError: The 'output_image' trait of a _FixN4BiasFieldCorrectionOutputSpec instance must be a pathlike object or string representing an existing file
What happened?
hi i was trying to run fMRIprep uisng the code below
fmriprep /inputfolder/ /output/ participant --participant-label sub-Bxxxx --fs-license-file /pathtolicense/license.txt --nthreads 5 --omp-nthreads 5 --mem-mb 15G --use-aroma --ignore slicetiming --ignore t2w
( i have used xxxx to anomymize the info )
this code was proven to be functional on another participant; but it returned the error below after running for 7 hours on this participant;
error:
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 ‘/work/fmriprep_23_0_wf/single_subject_Bxxxx_wf/func_preproc_ses_xxxx_task_rest24mm490scansms8_run_1_echo_1_wf/initial_boldref_wf/enhance_and_skullstrip_bold_wf/n4_correct/sub-Bxxxx_ses-xxxx_task-rest24mm490scansms8_run-1_echo-1_bold_average_corrected.nii.gz’ <class ‘str’> was specified.
the parameters used was 8 cpu, 32G RAM, 100G disk space; our data has 490 volumes, with TR=0.735, TE being 0.035, dimension being 929264*490
What command did you use?
fmriprep /inputfolder/ /output/ participant --participant-label sub-Bxxxx --fs-license-file /pathtolicense/license.txt --nthreads 5 --omp-nthreads 5 --mem-mb 15G --use-aroma --ignore slicetiming --ignore t2w
What version of fMRIPrep are you running?
the latest version in dockerhub is pulled and used
How are you running fMRIPrep?
Docker
Is your data BIDS valid?
Yes
Are you reusing any previously computed results?
No
Please copy and paste any relevant log output.
�2023-05-12T10:30:18.271679031Z File "/opt/conda/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
F2023-05-12T10:30:18.271682869Z return self._run_command(execute)
�2023-05-12T10:30:18.271686160Z File "/opt/conda/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 771, in _run_command
B2023-05-12T10:30:18.271697312Z raise NodeExecutionError(msg)
�2023-05-12T10:30:18.271700553Z nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node n4_correct.
!2023-05-12T10:30:18.271703711Z
)2023-05-12T10:30:18.271708212Z Cmdline:
2023-05-12T10:30:18.271711698Z N4BiasFieldCorrection --bspline-fitting [ 200 ] -d 3 --input-image /work/fmriprep_23_0_wf/single_subject_B10203_wf/func_preproc_ses_WQZHEADFMRI20230317133821278000_task_rest24mm490scansms8_run_1_echo_1_wf/initial_boldref_wf/gen_avg/sub-B10203_ses-WQZHEADFMRI20230317133821278000_task-rest24mm490scansms8_run-1_echo-1_bold_average.nii.gz --output sub-B10203_ses-WQZHEADFMRI20230317133821278000_task-rest24mm490scansms8_run-1_echo-1_bold_average_corrected.nii.gz -r --weight-image /work/fmriprep_23_0_wf/single_subject_B10203_wf/func_preproc_ses_WQZHEADFMRI20230317133821278000_task_rest24mm490scansms8_run_1_echo_1_wf/initial_boldref_wf/enhance_and_skullstrip_bold_wf/check_hdr/tpl-MNI152NLin2009cAsym_res-01_label-brain_probseg_trans_hdr.nii.gz
(2023-05-12T10:30:18.271716073Z Stdout:
!2023-05-12T10:30:18.271718858Z
(2023-05-12T10:30:18.271721571Z Stderr:
!2023-05-12T10:30:18.271724433Z
+2023-05-12T10:30:18.271727169Z Traceback:
D2023-05-12T10:30:18.271730030Z Traceback (most recent call last):
�2023-05-12T10:30:18.271732939Z File "/opt/conda/lib/python3.9/site-packages/nipype/interfaces/base/core.py", line 453, in aggregate_outputs
@2023-05-12T10:30:18.271736107Z setattr(outputs, key, val)
�2023-05-12T10:30:18.271738939Z File "/opt/conda/lib/python3.9/site-packages/nipype/interfaces/base/traits_extension.py", line 330, in validate
s2023-05-12T10:30:18.271742018Z value = super(File, self).validate(objekt, name, value, return_pathlike=True)
�2023-05-12T10:30:18.271745617Z File "/opt/conda/lib/python3.9/site-packages/nipype/interfaces/base/traits_extension.py", line 135, in validate
J2023-05-12T10:30:18.271748797Z self.error(objekt, name, str(value))
�2023-05-12T10:30:18.271751840Z File "/opt/conda/lib/python3.9/site-packages/traits/base_trait_handler.py", line 74, in error
72023-05-12T10:30:18.271754858Z raise TraitError(
72023-05-12T10:30:18.271757734Z 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 '/work/fmriprep_23_0_wf/single_subject_Bxxxx_wf/func_preproc_ses_xxxx_task_rest24mm490scansms8_run_1_echo_1_wf/initial_boldref_wf/enhance_and_skullstrip_bold_wf/n4_correct/sub-Bxxxx_ses-xxxx_task-rest24mm490scansms8_run-1_echo-1_bold_average_corrected.nii.gz' <class 'str'> was specified.
!2023-05-12T10:30:18.271761555Z
e2023-05-12T10:30:18.271764300Z During handling of the above exception, another exception occurred:
!2023-05-12T10:30:18.271767368Z
D2023-05-12T10:30:18.271770152Z Traceback (most recent call last):
�2023-05-12T10:30:18.271775258Z File "/opt/conda/lib/python3.9/site-packages/nipype/interfaces/base/core.py", line 398, in run
L2023-05-12T10:30:18.271781446Z runtime = self._post_run_hook(runtime)
�2023-05-12T10:30:18.271784457Z File "/opt/conda/lib/python3.9/site-packages/nipype/interfaces/mixins/fixheader.py", line 127, in _post_run_hook
h2023-05-12T10:30:18.271787504Z outputs = self.aggregate_outputs(runtime=runtime).get_traitsfree()
�2023-05-12T10:30:18.271790496Z File "/opt/conda/lib/python3.9/site-packages/nipype/interfaces/base/core.py", line 460, in aggregate_outputs
B2023-05-12T10:30:18.271793509Z raise FileNotFoundError(msg)
�2023-05-12T10:30:18.271796578Z FileNotFoundError: No such file or directory '/work/fmriprep_23_0_wf/single_subject_Bxxxx_wf/func_preproc_ses_xxxx_task_rest24mm490scansms8_run_1_echo_1_wf/initial_boldref_wf/enhance_and_skullstrip_bold_wf/n4_correct/sub-Bxxxx_ses-xxxx_task-rest24mm490scansms8_run-1_echo-1_bold_average_corrected.nii.gz' for output 'output_image' of a FixN4BiasFieldCorrection interface
!2023-05-12T10:30:18.271800138Z
!2023-05-12T10:30:18.271802871Z
?2023-05-12T10:30:24.407066899Z 230512-10:30:24,406 cli ERROR:
�2023-05-12T10:30:24.407098798Z Preprocessing did not finish successfully. Errors occurred while processing data from participants: B10203 (1). Check the HTML reports for details.
?2023-05-12T10:30:24.407104198Z 230512-10:30:24,406 cli ERROR:
�2023-05-12T10:30:24.407110928Z Preprocessing did not finish successfully. Errors occurred while processing data from participants: B10203 (1). Check the HTML reports for details.
V2023-05-12T10:30:27.879656462Z Sentry is attempting to send 5 pending error messages
82023-05-12T10:30:27.879693497Z Waiting up to 2 seconds
52023-05-12T10:30:27.879698598Z Press Ctrl-C to quit
Additional information / screenshots
No response
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 26 (9 by maintainers)
Commits related to this issue
- MNT: Update ANTs pin in Docker image (#3016) ## Changes proposed in this pull request Upgrades to a recent version of ANTs that seems less susceptible to #3006. Closes #3006. Closes #3015. — committed to nipreps/fmriprep by effigies a year ago
- Update to fmriprep 23.1.4 See https://github.com/nipreps/fmriprep/issues/3006 for why it is necessary. What's more, aroma-ica is removed from pipeline, which should be done in a separate workflow sin... — committed to CAMP-BNU/preproc-mri by psychelzh 9 months ago
I confirm that the N4BiasFieldCorrection is successful using the unstable version.
Thank you!