-
Notifications
You must be signed in to change notification settings - Fork 20
Description
Hi, I'm encountering a recurring problem when running deepprep. For some subjects, the pipeline stops partway through, and the logs consistently show a crash at the n4_correct step during bold preprocessing.
For example, in the case of sub-GA00940, the process fails with this error:
FileNotFoundError: No such file or directory '/output/WorkDir/.../n4_correct/sub-GA00940_ses-20230428_task-rest_dir-PA_run-1_sbref_corrected.nii.gz' for output 'output_image'
I haven't tried manually cleaning up the work directory, but this issue seems to happen intermittently across subjects, always at the same stage. Any idea what might be causing this or how to prevent it?
Thanks in advance.
Below is the error log.
crashfile: /output/WorkDir/bold_preprocess/log/crash-20250619-140104-root-n4_correct-66ccdc7a-3667-4e41-a76e-cd9ba69458f6.txt
250619-14:01:04,961 nipype.workflow INFO:
***********************************
Traceback (most recent call last):
File "/opt/DeepPrep/deepprep/nextflow/bin/bold_preprocess.py", line 316, in
result = workflow.run()
File "/opt/conda/envs/deepprep/lib/python3.10/site-packages/nipype/pipeline/engine/workflows.py", line 638, in run
runner.run(execgraph, updatehash=updatehash, config=self.config)
File "/opt/conda/envs/deepprep/lib/python3.10/site-packages/nipype/pipeline/plugins/linear.py", line 82, in run
raise error from cause
File "/opt/conda/envs/deepprep/lib/python3.10/site-packages/nipype/pipeline/plugins/linear.py", line 47, in run
node.run(updatehash=updatehash)
File "/opt/conda/envs/deepprep/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
result = self._run_interface(execute=True)
File "/opt/conda/envs/deepprep/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
return self._run_command(execute)
File "/opt/conda/envs/deepprep/lib/python3.10/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 /input/sub-GA00940/ses-20230428/func/sub-GA00940_ses-20230428_task-rest_dir-PA_run-1_sbref.nii.gz --output sub-GA00940_ses-20230428_task-rest_dir-PA_run-1_sbref_corrected.nii.gz -r --weight-image /output/WorkDir/bold_preprocess/sub-GA00940_wf/rest_wf/sub-GA00940_ses-20230428_task-rest_dir-PA_run-1_wf/bold_wf/bold_fit_wf/enhance_and_skullstrip_bold_wf/fix_header/tpl-MNI152NLin2009cAsym_res-01_label-brain_probseg_trans_fixhdr.nii.gz
Stdout:
Stderr:
Traceback:
Traceback (most recent call last):
File "/opt/conda/envs/deepprep/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 453, in aggregate_outputs
setattr(outputs, key, val)
File "/opt/conda/envs/deepprep/lib/python3.10/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/envs/deepprep/lib/python3.10/site-packages/nipype/interfaces/base/traits_extension.py", line 135, in validate
self.error(objekt, name, str(value))
File "/opt/conda/envs/deepprep/lib/python3.10/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 '/output/WorkDir/bold_preprocess/sub-GA00940_wf/rest_wf/sub-GA00940_ses-20230428_task-rest_dir-PA_run-1_wf/bold_wf/bold_fit_wf/enhance_and_skullstrip_bold_wf/n4_correct/sub-GA00940_ses-20230428_task-rest_dir-PA_run-1_sbref_corrected.nii.gz' <class 'str'> was specified.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/conda/envs/deepprep/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 398, in run
runtime = self._post_run_hook(runtime)
File "/opt/conda/envs/deepprep/lib/python3.10/site-packages/nipype/interfaces/mixins/fixheader.py", line 127, in _post_run_hook
outputs = self.aggregate_outputs(runtime=runtime).get_traitsfree()
File "/opt/conda/envs/deepprep/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 460, in aggregate_outputs
raise FileNotFoundError(msg)
FileNotFoundError: No such file or directory '/output/WorkDir/bold_preprocess/sub-GA00940_wf/rest_wf/sub-GA00940_ses-20230428_task-rest_dir-PA_run-1_wf/bold_wf/bold_fit_wf/enhance_and_skullstrip_bold_wf/n4_correct/sub-GA00940_ses-20230428_task-rest_dir-PA_run-1_sbref_corrected.nii.gz' for output 'output_image' of a FixN4BiasFieldCorrection interface
Work dir:
/output/WorkDir/nextflow/9d/7aff89c4b59175d347d6013f252504
Tip: view the complete command output by changing to the process work dir and entering the command cat .command.out