Skip to content

A_merge_sets

Douwe Horsthuis edited this page Feb 21, 2024 · 3 revisions

In this script EEGlab will look for all the raw EEG files for all the IDs you enter. Even if you only have one file per participant, you need to run them through this script, because you end up with .set files that have the EEGlab structure in them. Besides, defining the home/save path, you can choose how many blocks (or .BDF files) your participants have. Normally everyone does the same amount of blocks so this would be the same for everyone, but if not, you need to run that participant separately.

It is critical that you know what files you load, this means that it's probably a good idea to first read the readme files or other information you have of each participant. This is the place where everything becomes one big file, so it is significantly more difficult to get rid of data that shouldn't be used to begin with.

You can optionally choose to pause after reading in the first file if it's uncommon that there are multiple files. This will cause a pause in reading in the following file, to give you time to figure it out. After that hit a key while selecting the Matlab command console should continue everything.

Optional files:

  1. Highly recommended to load readme files. In our lab we used to format these in a standard way, which allows us to read them here and add them to the EEG files. This is excelent for quality control. Which we will do by building dashboards per participant.

  2. EDF files, or eyetracking files. The script comes with a function that will create an average gaze map per participant, combing all EDF files it can find in the participant folder. These become PNG files. They can be used for the dashboard, or simply visually inspected to see if the participant was looking where they should.

Note: we used to re-reference the data here (to the mastoids most of the time), but after realizing that it's impossible to spot flat channels after this we pushed this to later in the script.

These are the variables to change:

subject_list = {'Participant_1_ID' 'Participant_2_ID'};
home_path    = 'C:\Users\whereisyourdata\'; 
save_path    = 'D:\wheretosaveyourdatat\';  
readme_file  ='yes or no'; 
eye_tracking ='yes or no';
Pausing_yn='yes or no';

Special note for save_path; If you set this to a general folder, individual subject folders with the ID will be created so that everyone's data is in their own folder.

10/14/2022 update We added some quality control functions here. Both are 100% optional they will be used if the following variable are 'yes':

readme_file  ='yes';
eye_tracking ='yes';

These functions come originally from this project that we created to test the data while one collects it. They are also explained in-dept in the readme file there.

In short: The readme_to_EEG function searches for a readme file (.txt file) that we use in our lab to describe data collection. - this function can be addapted but currently is functioning only for the template of the readme files we use in our lab The edf_to_figure function uses edf files created by our eye-tracker (sr-research eyelink 1000plus) and creates a gaze plot so you can see where the participant looked throughout the experiment.

Back to the home page
Back to the Getting started page
To the Ba_cleaning_optional page

Clone this wiki locally