fMRIPrep sdecreg_report error for 2 out of 170 participants

Summary of what happened:

I processed task fMRI data from a sample of 170 participants who were all scanned on the same scanner with the same sequences. Specifically, we had 6 runs of a task and acquired 4 top-up scans with the opposite phase encoding direction before each block. For two participants, I get an error that sdecreg_report failed for one or two blocks. I cannot find any difference between these blocks or participants and the rest of the sample.

It’s seems like a small issue, because I could just exclude the two participants. However, I’m worried that this may indicate some more fundamental issues with the data.

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

fmriprep-docker \
    ${bids_folder} \
    ${out_folder} \
    participant \
    --participant-label sub-003 \
    --image nipreps/fmriprep:23.2.1 \
    --fs-license-file ${license_file} \
    --cifti-output \
    --nthreads 5

Version:

I processed all participants with version 23.2.1, but also tried 24.1.1 with the problematic participants. The error was the same in both versions.

Environment (Docker, Singularity / Apptainer, custom installation):

Docker using the fmriprep-docker wrapper

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

[WARN] Not all subjects/sessions/runs have the same scanning parameters
[WARN] The onset of the last event is after the total duration of the corresponding scan. This design is suspiciously long.

The scan duration is not the same for all scans, because it depended on the response duration of the participants.

Relevant log outputs (up to 20 lines):

File: /out/sub-003/log/20250219-152253_2d164a42-c1aa-430e-bcc0-0c1641d54df6/crash-20250219-181842-root-sdecreg_report-ec36e71e-0822-4c84-908f-6d9d44956f13.txt
Working Directory: /tmp/work/fmriprep_23_2_wf/sub_003_wf/bold_task_raven_run_1_wf/bold_fit_wf/func_fit_reports_wf/sdecreg_report
Inputs:
apply_mask: False
fieldmap:
mask:
max_alpha: 0.7
moving:
moving_label: Fieldmap reference
out_report: report.svg
reference:
reference_label: BOLD reference
show: both
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 sdecreg_report.

Traceback:
	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/reporting.py", line 50, in _post_run_hook
	    self._generate_report()
	  File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/sdcflows/interfaces/reportlets.py", line 103, in _generate_report
	    abs(np.percentile(fmapdata[maskdata], 99.8)),
	IndexError: boolean index did not match indexed array along dimension 1; dimension is 60 but corresponding boolean dimension is 112

Screenshots / relevant information:

Here are the dimensions and orientation of one example TOP-UP scans:

Participant without error:


Participant with error:



I am also getting the same error (fmriprep 24.1.1). Would really like to know if this is an issue just in report generation, or whether it indicates some problem in data acquisition.

Node Name: fmriprep_24_1_wf.sub_0154_wf.bold_ses_fasted_task_stopSignal_acq_multiband_dir_AP_run_01_wf.bold_fit_wf.func_fit_reports_wf.sdecreg_report

File: <workdir>/sub-0154/log/20250315-181933_185ce782-122e-4db3-ade4-95cea9d84137/crash-20250315-201232-seeles01-sdecreg_report-26363001-daef-43a7-95cb-ddaa680c71bb.txt
Working Directory: /sc/arion/scratch/seeles01/fmriprep_24_1_wf/sub_0154_wf/bold_ses_fasted_task_stopSignal_acq_multiband_dir_AP_run_01_wf/bold_fit_wf/func_fit_reports_wf/sdecreg_report
Inputs: 
apply_mask: False
fieldmap:
mask:
max_alpha: 0.7
moving:
moving_label: Fieldmap reference
out_report: report.svg
reference:
reference_label: BOLD reference
show: both
Traceback (most recent call last):
  File "/opt/conda/envs/fmriprep/lib/python3.11/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.11/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
    result = self._run_interface(execute=True)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
    return self._run_command(execute)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/fmriprep/lib/python3.11/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 sdecreg_report.

Traceback:
	Traceback (most recent call last):
	  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/nipype/interfaces/base/core.py", line 398, in run
	    runtime = self._post_run_hook(runtime)
	              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/nipype/interfaces/mixins/reporting.py", line 50, in _post_run_hook
	    self._generate_report()
	  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/sdcflows/interfaces/reportlets.py", line 103, in _generate_report
	    abs(np.percentile(fmapdata[maskdata], 99.8)),
	                      ~~~~~~~~^^^^^^^^^^
	IndexError: boolean index did not match indexed array along dimension 1; dimension is 64 but corresponding boolean dimension is 96
Node Name: fmriprep_24_1_wf.sub_0154_wf.bold_ses_fasted_task_stopSignal_acq_multiband_dir_AP_run_02_wf.bold_fit_wf.func_fit_reports_wf.sdecreg_report

File: <workdir>/sub-0154/log/20250315-181933_185ce782-122e-4db3-ade4-95cea9d84137/crash-20250315-201232-seeles01-sdecreg_report-0a6be464-71c0-4cde-84da-3089e2ba562d.txt
Working Directory: /sc/arion/scratch/seeles01/fmriprep_24_1_wf/sub_0154_wf/bold_ses_fasted_task_stopSignal_acq_multiband_dir_AP_run_02_wf/bold_fit_wf/func_fit_reports_wf/sdecreg_report
Inputs: 
apply_mask: False
fieldmap:
mask:
max_alpha: 0.7
moving:
moving_label: Fieldmap reference
out_report: report.svg
reference:
reference_label: BOLD reference
show: both
Traceback (most recent call last):
  File "/opt/conda/envs/fmriprep/lib/python3.11/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.11/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
    result = self._run_interface(execute=True)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
    return self._run_command(execute)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/fmriprep/lib/python3.11/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 sdecreg_report.

Traceback:
	Traceback (most recent call last):
	  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/nipype/interfaces/base/core.py", line 398, in run
	    runtime = self._post_run_hook(runtime)
	              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/nipype/interfaces/mixins/reporting.py", line 50, in _post_run_hook
	    self._generate_report()
	  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/sdcflows/interfaces/reportlets.py", line 103, in _generate_report
	    abs(np.percentile(fmapdata[maskdata], 99.8)),
	                      ~~~~~~~~^^^^^^^^^^
	IndexError: boolean index did not match indexed array along dimension 1; dimension is 64 but corresponding boolean dimension is 96

Output from LSF job:
174148567.err.txt (493.5 KB)
174148567.out.txt (412.3 KB)

Okay, I solved this…was troubleshooting a bunch of other issues in my BIDS conversion/preproc pipeline yesterday and I don’t recall what specifically did it, but fMRIPrep now runs to completion on the subject without any errors. I suspect it may have been related to cached work files from either old heudiconv and/or fmriprep runs.

@JoeBathelt, you noted that “The scan duration is not the same for all scans, because it depended on the response duration of the participants.” Fwiw, I discovered that in the event of a scan being stopped by the operator, rather than the sequence running to completion, you can get a TR in which only partial volumes were acquired which was causing issues later. In case you’re also running into this problem, I ended up needing to use the dcm2niix flag -i : ignore derived, localizer and 2D images (y/n, default n) to ignore that TR when converting the DICOMs. (see Siemens XA partial volumes in 4D datasets · Issue #742 · rordenlab/dcm2niix · GitHub)

Thank you for the suggestion. Unfortunately, that does not resolve it for me. There are no partial volumes in the sequence. I also tried re-running the problematic participants from the import step, but got the same error.