Task-based field maps BIDS naming convention

According to the BIDS naming convention, the fMRI fmap files do not have their task labels
for instance, sub-<label>[_ses-<label>][_acq-<label>][_run-<index>]_magnitude2.nii[.gz]

i wonder if this means that all fMRI tasks within the same session share the same fmap files?

so, i’m fMRIpreping the CAM-CAN dataset which has 3 fMRI tasks (rest, movie and SMT). Apparently each of these tasks have their own folder of fmap files. I wonder if its ok if i simply use the fmap files for rest on all 3 tasks?


The link between the fieldmap files and the functional runs is specified in two ways according to the the bids specification:

  • either by adding the field IntendedFor in the JSON files of the fmap/ images.
"IntendedFor": [
  • or by adding the field B0FieldSource field in the JSON files of the BOLD images and the B0FieldIdentifier in the JSON file of the fmap/:
    – for the fmap/ JSON:
"B0FieldIdentifier": "B0mapToto"

– for the func/ JSON:

"B0FieldSource": "B0mapToto"
1 Like

The best approach would be to use the fieldmap dedicated for each functional image to correct each functional image.
Indeed in general a dedicated fieldmap is acquired just before and just after the functional run, with the head in similar position, and sometimes there may be re-shiming involved between runs (but I don’t know the acquisition settings for this dataset).

Completely agree with what @jsein said.

If the fmaps do not have this intended for field in the sidecar json you have to start making assumptions about what fieldmap goes with what functional run: β€œeasy” when there is only one of each but becomes quickly harder for anything beyond that.

Also if a dataset like CAM-CAN does not have this info, this may be a problem that should probably be reported to the curation team.

indeed the json files do not contain such information. In fact the json files for the fmaps are identical between tasks, the phase and magnitude files have identical file sizes for all three tasks as well.

So if i were to add "IntendedFor": in the JSON files for the fmaps, how should i name these fmaps?

in this manner?


because according to BIDS name conventions, these fmap filenames should not contain the task labels

Could you spend some time looking at BIDS examples to see how IntendedFor is used (GitHub search link to get you going)? I think that will give you a better handle on how this works, and allow you to ask more pointed questions, if imitating the examples doesn’t get you the whole way there.

i appreciate the help pointing me to the IntendedFor json parameter, this is something new that i didnt know before, but i dont think this solves problem at all.

sorry for not being very clear about the problem. Let me explain again, this is my subject’s directory

β”œβ”€β”€ anat
β”‚   └── sub-CC110319_T1w.nii
β”œβ”€β”€ fmap
β”‚   β”œβ”€β”€ sub-CC110319_magnitude1.json
β”‚   β”œβ”€β”€ sub-CC110319_magnitude1.nii.gz
β”‚   β”œβ”€β”€ sub-CC110319_magnitude2.json
β”‚   β”œβ”€β”€ sub-CC110319_magnitude2.nii.gz
β”‚   β”œβ”€β”€ sub-CC110319_phasediff.json
β”‚   └── sub-CC110319_phasediff.nii.gz
└── func
    β”œβ”€β”€ sub-CC110319_task_movie_bold.json
    β”œβ”€β”€ sub-CC110319_task_movie_bold.nii.gz
    β”œβ”€β”€ sub-CC110319_task_smt_bold.json
    └── sub-CC110319_task_smt_bold.nii.gz

supposed i have 2 sets (movie and smt) of fmap files with the correct IntendedFor parameters, which are to be placed in the subject’s fmap folder, how should i name them? because i can’t possibly use the same filename for both tasks e.g sub-CC110319_magnitude1.json ?

If your fieldmaps are identical, the recommendation would be to use run-1 and run-2 to differentiate them. You would then use IntendedFor to differentiate the files that they are intended to apply to.

β”œβ”€β”€ anat
β”‚   └── sub-CC110319_T1w.nii
β”œβ”€β”€ fmap
β”‚   β”œβ”€β”€ sub-CC110319_run-1_magnitude1.json
β”‚   β”œβ”€β”€ sub-CC110319_run-1_magnitude1.nii.gz
β”‚   β”œβ”€β”€ sub-CC110319_run-1_magnitude2.json
β”‚   β”œβ”€β”€ sub-CC110319_run-1_magnitude2.nii.gz
β”‚   β”œβ”€β”€ sub-CC110319_run-1_phasediff.json
β”‚   β”œβ”€β”€ sub-CC110319_run-1_phasediff.nii.gz
β”‚   β”œβ”€β”€ sub-CC110319_run-2_magnitude1.json
β”‚   β”œβ”€β”€ sub-CC110319_run-2_magnitude1.nii.gz
β”‚   β”œβ”€β”€ sub-CC110319_run-2_magnitude2.json
β”‚   β”œβ”€β”€ sub-CC110319_run-2_magnitude2.nii.gz
β”‚   β”œβ”€β”€ sub-CC110319_run-2_phasediff.json
β”‚   └── sub-CC110319_run-2_phasediff.nii.gz
└── func
    β”œβ”€β”€ sub-CC110319_task-movie_bold.json
    β”œβ”€β”€ sub-CC110319_task-movie_bold.nii.gz
    β”œβ”€β”€ sub-CC110319_task-smt_bold.json
    └── sub-CC110319_task-smt_bold.nii.gz
1 Like