BIDS

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]
heudiconv.bids.convert_sid_bids(subject_id)

Strips any non-BIDS compliant characters within subject_id

subject_id : string

sid : string
New subject ID
subject_id : string
Original subject ID
heudiconv.bids.find_subj_ses(f_name)

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

heudiconv.bids.get_formatted_scans_key_row(dcm_fn)

item

row: list
[ISO acquisition time, performing physician name, random string]
heudiconv.bids.populate_aggregated_jsons(path)

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

heudiconv.bids.tuneup_bids_json_files(json_files)

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