Error when running fMRIPrep: phase encoding direction "i-"

Hi all,

Looking for some help, please. I am running fMRIPrep for a single subject and I am getting the following error:

Building fMRIPrep’s workflow:
* BIDS dataset path: /home/edwardy/nq46/edwardy/helping_Bec/MAGNET/rawdata.
* Participant list: [‘86202065’].
* Run identifier: 20220719-104306_49c5bc58-1fd5-45c0-993a-e46bcd0cdcf2.
* Output spaces: MNI152NLin2009cAsym:res-native T1w.
* Pre-run FreeSurfer’s SUBJECTS_DIR: /home/edwardy/nq46/edwardy/helping_Bec/MAGNET/rawdata/derivatives/sourcedata/freesurfer.
Process Process-2:
Traceback (most recent call last):
File “/opt/conda/lib/python3.8/multiprocessing/”, line 315, in _bootstrap
File “/opt/conda/lib/python3.8/multiprocessing/”, line 108, in run
self._target(*self._args, **self._kwargs)
File “/opt/conda/lib/python3.8/site-packages/fmriprep/cli/”, line 118, in build_workflow
retval[“workflow”] = init_fmriprep_wf()
File “/opt/conda/lib/python3.8/site-packages/fmriprep/workflows/”, line 85, in init_fmriprep_wf
single_subject_wf = init_single_subject_wf(subject_id)
File “/opt/conda/lib/python3.8/site-packages/fmriprep/workflows/”, line 324, in init_single_subject_wf
fmap_estimators = find_estimators(
File “/opt/conda/lib/python3.8/site-packages/sdcflows/utils/”, line 298, in find_estimators
e = fm.FieldmapEstimation(
File “”, line 7, in init
File “/opt/conda/lib/python3.8/site-packages/sdcflows/”, line 385, in attrs_post_init
raise ValueError(

ValueError: Only one phase-encoding direction found across sources.

When I check the meta data associated with my functional resting state images as well as my magnitude 1 and phase diff field maps, the phase encoding direction is listed as “i -” for them all.

I also have a reverse phase encoding image acquired (labeled as “REV_PE_L-R_mmb_4_4_cmrr_mbep2d_bold_TE” and those files which are also in the /fmap dir have the phase encodng direction listed as “i”.

Does fMIRPrep automatically take the Reverse phase maps to do the B0 field inhomogeneity correction or does it read in the mag and phase diff images? Do I need to manually later the phase encode direction for my files?

I would appreciate any help as I have hit a roadblock.

Hi Rebecca,

It would help if you could provide the following information:

  1. Version of fMRIPrep
  2. Is this error subject specific?
  3. Are your data BIDS valid?

This doesn’t sound like a BIDS valid filename.


Hi Steven,

  1. version 21.0.1
  2. I am only running it on a single subject to start with (so, yes this is subject specific…i haven’t yet tried on other subjects but suspect the error would be the same)
  3. Data is BIDS valid. That is the name of the imaging sequence, but the actual name of the files in the fmap dir is as follows (see the last 8 file names for the reverse phase):


I’m struggling to understand which files fMRIPrep is using for the distortion correction (mag/phase field maps OR the reverse phase) and why there is an issue with the phase encode direction.

Do you have the IntendedFor field filled out for these files? That should tell you which file associations fMRIPrep should be making.