Events Segmentation in EEGLAB

10 visualizzazioni (ultimi 30 giorni)
Khan Muhammad Adeel Khan
Khan Muhammad Adeel Khan il 12 Apr 2021
Modificato: Prasanna il 23 Apr 2024
Hello ! I am having an EEG data from more than 100 participants and it consist of 120 events. How can I segment the events into half as I am using eeglab script to process the data ? I want to analyze the first half and second half separately. Thanking you in anticipation.

Risposte (1)

Prasanna
Prasanna il 23 Apr 2024
Modificato: Prasanna il 23 Apr 2024
Hi,
To segment and analyse the first and second halves of EEG events separately for each participant using EEGLAB, you can identify the events you want to segment around, create epochs for these events, and then divide the dataset based on these epochs. Given that you have 120 events per participant, and you wish to split these into two halves, here's a sample code for the same:
participants = dir('/path/to/your/data/*.set'); % Adjust the path and extension if necessary
for i = 1:length(participants)
filename = participants(i).name;
EEG = pop_loadset('filename', filename, 'filepath', '/path/to/your/data/');
% Segment into first half
EEG_firstHalf = pop_selectevent( EEG, 'event', [1:60], 'deleteevents', 'off', 'deleteepochs', 'on', 'invertepochs', 'off');
% Segment into second half
EEG_secondHalf = pop_selectevent( EEG, 'event', [61:120], 'deleteevents', 'off', 'deleteepochs', 'on', 'invertepochs', 'off');
% Analysis code for each half goes here
end
For more details on the pop_selectevent function you can look at the documentation provided here: https://sccn.ucsd.edu/~arno/eeglab/auto/pop_selectevent.html
Hope this helps.

Categorie

Scopri di più su EEG/MEG/ECoG in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by