def bids_from_config(sess, scans_metadata, config, out_base):
<EOL>_item = next(iter(scans_metadata))<EOL>session,subject = _item['<STR_LIT>'],_item['<STR_LIT>']<EOL>sourcedata_base = os.path.join(<EOL>out_base,<EOL>'<STR_LIT>',<EOL>'<STR_LIT>'.format(legal.sub('<STR_LIT>', subject)),<EOL>'<STR_LIT>'.format(legal.sub('<STR_LIT>', session))<EOL>)<EOL>bids_base = os.path.join(<EOL>out_base,<EOL>'<STR_LIT>'.format(legal.sub('<STR_LIT>', subject)),<EOL>'<STR_LIT>'.format(legal.sub('<STR_LIT>', session))<EOL>)<EOL>args = commons.struct(<EOL>xnat=sess,<EOL>subject=subject,<EOL>session=session,<EOL>bids=bids_base,<EOL>sourcedata=sourcedata_base<EOL>)<EOL>func_refs = proc_func(config, args)<EOL>anat_refs = proc_anat(config, args)<EOL>fmap_refs = proc_fmap(config, args, func_refs)<EOL>
Create a BIDS output directory from configuration file