Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error during workflow build if ME bold series don't match shapes #3005

Closed
athenahowell opened this issue May 10, 2023 · 6 comments · Fixed by #3028
Closed

Error during workflow build if ME bold series don't match shapes #3005

athenahowell opened this issue May 10, 2023 · 6 comments · Fixed by #3028

Comments

@athenahowell
Copy link

What happened?

fmriprep crashed during the 4th task for this specific subject while calculating (I think) the t2* map for this task. The other three tasks completed successfully. I can't find an obvious reason why it would have failed on this task. It appears to have all of the necessary files in the Nifti folder.

What command did you use?

/opt/conda/bin/fmriprep /fs/ess/PCON0381/MESO/data/Nifti /fs/ess/PCON0381/MESO/data/Preprocessed participant --participant_label sub-4128 --ignore slicetiming sbref --fs-license-file /fs/ess/PCON0381/Scripts/license.txt

What version of fMRIPrep are you running?

23.0.1

How are you running fMRIPrep?

Singularity

Is your data BIDS valid?

Yes

Are you reusing any previously computed results?

FreeSurfer

Please copy and paste any relevant log output.

Node: fmriprep_23_0_wf.single_subject_4128_wf.func_preproc_ses_1_task_trpr2_run_001_echo_1_wf.bold_t2smap_wf.t2smap_node
Working directory: /fs/ess/PCON0381/Scripts/fmriprep_scripts/work/fmriprep_23_0_wf/single_subject_4128_wf/func_preproc_ses_1_task_trpr2_run_001_echo_1_wf/bold_t2smap_wf/t2smap_node

Node inputs:

args = <undefined>
echo_times = [0.0132, 0.03119, 0.04918]
environ = {}
fittype = curvefit
in_files = <undefined>
mask_file = <undefined>

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 t2smap_node.

Cmdline:
	t2smap -d /fs/ess/PCON0381/Scripts/fmriprep_scripts/work/fmriprep_23_0_wf/single_subject_4128_wf/func_preproc_ses_1_task_trpr2_run_001_echo_1_wf/unwarp_wf/_echoidx_0/merge/vol0000_unwarped_merged.nii.gz /fs/ess/PCON0381/Scripts/fmriprep_scripts/work/fmriprep_23_0_wf/single_subject_4128_wf/func_preproc_ses_1_task_trpr2_run_001_echo_1_wf/unwarp_wf/_echoidx_1/merge/vol0000_unwarped_merged.nii.gz /fs/ess/PCON0381/Scripts/fmriprep_scripts/work/fmriprep_23_0_wf/single_subject_4128_wf/func_preproc_ses_1_task_trpr2_run_001_echo_1_wf/unwarp_wf/_echoidx_2/merge/vol0000_unwarped_merged.nii.gz -e 13.2 31.189999999999998 49.18 --mask /fs/ess/PCON0381/Scripts/fmriprep_scripts/work/fmriprep_23_0_wf/single_subject_4128_wf/func_preproc_ses_1_task_trpr2_run_001_echo_1_wf/unwarp_wf/brainextraction_wf/_echoidx_0/masker/clipped_mask.nii.gz --fittype curvefit
Stdout:

Stderr:
	Module `duecredit` not successfully imported due to "No module named 'duecredit'". Package functionality unaffected.
	Failed to import duecredit due to No module named 'duecredit'
	INFO     t2smap:t2smap_workflow:241 Using output directory: /fs/ess/PCON0381/Scripts/fmriprep_scripts/work/fmriprep_23_0_wf/single_subject_4128_wf/func_preproc_ses_1_task_trpr2_run_001_echo_1_wf/bold_t2smap_wf/t2smap_node
	INFO     t2smap:t2smap_workflow:251 Loading input data: ['/fs/ess/PCON0381/Scripts/fmriprep_scripts/work/fmriprep_23_0_wf/single_subject_4128_wf/func_preproc_ses_1_task_trpr2_run_001_echo_1_wf/unwarp_wf/_echoidx_0/merge/vol0000_unwarped_merged.nii.gz', '/fs/ess/PCON0381/Scripts/fmriprep_scripts/work/fmriprep_23_0_wf/single_subject_4128_wf/func_preproc_ses_1_task_trpr2_run_001_echo_1_wf/unwarp_wf/_echoidx_1/merge/vol0000_unwarped_merged.nii.gz', '/fs/ess/PCON0381/Scripts/fmriprep_scripts/work/fmriprep_23_0_wf/single_subject_4128_wf/func_preproc_ses_1_task_trpr2_run_001_echo_1_wf/unwarp_wf/_echoidx_2/merge/vol0000_unwarped_merged.nii.gz']
	Traceback (most recent call last):
	  File "/opt/conda/bin/t2smap", line 8, in <module>
	    sys.exit(_main())
	  File "/opt/conda/lib/python3.9/site-packages/tedana/workflows/t2smap.py", line 343, in _main
	    t2smap_workflow(**kwargs)
	  File "/opt/conda/lib/python3.9/site-packages/tedana/workflows/t2smap.py", line 252, in t2smap_workflow
	    catd, ref_img = io.load_data(data, n_echos=n_echos)
	  File "/opt/conda/lib/python3.9/site-packages/tedana/io.py", line 592, in load_data
	    fdata = np.stack([utils.reshape_niimg(f) for f in data], axis=1)
	  File "<__array_function__ internals>", line 180, in stack
	  File "/opt/conda/lib/python3.9/site-packages/numpy/core/shape_base.py", line 426, in stack
	    raise ValueError('all input arrays must have the same shape')
	ValueError: all input arrays must have the same shape
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 'optimal_comb' trait of a T2SMapOutputSpec instance must be a pathlike object or string representing an existing file, but a value of '/fs/ess/PCON0381/Scripts/fmriprep_scripts/work/fmriprep_23_0_wf/single_subject_4128_wf/func_preproc_ses_1_task_trpr2_run_001_echo_1_wf/bold_t2smap_wf/t2smap_node/desc-optcom_bold.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 401, in run
	    outputs = self.aggregate_outputs(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 '/fs/ess/PCON0381/Scripts/fmriprep_scripts/work/fmriprep_23_0_wf/single_subject_4128_wf/func_preproc_ses_1_task_trpr2_run_001_echo_1_wf/bold_t2smap_wf/t2smap_node/desc-optcom_bold.nii.gz' for output 'optimal_comb' of a T2SMap interface

Additional information / screenshots

No response

@effigies
Copy link
Member

What are the shapes of your bold files?

@athenahowell
Copy link
Author

Our protocol is multi-echo, so each task has 3 bold files. The dimensions for each echo--from the Nifti folder--for the failed task of this subject are:
echo 1 (sub-4128_ses-1_task-trpr2_run-001_echo-1_bold.nii.gz): 68 x 68 x 48 x 349
echo 2: 68 x 68 x 48 x 349
echo 3: 68 x 68 x 48 x 348

We have four or five other subjects that are also failing on the t2*map node. I can add information about them if it would be helpful. Thank you!

@effigies
Copy link
Member

Note that you're missing a volume in echo 3.

@athenahowell
Copy link
Author

I wouldn't have thought to look there, but you're right. Looking at our other affected subjects, they do have unbalanced echo volumes, which seems to be the issue. Thank you!

@effigies
Copy link
Member

Might be nice for tedana to raise a more informative error. And we could also check this in advance, before starting to run the workflow. And I suppose the validator might raise a warning as well.

@athenahowell
Copy link
Author

That would be a very helpful feature, yes. I know we'd appreciate something like that

@effigies effigies added feature and removed bug labels May 11, 2023
@effigies effigies changed the title Crash during last task while calculating t2* map? Error during workflow build if ME bold series don't match shapes May 11, 2023
@effigies effigies added this to the 23.1.0 milestone May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants