BIDS and FMRIPREP fmap issues


Organizing some GE scanner data into BIDS format, in order to run it through FMRIPREP, and running into the following issues:

  1. Each subject has several func runs, and each func run has two associated fmap images (phasediff.nii and magnitude.nii) in the fmap directory as follows (example screenshot of one subject):
    The func directory has all the corresponding functional images.
    I get the following error on BIDS Validator:

  2. I can temporarily fix issue #1 by removing run-restpre from the magnitude.nii and phasediff.nii filenames (although according to the BIDS specification document, keeping run-restpre should be fine, right?), but then I can only have one set of fieldmap images for all the func images, so issue #1 still needs to be fixed - any suggestions?. Now after my temporary fix of issue #1, I run BIDS validator and get the following error regarding the .json file:

    Here’s what my .json file says:
    I can only include one EchoTime because dual echo times were not collected to do the correction, here it’s just the same echo time but instead reverse the phase encoding direction was used to calculate the distortions. I tried to ameliorate this error by including 80ms as both EchoTime1 and EchoTime2 in the .json, but get the following error:

    So it seems that I can’t have two EchoTime values, what is the solution to this?

  3. Moreover, I get a BIDS Validator error that says sform_code and qform_code in the header are zero values, see below:

    I ran mri_info (from FreeSurfer) to obtain header information on the magnitude.nii and phasediff.nii images, and here are the respective screenshots:

    Do I have to modify anything in the headers of phasediff.nii and magnitude.nii images to get them BIDS validated?

  1. run label needs be a number (run-1) not a string (run-something)

  2. You need to use _epi suffix instead of _phasediff or _magnitude for such fieldmap data. Check the spec for more info.

  3. I recommend recreating your niftis using to create valid niftis

Don’t forget to add the IntendedFor fields (see the spec) it’s optional in BIDS, but required by FMRIPREP.


Hi @ChrisGorgolewski

Do we need to add the “IntendedFor” fields even when using the latest version of fMRIPREP (i.e., v 1.2.5?)

Thank you.


yes you do need “IntendedFor”