A tool to edit .JSON files' IntendedFor entry so that the fmap files can be correctly identified and processed by fMRIprep. This currently does not work with BIDS directories that contain multiple sessions of data

editJSON_IntendedFor(json_files, nii_files, subjects, base_dir = "func/")

Arguments

json_files

filename suffix for one (e.g., "_phasediff.json") or multiple JSON files (e.g., c("_phasediff.json", "magnitude1.json", "magnitude2.json"))

nii_files

one or more filename suffix of the nii or nii.gz files (e.g., "_task-rest_bold.nii.gz") to be added to the IntendedFor entry of the specified JSON files.

subjects

If specified, will only processed the selected subjects

base_dir

base directory of the *bold.nii.gz files. set to "func/" by default.

Details

This function searches for .JSON files at the root of fMRIprep BIDS directory, edits their IntendedFor entry before overwriting the original JSON file

Examples

if (FALSE) { # \dontrun{
editJSON_IntendedFor(json_files="_phasediff.json",nii_files="_task-rest_bold.nii.gz")
} # }