My preprocessing summary reports all say: Susceptibility distortion correction: None
but I have fieldmap scans–and I don’t see a configuration setting for fieldmap sdc
Grateful for any help!!
1 Like
Steven
October 8, 2022, 1:11am
2
Hello,
Do your fieldmap JSON files have IntendedFor
fields to associate the fieldmaps with the BOLD files?
Best,
Steven
no sir, they don’t–is this something Flywheel needs to correct, or is there a way to modify this on my end?
Steven
October 8, 2022, 1:56am
4
This is something you would need to correct on your end. You can add them manually to the files (or make a script to do this, see below for a quick example I made in python).
Assumes there’s no ses-*
level. Make bids
the path to your BIDS root directory. You’ll have to change the definitions for fmaps_func_jsons
and fmaps_dwi_jsons
to include the proper search string to find the appropriate jsons. Also assumes that all fmri fmaps apply to all fmri niftis. If these assumptions aren’t correct for you hopefully there’s enough here that you can adapt to meet your needs.
import json
import os
import glob
bids = ''
subs = glob.glob(bids+'sub*')
for sub in subs:
func_niis = [x.replace(sub+'/','') for x in glob.glob(sub+'/func/*.nii*')]
dwi_niis = [x.replace(sub+'/','') for x in glob.glob(sub+'/dwi/*.nii*')]
fmaps_func_jsons = glob.glob(sub+'/fmap/*fMRI*.json')
fmaps_dwi_jsons = glob.glob(sub+'/fmap/*dwi*.json')
for file in fmaps_func_jsons:
with open(file) as f:
data = json.load(f)
IF = {"IntendedFor":func_niis}
data.update(IF)
with open(file, 'w') as outfile:
json.dump(data, outfile,indent=2,sort_keys=True)
for file in fmaps_dwi_jsons:
with open(file) as f:
data = json.load(f)
IF = {"IntendedFor":dwi_niis}
data.update(IF)
with open(file, 'w') as outfile:
json.dump(data, outfile,indent=2,sort_keys=True)
1 Like