As it says in the BIDS Specification, field maps are typically acquired with the purpose of correcting one or more EPI scans under func/
or dwi/
for distortions derived from B0 nonuniformity. The IntendedFor field (set in the .json sidecar of a field map NIfTI file) is a list of relative paths to the files the field map is intended to correct.
The BIDS Curation Gear uses “resolvers” as the final step of processing to set IntendedFor paths. The default ReproIn project curation template specifies only the folders where the files to be corrected are found (but more details can be added, see our article on the template file for more details.) Resolvers are used to list all of the possible files in those folders that the field map might be used to correct. To filter this list so that it contains only some of the files in the folders, use regular expression pairs in the BIDS Curation gear configuration or as an argument to the save_bids_curation.py script.
Example
For this example of using field maps on functional acquisitions, we'll use the Levitas Tutorial in Andy's Brain Book, which has two field maps that need to be applied to different functional runs. If that session is processed using the default project curation template, without specifying regular expressions, the following command will filter out the proper functional runs:
save_bids_curation.py <Group> <Project> -i '.*fmap(_|-)SE(_|-).* _run-1_bold .*gre-.* _run-2_bold'
Notice that the regexes are given in pairs. The first of each pair matches the field map acquisition label and the second matches the files to be corrected. The first regex of the first pair, .*fmap(_|-)SE(_|-).*
matches the field maps fmap-SE-AP
and fmap-SE-PA
, and the second regex of the first pair, _run-1_bold
, matches the first functional run.
The first regex of the second pair, .*gre-.*
matches the field maps gre-field-mapping
, and the second regex of the second pair, _run-2_bold
matches the second functional run. Note that including _bold
excludes the single-band reference (sbref) acquisitions.
Here is the IntendedFor lists for fmap-SE-AP
before using the regexes:
ses-01/func/sub-01_ses-01-bart_run-1_bold.nii.gz
ses-01/func/sub-01_ses-01-bart_run-2_bold.nii.gz
ses-01/func/sub-01_ses-01-rest_run-1_bold.nii.gz
ses-01/func/sub-01_ses-01-rest_run-2_bold.nii.gz
and here is the IntendedFor lists for fmap-SE-AP
after using the regexes:
ses-01/func/sub-01_ses-01-bart_run-1_bold.nii.gz
ses-01/func/sub-01_ses-01-rest_run-1_bold.nii.gz
Similarly, for gre-field-mapping
the IntendedFor lists look like this before using the regexes:
ses-01/func/sub-01_ses-01-bart_run-1_bold.nii.gz
ses-01/func/sub-01_ses-01-bart_run-2_bold.nii.gz
ses-01/func/sub-01_ses-01-rest_run-1_bold.nii.gz
ses-01/func/sub-01_ses-01-rest_run-2_bold.nii.gz
and here is the IntendedFor lists after using the regexes:
ses-01/func/sub-01_ses-01-bart_run-2_bold.nii.gz
ses-01/func/sub-01_ses-01-rest_run-2_bold.nii.gz