FMRIprep how to calculate and apply the fieldmap

I just used Fmriprep for the first time and it is amazing! One thing that I am unclear about is our scans include a separate acquisition in the opposite phase enoding (PA) while the data collection is done in AP direction.

Previously, I used FSL topup to create a field map of the AP vs PA scan directions and then apply distortion correction of the field map during preprocessing. I could try to create a script of this, but I am wondering if someone has a) already done this or if b) I can do this easily within fMRIprep

My previous steps were here Acquiring and using field maps — LCNI

Please be as clear as possible as I am a newby (thank you again!)


Hi @AustinBipolar,

Just to clarify, you have two spin-echo field map files with opposite phase encoding directions (AP, PA)?

The nice thing about using field maps for distortion correction in fmriprep is that once you have your data in BIDS format, there’s not much else you really need to do. fmriprep will assess your BIDS data to check for fieldmaps and which files to apply the distortion to. If you didn’t collect field map acquisitions from the scanner, fmriprep has a “fieldmap-less” data-drive approach for perforing distortion correction (specify --use-syn-sdc in fmriprep command).

So as long as your data is properly formatted in BIDS, BIDS-apps such as fmriprep know where to look for the fieldmaps and how to apply them.

I was under the impression that we need to specify the “Intended for” field in the jsons of the fieldmaps in order for fmriprep to find them and assign them to the right scans. Could someone clarify this?

Also, can fmriprep handle an AP and a PA fieldmap that are both intended for the same scan (eg. a task scan)?

Thanks so much!

Hi @dclb,

This is correct.

Yes, for each fmap json file, there needs to be an IntendedFor field that contains the relative path(s) of the file(s) that the distortion correction will be applied to.

thanks so much!

just to make sure I understand correctly, a PA and an AP fieldmap can simultaneously be used for distortion correction of, for example, the same task scan?

Correct, in fact, both phase encoding direction fmap acquisitions are required to perform distortion correction. For reference, see this section of the BIDS specification.

1 Like