Create events/annotations on EEGLAB?

14 visualizaciones (últimos 30 días)
Maanasi Garg
Maanasi Garg el 4 de Oct. de 2016
Can I manually create events/annotations in .set EEG files on EEGLAB without previously importing epoch info or event info? The EEGs which I want to analyze with EEGLAB have files with respective event annotations, but those files are in .edf.seizures format, which I can't figure out how to open on EEGLAB.

Respuesta aceptada

Aylin
Aylin el 14 de Oct. de 2016
Hello Maanasi,
I understand that you want to import ‘ .edf.seizures ’ files into MATLAB for processing by EEGLAB. Please refer to the EEGLAB documentation for more information:
Since ‘ .edf.seizures ’ seems to be a non-standard file format, it is possible to write your own MATLAB function to import event annotations from these files. The following MATLAB Answers page provides more information about this:
Building on the above answer, assuming that you want to read more than one seizure event, you can use the following MATLAB function:
function [ number_of_seizures, seizure_start_time_offsets, seizure_lengths ] = get_seizure_periods( annotation_file_location )
file_descriptor = fopen(annotation_file_location);
byte_array = fread(file_descriptor);
number_of_seizures = (sum(byte_array == hex2dec('ec')) - 1) / 2;
for i=1:number_of_seizures
seizure_start_time_offsets(i) = bin2dec(strcat(dec2bin(byte_array(23 + (i*16))),dec2bin(byte_array(26 + (i*16)))));
seizure_lengths(i) = byte_array(34 + (i*16));
end
end
The above function provides the number of seizure events, the seizure start time offsets (from the previous event), and the duration of the seizures. In the above function, I have assumed that the seizure data stays at the same byte positions in each ‘ .edf.seizures ’ file. I also used the publicly-available ‘ .edf.seizures ’ data from the CHB-MIT Scalp EEG Database to test the above function:
If you are getting your ‘ .edf.seizures ’ files from a different source, you may want to write your own data import function. Also, since EEGLAB may want the data in the form of a matrix, you may want to reshape the above arrays into a matrix before importing it into EEGLAB.
In order to import this data from the MATLAB workspace into EEGLAB, you might want to use the “Import Epoch Info” feature of EEGLAB. Please refer to the EEGLAB documentation for more information about importing epoch information:
  3 comentarios
Itaf BEN SLIMEN
Itaf BEN SLIMEN el 20 de Jun. de 2018
please have you a solution for this problem !! i can't open the file .edf.seizures !!
Vinay Elkoori Ghantala Karnam
Vinay Elkoori Ghantala Karnam el 6 de Feb. de 2020
Hi, I tried using your snippet but looks like it does not return the righ value for all the annotation files. Ex:chb04_28 has two annotations. The first one is returned correctly at 1679sec but the second one is returned incorrectly as 2001sec which should be 3782sec according to the summary file of the patient chb04. Could you please look into this matter?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre EEG/MEG/ECoG en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by