= Export raw files in BIDS format = ''Author: Martin Cousineau'' It is now possible to export your raw files in the [[http://bids.neuroimaging.io/|Brain Imaging Data Structure (BIDS)]] format. '''Note:''' For the time being, only MEG data files in CTF format can be exported in the BIDS format. <> == How to use == * First, select the raw files you would like to export and drag them in the process box. * Click on [Run] to open the pipeline editor window. * Select the process "'''File -> Export MEG-BIDS dataset'''". {{attachment:meg_bids_process.png}} == Process options == * '''Output folder''': En empty folder where a BIDS folder organization will be created by the process, or an existing BIDS-formatted folder where new recordings will be appended. * '''Subject names''': The naming convention to use for subjects (sub-XXXX) * __Custom names__: The Brainstorm subject names will be kept, with non-alphanumeric characters removed. For example, if your subject name in brainstorm is Subject01, the BIDS-formatted name for this subject will be sub-Subject01. * __Number index__: An auto-incremented 4 digit index number will be automatically assigned to each subject based on their alphabetical order. For example, Subject01 will be sub-0001. If the output folder specificed above is an existing BIDS-formatted folder, numbering will start from the last subject ID. * '''Session names''': The naming convention to use for sessions (ses-XXXX) * __Acquisition date__: The acquisition date extracted from the raw file metadata, or the date the data was imported in Brainstorm if that fails, will be used for session names (e.g. ses-20181023). This is the default behavior for the emptyroom subject regardless of the value of this option. * __Number index__: An auto-incremented 4 digit index number will be automatically assigned to each session of a subject, ordered by their acquisition date. For example, if Subject01 has two sessions recorded at 10AM and 2PM the same day, the 10AM session will be ses-0001 and the 2PM session will be ses-0002. If the output folder specified aboveis an existing BIDS-formatted folder with previous sessions of the same subject already present, the numbering will start from the last session ID. * '''Keywords to detect empty room recordings''': In order to properly assign empty room recordings to the special emptyroom subject, the process will look for these comma-separated keywords in the condition name (raw folder). If you would like not to have an emptyroom subject, leave this blank. * '''Overwrite existing files''': If the output folder provided above is an existing BIDS-formatted folder, this option specifies whether to overwrite existing raw files or not. If not checked, the process will skip existing files. === MEG sidecar required fields === The BIDS specification has some required fields in both the general dataset description JSON file and the specific MEG sidecard JSON files. Using the raw files metadata, this process is able to detect most fields required by the BIDS specification. However, two fields cannot be detected and need to be specified by the user in the process options. * '''Power line frequency''': The frequency of the power line at the acquisition site (typically 50 Hz in Europe, 60 Hz in North America). * '''Position of the dewar during the MEG scan''': "upright", "supine" or "degrees" of angle from vertical: for example on CTF systems, upright=15°, supine = 90°. === MEG sidecar optional fields === The two following options need to be formatted in JSON, see example in the default value of the proces options. To add more than one field, just add a comma at the end of the "field": "value" lines. You may leave them blank if you do not want to provide additional optional fields. * '''Additional dataset description JSON fields''': Any additional JSON fields you would like to add to the dataset_description.json file at the root of your BIDS directory. * '''Additional MEG sidecar JSON fields''': Any additional JSON fields you would like to add to the _meg.json files that accompany your data files. == Additional documentation == '''Website ''' * BIDS specification official website: http://bids.neuroimaging.io/ * JSON format description: https://en.wikipedia.org/wiki/JSON '''Articles ''' * Gorgolewski, K.J., Auer, T., Calhoun, V.D., Craddock, R.C., Das, S., Duff, E.P., Flandin, G., Ghosh, S.S., Glatard, T., Halchenko, Y.O. and Handwerker, D.A. (2016)<
>[[https://www.nature.com/articles/sdata201644|The brain imaging data structure, a format for organizing and describing outputs of neuroimaging experiments]], Scientific Data, 3, p.160044. * Galan, J.G.N., Gorgolewski, K.J., Bock, E., Brooks, T.L., Flandin, G., Gramfort, A., Henson, R.N., Jas, M., Litvak, V., Moreau, J. and Oostenveld, R. (2017)<
> [[https://www.biorxiv.org/content/early/2017/08/08/172684|MEG-BIDS: an extension to the Brain Imaging Data Structure for magnetoencephalography]], bioRxiv, p.172684.