Proper way of linking multiple field map data with EPI data in BIDS standard

I wonder what is the recommended way to properly organize and link multiple field map (or spin echo) data with the corresponding EPI data. In our case, our experiment spans multiple days. Spin echo or double-phase field maps will be acquired in each session. So, ideally there should be some way to indicate the link between these field map or spin echo data to EPI data acquired in the same session. But the explanation of BIDS standard of the usage of session seems to suggest that it is used when the design within sessions is the same for all subjects. Practically, we may have small variation in how many scans are acquired in each session across participants when occasional failure of scanner or fatigue of participants occur (some scans would be moved to the next session). From the documentation I feel that maybe the field of ses is not proper for our case. But I may be wrong.
Or, do people use some json files to indicate which EPI scans should be linked to which spin-echo or field map scans?


You can add an “IntendedFor” field in your field map json files.

Ah I see. Thanks for the suggestion!

If you want to do this from a terminal or a shell script, jq is great for querying JSON and setting new variables!

cat your_field_map.json | jq '.IntendedFor |= "relative/path/to/target.nii.gz"' > your_updated_field_map.json