Problem with new version of fmriprep (See update below): error while running processing of fieldmaps

Hello everyone!

Summary of what happened:

I want to run fmriprep on imaging data that has been acquired sagittally.
When I ignore the fieldmaps, everything runs nicely. However, with fieldmaps I get an error:
“ValueError: Shape of coefficients file [33 46 46] does not meet the expected shape [46. 46. 33.] (topup factors are [2. 2. 2.])”

For the fieldmaps I use two spin echo EPI sequences. For one of the two EPI sequences the phase encoding direction is inverted compared to the other one.
The error I get occurs during preprocessing of the fieldmaps.

Command used :

I use the following command stored in a bash script to run fmriprep:

  nthreads=$((numCPUs / nSubj))

    docker run --rm -e DOCKER_VERSION_8395080871=20.10.21 -it \
    -v ${S_FolderLicense}:/opt/freesurfer/license.txt:ro \
    -v ${S_FolderBIDS}:/data:ro \
    -v ${S_FolderOut}:/out \
    -v ${S_FolderWorkingDir}:/scratch \
    -u $UID \
    nipreps/fmriprep:22.1.1 /data /out participant --participant-label  ${subj01} \
    --nthreads ${nthreads} \
    --stop-on-first-crash \
    --mem ${mem_mb} \
    --use-aroma \
    -w /scratch

Version and Environment:

I am running fmriprep via docker: DOCKER_VERSION_8395080871=20.10.21
The version of fmriprep is fmriprep:22.1.1

Data formatted according to a validatable standard?

I use dcm2niix and a custom matlab script to convert the DICOM data to BIDS standards. The correct formatting of the data is tested with this website:

Important note: for the fielmaps I need to add the tag PhaseEncodingDirection manually. Our Scanner does not give proper names to the fieldmaps such that dcm2niix automatically detects the phase encoding direction.
However, this is a known problem and I checked the correctness of this tag as far as I could.

Relevant log outputs (up to 20 lines):

File: /out/sub-AVR024/log/20230123-211135_78dd9716-9128-4c13-b20c-307a55d607aa/crash-20230124-012147-UID1136-fix_coeff-c5bedbd9-ba15-4dfc-ac55-080388ec52f5.txt
Working Directory: /scratch/fmriprep_22_1_wf/single_subject_AVR024_wf/fmap_preproc_wf/wf_auto_00000/fix_coeff
fmap_ref: /scratch/fmriprep_22_1_wf/single_subject_AVR024_wf/fmap_preproc_wf/wf_auto_00000/setwise_avg/sub-AVR024_ses-01_dir-PA_epi_average_merged_average.nii
in_coeff: ['/scratch/fmriprep_22_1_wf/single_subject_AVR024_wf/fmap_preproc_wf/wf_auto_00000/topup/reoriented_base_fieldcoef.nii.gz']
pe_dir: j
Traceback (most recent call last):
  File "/opt/conda/lib/python3.9/site-packages/nipype/pipeline/plugins/", line 344, in _send_procs_to_workers
  File "/opt/conda/lib/python3.9/site-packages/nipype/pipeline/engine/", line 527, in run
    result = self._run_interface(execute=True)
  File "/opt/conda/lib/python3.9/site-packages/nipype/pipeline/engine/", line 645, in _run_interface
    return self._run_command(execute)
  File "/opt/conda/lib/python3.9/site-packages/nipype/pipeline/engine/", line 771, in _run_command
    raise NodeExecutionError(msg)
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node fix_coeff.

	Traceback (most recent call last):
	  File "/opt/conda/lib/python3.9/site-packages/nipype/interfaces/base/", line 398, in run
	    runtime = self._run_interface(runtime)
	  File "/opt/conda/lib/python3.9/site-packages/sdcflows/interfaces/", line 472, in _run_interface
	    self._results["out_coeff"] = [
	  File "/opt/conda/lib/python3.9/site-packages/sdcflows/interfaces/", line 474, in 
	  File "/opt/conda/lib/python3.9/site-packages/sdcflows/interfaces/", line 555, in _fix_topup_fieldcoeff
	    raise ValueError(
	ValueError: Shape of coefficients file [33 46 46] does not meet the expected shape [46. 46. 33.] (toupup factors are [2. 2. 2.]).

I am pretty new to fmriprep and at the moment I have no idea what to try next to solve the problem.
I am grateful for any suggestions or hints!
Does anyone know what the exact source of this error is and/or how to solve it? Could it be related to the sagittal image acquisition?



After running the exact same command with an older version of fmriprep namely 22.0.2 instead of the current one 22.1.1 the error disappeared.

What would you advice me to do now? Simply run my data with the older version or is there an error in my data?

If the dataset works on 22.0.2, I would probably go with that for now. Would you be willing to share a subject of your dataset privately so we can identify the regression?