Create events/annotations on EEGLAB?

18 ビュー (過去 30 日間)
Maanasi Garg
Maanasi Garg 2016 年 10 月 4 日
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.

採用された回答

Aylin
Aylin 2016 年 10 月 14 日
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 件のコメント
Itaf BEN SLIMEN
Itaf BEN SLIMEN 2018 年 6 月 20 日
please have you a solution for this problem !! i can't open the file .edf.seizures !!
Vinay Elkoori Ghantala Karnam
Vinay Elkoori Ghantala Karnam 2020 年 2 月 6 日
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?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeEEG/MEG/ECoG についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by