Skip to content

Instantly share code, notes, and snippets.

View utooley's full-sized avatar

Ursula Tooley utooley

View GitHub Profile
@utooley
utooley / assign_intendedfor.py
Last active February 21, 2022 21:51 — forked from tsalo/assign_intendedfor.py
Add "IntendedFor" field to BIDS field map jsons for the associated fMRI and DWI scans based on acquisition time.
import json
import bisect
from glob import glob
from os.path import join, splitext
from bids.layout import BIDSLayout
from dateutil.parser import parse
# subj_dir *must* have trailing /, use os.path.join to make sure
subj_dir = join("/my_dir","")
subj='NDARINVZ02PLW9B'