poldracklab / tacc-openneuro

0 stars 1 forks source link

ds003604-fmriprep: "nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node n4_correct." #68

Open jbwexler opened 1 year ago

jbwexler commented 1 year ago

Previously ran into this error with this dataset https://github.com/poldracklab/tacc-openneuro/issues/61. Reran a sample of 4 subs with 23.0.2. No longer getting that error but 2/4 subjects failed with the following:

Node: fmriprep_23_0_wf.single_subject_5007_wf.func_preproc_ses_7_task_Plaus_acq_D2S8_run_02_wf.initial_boldref_wf.enhance_and_skullstrip_bold_wf.n4_correct Working directory: /scratch1/03201/jbwexler/work_dir/fmriprep/ds003604_sub-5007/fmriprep_23_0_wf/single_subject_5007_wf/func_preproc_ses_7_task_Plaus_acq_D2S8_run_02_wf/initial_boldref_wf/enhance_and_skullstrip_bold_wf/n4_correct

Node inputs:

args = bias_image = bspline_fitting_distance = 200.0 bspline_order = convergence_threshold = copy_header = True dimension = 3 environ = {'NSLOTS': '1'} histogram_sharpening = input_image = mask_image = n_iterations = num_threads = 1 output_image = rescale_intensities = True save_bias = False shrink_factor = weight_image =

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 /scratch1/03201/jbwexler/work_dir/fmriprep/ds003604_sub-5007/fmriprep_23_0_wf/single_subject_5007_wf/func_preproc_ses_7_task_Plaus_acq_D2S8_run_02_wf/initial_boldref_wf/gen_avg/sub-5007_ses-7_task-Plaus_acq-D2S8_run-02_bold_valid_average.nii.gz --output sub-5007_ses-7_task-Plaus_acq-D2S8_run-02_bold_valid_average_corrected.nii.gz -r --weight-image /scratch1/03201/jbwexler/work_dir/fmriprep/ds003604_sub-5007/fmriprep_23_0_wf/single_subject_5007_wf/func_preproc_ses_7_task_Plaus_acq_D2S8_run_02_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 '/scratch1/03201/jbwexler/work_dir/fmriprep/ds003604_sub-5007/fmriprep_23_0_wf/single_subject_5007_wf/func_preproc_ses_7_task_Plaus_acq_D2S8_run_02_wf/initial_boldref_wf/enhance_and_skullstrip_bold_wf/n4_correct/sub-5007_ses-7_task-Plaus_acq-D2S8_run-02_bold_valid_average_corrected.nii.gz' <class 'str'> 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 398, in run
        runtime = self._post_run_hook(runtime)
      File "/opt/conda/lib/python3.9/site-packages/nipype/interfaces/mixins/fixheader.py", line 127, in _post_run_hook
        outputs = self.aggregate_outputs(runtime=runtime).get_traitsfree()
      File "/opt/conda/lib/python3.9/site-packages/nipype/interfaces/base/core.py", line 460, in aggregate_outputs
        raise FileNotFoundError(msg)
    FileNotFoundError: No such file or directory '/scratch1/03201/jbwexler/work_dir/fmriprep/ds003604_sub-5007/fmriprep_23_0_wf/single_subject_5007_wf/func_preproc_ses_7_task_Plaus_acq_D2S8_run_02_wf/initial_boldref_wf/enhance_and_skullstrip_bold_wf/n4_correct/sub-5007_ses-7_task-Plaus_acq-D2S8_run-02_bold_valid_average_corrected.nii.gz' for output 'output_image' of a FixN4BiasFieldCorrection interface
effigies commented 1 year ago

https://github.com/nipreps/fmriprep/issues/3006

jbwexler commented 1 year ago

This seems to have been resolved in fmriprep (I'll test it with the next release)

jbwexler commented 1 year ago

I'm getting this error for all attempted subjects in ds004489 as well (with minimal mode).

effigies commented 1 year ago

Anything new in the traceback?

jbwexler commented 1 year ago

It looks pretty similar:

Traceback (most recent call last): , File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/nipype/pipeline/plugins/multiproc.py", line 67, in run_node result["result"] = node.run(updatehash=updatehash) , File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run result = self._run_interface(execute=True) , File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface return self._run_command(execute) , File "/opt/conda/envs/fmriprep/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 /scratch1/03201/jbwexler/openneuro_derivatives/derivatives/fmriprep/ds004489-fmriprep/sourcedata/raw/sub-1014/ses-2/func/sub-1014_ses-2_task-FOV_run-6_sbref.nii.gz --output sub-1014_ses-2_task-FOV_run-6_sbref_corrected.nii.gz -r --weight-image /scratch1/03201/jbwexler/work_dir/fmriprep/ds004489_sub-1014/fmriprep_23_2_wf/fit_sub_1014_wf/func_preproc_ses_2_task_FOV_run_6_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/envs/fmriprep/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 453, in aggregate_outputs setattr(outputs, key, val) File "/opt/conda/envs/fmriprep/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/fmriprep/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/fmriprep/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 '/scratch1/03201/jbwexler/work_dir/fmriprep/ds004489_sub-1014/fmriprep_23_2_wf/fit_sub_1014_wf/func_preproc_ses_2_task_FOV_run_6_wf/enhance_and_skullstrip_bold_wf/n4_correct/sub-1014_ses-2_task-FOV_run-6_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/fmriprep/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 398, in run runtime = self._post_run_hook(runtime) File "/opt/conda/envs/fmriprep/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/fmriprep/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 460, in aggregate_outputs raise FileNotFoundError(msg) FileNotFoundError: No such file or directory '/scratch1/03201/jbwexler/work_dir/fmriprep/ds004489_sub-1014/fmriprep_23_2_wf/fit_sub_1014_wf/func_preproc_ses_2_task_FOV_run_6_wf/enhance_and_skullstrip_bold_wf/n4_correct/sub-1014_ses-2_task-FOV_run-6_sbref_corrected.nii.gz' for output 'output_image' of a FixN4BiasFieldCorrection interface

effigies commented 4 months ago

At least for ds004489, this appears to result from sbref being multi-volume. N4BiasFieldCorrection silently blows up in this case.

@poldrack Any chance the data you're using has multiple sbref volumes? 4D with a single volume might also show this; I haven't checked.

poldrack commented 4 months ago

Yes, that seems to be the problem – it seems that BIDS conversion must have gone wrong on myconnectome as the sbref has the same dimensions as the bold file. Will need to reconvert it ☹

From: Chris Markiewicz @.> Date: Monday, July 8, 2024 at 2:00 PM To: poldracklab/tacc-openneuro @.> Cc: Russ Poldrack @.>, Mention @.> Subject: Re: [poldracklab/tacc-openneuro] ds003604-fmriprep: "nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node n4_correct." (Issue #68)

At least for ds004489, this appears to result from sbref being multi-volume. N4BiasFieldCorrection silently blows up in this case.

@poldrackhttps://github.com/poldrack Any chance the data you're using has multiple sbref volumes? 4D with a single volume might also show this; I haven't checked.

— Reply to this email directly, view it on GitHubhttps://github.com/poldracklab/tacc-openneuro/issues/68#issuecomment-2215290293, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAGUVEEB3MIOCWGQREI7M2TZLL4VBAVCNFSM6AAAAABKRSFV5GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJVGI4TAMRZGM. You are receiving this because you were mentioned.Message ID: @.***>