fMRIPrep resample error on some participants

Summary of what happened:

I get an error on the resample step with some participants when I run fMRIPrep v22.1.0. The data seems to output OK, but I don’t know if it’s valid. Also, some of these participants ran fine through fMRIPrep v22.0.2 , but I had hoped to use the newer version to get access to additional new confound outputs.

Note that some participants still run fine with v22.1.0, but others are giving this error message. I also tried increasing the RAM allocation, but this did not consistently solve the problem.

Command used (and if a helper script was used, a link to the helper script or the command generated):

srun singularity run fmriprep-22.1.0.simg --participant_label=049 --fs-license-file="/project2/decety/freesurfer_license.txt" -v -v --nthreads 8 --output-spaces MNI152NLin6Asym:res-2 --bold2t1w-dof 6 --fd-spike-threshold 0.9 --skull-strip-template OASIS30ANTs /project2/decety/PMM_BIDS /project2/decety/PMM_BIDS/derivatives participant

Version:

fMRIPrep v22.1.0

Environment (Docker, Singularity, custom installation):

Singularity

Data formatted according to a validatable standard? Please provide the output of the validator:

Yes – BIDS validation in fMRIPrep succeeded:
bids-validator@1.8.0

1: [WARN] The recommended file /README is missing. See Section 03 (Modality agnostic files) of the BIDS specification. (code: 101 - README_FILE_MISSING)

Please visit https://neurostars.org/search?q=README_FILE_MISSING for existing conversations about this issue.

2: [WARN] The Authors field of dataset_description.json should contain an array of fields - with one author per field. This was triggered because there are no authors, which will make DOI registration from dataset metadata impossible. (code: 113 - NO_AUTHORS)

Please visit https://neurostars.org/search?q=NO_AUTHORS for existing conversations about this issue.


    Summary:                 Available Tasks:        Available Modalities: 
    941 Files, 7.05GB                                MRI                   
    40 - Subjects                                                          
    1 - Session     

Relevant log outputs (up to 20 lines):

230105-14:18:51,616 nipype.workflow ERROR:
	 could not run node: fmriprep_22_1_wf.single_subject_049_wf.func_preproc_task_pm_run_4_wf.unwarp_wf.resample
230105-14:18:51,626 nipype.workflow INFO:
	 crashfile: /project2/decety/PMM_BIDS/derivatives/sub-049/log/20230105-113011_31d5bd6a-158b-4db3-8af7-e16a13916f89/crash-20230105-121112-mscohen-resample-066fff04-582f-450c-b31f-016d4fe480f9.txt
230105-14:18:51,627 nipype.workflow INFO:
	 ***********************************
230105-14:18:51,821 nipype.workflow CRITICAL:
	 fMRIPrep failed: 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 resample.

Traceback:
	concurrent.futures.process._RemoteTraceback: 
	"""
	Traceback (most recent call last):
	  File "/opt/conda/lib/python3.9/concurrent/futures/process.py", line 243, in _process_worker
	    r = call_item.fn(*call_item.args, **call_item.kwargs)
	  File "/opt/conda/lib/python3.9/concurrent/futures/process.py", line 202, in _process_chunk
	    return [fn(*args) for args in chunk]
	  File "/opt/conda/lib/python3.9/concurrent/futures/process.py", line 202, in <listcomp>
	    return [fn(*args) for args in chunk]
	  File "/opt/conda/lib/python3.9/site-packages/sdcflows/interfaces/bspline.py", line 624, in _b0_resampler
	    if unwarp.fit(distorted_img):
	  File "/opt/conda/lib/python3.9/site-packages/sdcflows/transform.py", line 99, in fit
	    wmat = grid_bspline_weights(spatialimage, moved_cs)
	  File "/opt/conda/lib/python3.9/site-packages/sdcflows/transform.py", line 417, in grid_bspline_weights
	    colloc_ax = BSpline.design_matrix(x, t, 3)[:, (2 + pad_left):-(2 + pad_right)]
	  File "/opt/conda/lib/python3.9/site-packages/scipy/interpolate/_bsplines.py", line 416, in design_matrix
	    raise ValueError(f'Out of bounds w/ x = {x}.')
	ValueError: Out of bounds w/ x = [ 1.04995309  2.04963212  3.04931115  4.04899017  5.0486692   6.04834823
	  7.04802726  8.04770628  9.04738531 10.04706434 11.04674337 12.0464224
	 13.04610142 14.04578045 15.04545948 16.04513851 17.04481753 18.04449656
	 19.04417559 20.04385462 21.04353365 22.04321267 23.0428917  24.04257073
	 25.04224976 26.04192879 27.04160781 28.04128684 29.04096587 30.0406449
	 31.04032392 32.04000295 33.03968198 34.03936101 35.03904004 36.03871906
	 37.03839809 38.03807712 39.03775615 40.03743517].
	"""

	The above exception was the direct cause of the following exception:

	Traceback (most recent call last):
	  File "/opt/conda/lib/python3.9/site-packages/nipype/interfaces/base/core.py", line 398, in run
	    runtime = self._run_interface(runtime)
	  File "/opt/conda/lib/python3.9/site-packages/sdcflows/interfaces/bspline.py", line 373, in _run_interface
	    ) = zip(*outputs)
	  File "/opt/conda/lib/python3.9/concurrent/futures/process.py", line 559, in _chain_from_iterable_of_lists
	    for element in iterable:
	  File "/opt/conda/lib/python3.9/concurrent/futures/_base.py", line 609, in result_iterator
	    yield fs.pop().result()
	  File "/opt/conda/lib/python3.9/concurrent/futures/_base.py", line 439, in result
	    return self.__get_result()
	  File "/opt/conda/lib/python3.9/concurrent/futures/_base.py", line 391, in __get_result
	    raise self._exception
	ValueError: Out of bounds w/ x = [ 1.04995309  2.04963212  3.04931115  4.04899017  5.0486692   6.04834823
	  7.04802726  8.04770628  9.04738531 10.04706434 11.04674337 12.0464224
	 13.04610142 14.04578045 15.04545948 16.04513851 17.04481753 18.04449656
	 19.04417559 20.04385462 21.04353365 22.04321267 23.0428917  24.04257073
	 25.04224976 26.04192879 27.04160781 28.04128684 29.04096587 30.0406449
	 31.04032392 32.04000295 33.03968198 34.03936101 35.03904004 36.03871906
	 37.03839809 38.03807712 39.03775615 40.03743517].


230105-14:19:00,468 cli ERROR:
	 Preprocessing did not finish successfully. Errors occurred while processing data from participants: 049 (1). Check the HTML reports for details.
230105-14:19:00,468 cli ERROR:
	 Preprocessing did not finish successfully. Errors occurred while processing data from participants: 049 (1). Check the HTML reports for details.

Screenshots / relevant information:

For future reference: it seems that the error I was getting is the one described here (SDC b-spline matrix issue · Issue #323 · nipreps/sdcflows · GitHub), which I believe has been fixed in the 22.1.1 release.

I’ll post again if I have any further issues with this…

Hi! Can you update here with whether updating worked for you (and if so, mark your last post as the solution)?

Yep, it did – so I went ahead and marked this as solved.

Thanks,
Michael

1 Like