FMRIPREP: field mapping data



Dear All,

I’m currently trying to organize some of my datasets according to BIDS standards* and have a quick question about references to B0 inhomogeneity maps.
Can someone please confirm if having only one Siemens’ GRE_field_mapping image in the fmap folder [saved as *phasediff.nii.gz?] is enough for fmriprep to run field inhomogeneity correction?
Many thanks in advance!



You will need at least one magnitude image in addition to the phasediff image. Have a look at section 8.9.1 of

The examples in the bids-examples repository do not include binary data. More details at


Thanks Chris,
I believe one would need SWIs to derive magnitude images in my case, right? Don’t have it, unfortunately :frowning:



I’m not sure. The magnitude image is essential to align the fieldmaps to the image you want to apply them to. The standard Siemens fieldmap sequence saves magnitude images (although they might be part of a 4D volume).


I have encountered a similar issue and thought this might be a good place to seek help.

I have the information about the different TEs, which I included in the phasediff.json file, according to the specs,
and the output from Siemens (converted to .nii, 1 screenshot below, due to the limit of one picture), yet when trying to run fmriprep I got the following error-
“traits.trait_errors.TraitError: The trait ‘in_files’ of an IntraModalMergeInputSpec instance is an existing file name, but the path ‘/snapshot/data/sub-001/fmap/sub-001_magnitude2.nii.gz’ does not exist.”

Thanks in advance for your help!


Did you also included a magnitude file?

BIDS allows having only one magnitude file, FMRIPREP only supports two. The issue describing this is here It would be a great first time contribution - would you like to attempt it?


Yes, that is exactly what happened. Excuse me if I didn’t quite follow, but how may I contribute?


Have a look here:


We are also happy to take this fix on ourselves if you don’t have spare cycles at the moment.



Dear Siemens users,

So- what is the standard way to split these combined 4d series to magnitude and phasediff?
Going through the whole sequence, getting the indices (of changes from phase to magnitude) and splitting by them is the only way, or there is some shortcut for this?

Sorry for the newbie question, but-
When converting Siemens gre_field_mapping sequences to the nifti format by running dcm2niix, one finds:


How does one should transform these to the magnitude and phase nii-s- which is which?
(Any documentation regarding these suffixes?)

Many thanks


I would suggest opening a new topic for this. It will give it more exposure and the potential solution might be easier to find for other users.