Sharing two bugs I hit while applying GE two-echo fieldmaps (separate phase1/phase2 images) with FSL, in case others are doing the same. Both fail silently. I also have results on OpenNeuro ds000201 that may be useful to anyone using that dataset.
1. Unwrapping each phase image separately leaves a 2π·k offset
I computed the fieldmap by running prelude on phase1 and phase2 separately and then subtracting. But prelude chooses each image’s global 2π offset independently, so the difference can be off by a constant 2π·k. At ΔTE = 2 ms, that shifts the whole fieldmap by k × 500 Hz.
On ds000201 this hit 71 of 142 sessions (offsets of 1 to 4 wraps), and those 71 contained every catastrophic registration failure. The fix is to form the wrapped phase difference first, i.e. angle(exp(i·φ2)·conj(exp(i·φ1))), unwrap that once, and remove any leftover whole-wrap offset using the in-brain median. A quick check: if your fieldmap’s in-brain median sits near a multiple of 2π/ΔTE, you’ve been hit.
2. fugue --loadfmap doesn’t resample
The ds000201 fieldmap is 64×64 at 3.75 mm, and the BOLD is 128×128 at 1.875 mm. fugue ran without any error or warning, but it pairs voxels by index, so the shift map only covered one corner quarter of the EPI. The fieldmap has to be registered and resampled to the EPI grid first.
Results on ds000201 with both fixed (142 sessions, 71 subjects; BBR cost relative to uncorrected, lower is better):
| Condition | Median | Better than uncorrected |
|---|---|---|
| Before fixes | +0.111 | 0 / 142 (56 outright failures) |
Fixed, direction from BIDS JSON (j) |
+0.152 | 2 / 142 |
Fixed, opposite direction (j-) |
+0.011 | 27 / 142 |
Fixed, j-, ΔTE 1.6 ms instead of 2.0 |
+0.052 | 2 / 142 |
| Resampling only (fieldmap × 0.001) | −0.0001 | — |
- The opposite direction beat the JSON’s direction in 140/142 sessions. That means either the BOLD
PhaseEncodingDirectionor the sign convention of the GE phase images (phase2 − phase1) is reversed. They have the same effect infugue, and I can’t tell which from the BIDS data alone. - The JSON’s ΔTE of 2.0 ms beat 1.6 ms (from the series name
te6.4-8.0) in 141/142. - Even with the right direction, correction comes out roughly neutral on whole-brain BBR cost. I haven’t yet checked the frontal and temporal regions visually.
For what it’s worth, edickie/ds000201_preproc also found fieldmap correction looked worse than SyN-SDC on this dataset with fMRIPrep, but I don’t know whether the same causes apply there.
Script and full write-up: GitHub - neuromog/ge-fieldmap-fsl: FSL fieldmap correction for GE two-echo (phase1/phase2) acquisitions, with documented limitations found on OpenNeuro ds000201 · GitHub
Two questions:
- Does anyone know the phase-encoding polarity or the phase-image sign convention for ds000201, or for GE MR750 EPI and fieldmaps more generally?
- Is “neutral on BBR cost” what you’d expect from a correct fieldmap on data like this, or does it suggest something else is still off?
One more thing I noticed: on my FSL install, flirt -cost bbr -fieldmap ... (which epi_reg --fmap uses) gave a matrix identical to running without the fieldmap. I worked around it by unwarping with fugue first. I haven’t checked whether this is my setup or something more general.
Edit: corrected the phase-encoding bullet. I originally wrote that the JSON direction “looks reversed”, but a flipped phase-image sign would produce the same result.