Handle BIDS specific operations

exception heudiconv.bids.BIDSError
heudiconv.bids.add_rows_to_scans_keys_file(fn, newrows)

Add new rows to file fn for scans key filename

fn: filename newrows: extra rows to add

dict fn: [acquisition time, referring physician, random string]

Strips any non-BIDS compliant characters within subject_id

subject_id : string

sid : string
New subject ID
subject_id : string
Original subject ID

Given a path to the bids formatted filename parse out subject/session



row: list
[ISO acquisition time, performing physician name, random string]

Aggregate across the entire BIDS dataset .json’s into top level .json’s

Top level .json files would contain only the fields which are common to all subject[/session]/type/*_modality.json’s.

ATM aggregating only for *_task*_bold.json files. Only the task- and OPTIONAL _acq- field is retained within the aggregated filename. The other BIDS _key-value pairs are “aggregated over”.

path: str
Path to the top of the BIDS dataset
heudiconv.bids.populate_bids_templates(path, defaults={})

Premake BIDS text files with templates

heudiconv.bids.save_scans_key(item, bids_files)

item: bids_files: str or list


Given a list of BIDS .json files, e.g.