Switching magnitude fieldmap labels to meet BIDS specification

I’m in the process of BIDSifying a multi-site dataset. At one of the sites we generated two magnitude fieldmaps and one phase difference map for each participant, but the magnitude files are in the “wrong order” per BIDS specification; the “magnitude1” fieldmap has a longer TE than the “magnitude2” fieldmap. To make them BIDS compliant, I was thinking that I would switch the names of the magnitude files, and then correspondingly change the Echo Time fields in the phasediff json file from…

‘EchoTime’: 0.00738,
‘EchoTime1’: 0.00738,
‘EchoTime2’: 0.00492,


‘EchoTime’: 0.00738,
‘EchoTime1’: 0.00492,
‘EchoTime2’: 0.00738,

But I’m worried that there may be other things under the hood that I’m missing. Can anyone confirm if the changes I described would be sufficient to make the dataset BIDS compliant without causing downstream problems with distortion correction?


Hi @jdknotts, Welcome to Neurostars!

Did you check that the “magnitude1” image has actually a higher signal than the magnitude2 image?

Yes I think that this change would be enough.

But in fact, even with not making this change, your dataset might well be taken care of by your preprocessing software.
Indeed, per se it is not a big deal to have those two images with inverted EchoTimes in the json file, the magnitude2 image would be taken instead of magnitude 1 for the preprocessed steps such a brain extraction, registration to bold.
Magnitude2 is expected to have lower signal than Magnitude 1 but it should not make a big difference in the result in the end, even if you don’t correct the Echotimes for those images…
Let us know how it goes!

@jsein A tool could handle that if it inspects the echo times, but BIDS requires magnitude1 to be the shorter and magnitude2 to be the longer, so tools that don’t care about the specific echo times probably won’t.

@jdknotts One thing I would be concerned about is whether your phasediff might be inverted from what it should be. If phasediff = phase2 - phase1, and your magnitudes were swapped, the reconstruction algorithm might have also swapped the phases. This would result in your distortion correction being opposite in direction and enhancing rather than reducing distortions. I would visually compare the fieldmaps with others where the magnitudes are in the correct order to see whether you need to invert the fieldmap. Fieldmaps have characteristic peaks and troughs, though be aware of phase-wrapping when inspecting. More information here: Acquiring and using field maps — LCNI

Hi @jsein and @effigies. Thanks so much to both of you for your prompt and helpful replies!

@jsein I confirmed that in all cases, the magnitude image with the shorter TE had the higher signal. So in the cases of BIDS violations, ‘magnitude2’ had the higher signal.

@effigies that’s exactly the kind of thing I was worried about. I plotted an example ‘phasediff’ image from each site, and found that they indeed all had the same characteristic peaks and troughs:

Given this, I figure I will proceed with my original plan, and then just pay extra attention to the distortion correction images from fmriprep to make sure things look okay. But please let me know if you still have any concerns. Thank you again for your help!

1 Like

This is a naive question, but is it obvious, based on the scale of the colorbars in the image above, what units these fieldmaps are in (e.g., tesla vs rad/s vs Hz)? I tried looking this info up in the nifti header but couldn’t find anything useful. Any help would be greatly appreciated!

Just in case anyone ends up in the same boat, I’m popping back in here to say that the approach described in my original post appears to have worked. The resulting distortion corrected images look reasonable.

1 Like