Skip to content
Corentin Wicht edited this page Apr 12, 2021 · 19 revisions

autoBIDS

Downloading the repository

When on the autoBIDS startup page, start by clicking on ⬇️ Code on the top right of the screen and then Download ZIP to download the whole repository (alternatively you can also clone it).

MATLAB administrator privileges

Be sure to run MATLAB with administrator privileges to avoid errors related to BIDS metadata generation (see example at the end of the wiki).

Table of Contents

autogenerated

Getting Started

Loading Raw EEG files

The first window that will pop-up will ask you to provide the most upper directory (i.e. the folder containing all subfolders) containing all your raw EEG files.

Loading marker files (optional)

This second step enables you to load Biosemi specific marker files (.mrk files) containing triggers information. This step is optional since they may already be embedded in the raw EEG files and further imported to the EEG.event EEGLAB structure.

Loading channels location file

Here you need to provide the channel location file (already provided in the ChanLocs 📁 folder for BioSemi 64 and 128 electrodes caps).

Preprocessing parameters

In this prompt you need to specify:

  • How many electrodes were used for the recordings (all provided raw EEG files need to have been recorded with the same number of electrodes!).
  • The number corresponding to the reference electrode (this will depend on the channels location file provided in the preceding step).
  • The name you would like to give to the study that will be stored in the MATLAB's current folder.
  • If you would like to add a delay to all triggers timings loaded from the .mrk files (optional).

BIDS design parameters

This is the most crucial and case-sensitive part of the script.

This prompt will enable to automatically create the EEGLAB study and autopopulate some of the BIDS information based on the provided raw EEG files names.
It is divided into 4 categories for which the same principles of matching patterns apply:

  • SUBJECTS: the unique name of the subjects in your files/folders structure (mandatory)
  • TASKS: the unique name of the task(s) in your files/folders structure (mandatory to specify at least ONE task)
  • FILES/RUN: The unique name of the runs if you have divided your task in multiple recordings, e.g. for each block of trials (optional)
  • SESSIONS: The unique name of the within-subject factor session in your files structure, if any (optional) \

The concept is for each of the category to specify:

  • The unique identifier
  • Whether this identifier can be found in files [1], folders [2] or does not exist if not applicable [0] \

Finally, the last entry of the prompt enables you to either let the script autopopulate an excel file to give detailed task and participant information (see prompts below) [1] which is the recommended method, or use EEGLAB GUIs [2], which will be much slower. \

To better illustrate these explanations let's take an example of a raw EEG data structure: \

📁 [DATA]
 ↳ 📁 [GNG] 
    ↳ 🧠 Sub1_Ses1_B1.bdf
    ↳ 🧠 Sub1_Ses1_B2.bdf
    ↳ 🧠 Sub1_Ses2_B1.bdf
    ↳ 🧠 Sub1_Ses2_B2.bdf
    ↳ 🧠 Sub2_Ses1_B1.bdf
    ↳ 🧠 Sub2_Ses1_B2.bdf
    ↳ 🧠 Sub2_Ses2_B1.bdf
    ↳ 🧠 Sub2_Ses2_B2.bdf
 ↳ 📁 [NBACK]
    ↳ 🧠 Sub1_Ses1_B1.bdf
    ↳ 🧠 Sub1_Ses1_B2.bdf
    ↳ 🧠 Sub1_Ses2_B1.bdf
    ↳ 🧠 Sub1_Ses2_B2.bdf
    ↳ 🧠 Sub2_Ses1_B1.bdf
    ↳ 🧠 Sub2_Ses1_B2.bdf
    ↳ 🧠 Sub2_Ses2_B1.bdf
    ↳ 🧠 Sub2_Ses2_B2.bdf

This design related to this example is the following:

DESIGN MATCHING PATTERN LOCATION
2 subjects (Sub1 and Sub2) Sub* 1 [files]
2 cognitive tasks GNG;NBACK 2 [folders]
2 runs (B1 and B2) B* 1 [files]
2 sessions (Ses1 and Ses2) Ses* 1 [files]

Hence, based on the example below, the prompt should have been filled accordingly:

Participant information excel file

Based on your reply to the last entry of the previous prompt, you may see an excel file pop-up.
This relate to the participant information that will be exported as part of the BIDS metadata.
You have the possibility to adjust the automatically filled information (based on previous prompt) and even add or rename columns.
Importantly, there will be 2 sheets in the excel file:

DATA sheet

This sheet contains information specific to each provided file such as Task, session, headcircumference, etc.

DESC sheet

This sheet will contain a description of the variables (i.e. each column in the DATA sheet) as well as an explanation of the levels (for categorical variables).
Again, this sheet will be automatically filled based on the previous prompt.
Nevertheless if you make changes to the DATA sheet columns (add and/or modify columns), YOU NEED TO REPORT THESE CHANGES IN THE DESC SHEET !

**Once you are satisfied with your results, press on the OK button. **

Loading existing EEGLAB study

Now we are switching to the creating of the EEGLAB study (for more information see the EEGLAB wiki)
Here you just need to specify whether you would like to load an existing study or create a new one.

EEGLAB GUIs

This part relates to the EEGLAB built-in GUIs for BIDS generation for which detailed information are provided in the BIDS plugin official wiki page. \

Task information

This first GUI will be autopopulated with BioSemi specific information used in the LNS laboratory, feel free to adjust them.

Participant information

This second GUI will only pop-up if you decided to go with the EEGLAB GUI method [2], i.e. last entry of the BIDS design parameters prompt.

Event information

This last GUI will always pop-up to help you specify information related to the EEG events.
Please refer to the BIDS plugin official wiki page for additional information.

BIDS export error

Finally, this error may pop-up on specific computer will trying to export the BIDS metadata.
It seems that you need to run MATLAB with administrator privileges to avoid such error.

BIDS export validation

👷 Under construction since the output is currently very messy in MATLAB. An issue has recently been opened.
In the mean time, this step can be performed outside MATLAB using BIDS-validator online validation system.

Clone this wiki locally