Why is matlab removing urevent structure?
2 ビュー (過去 30 日間)
古いコメントを表示
When I load an existing data set, I am getting the following error message:
"Warning: Inconsistency between urevent (backup) and event structures, removing urevent structure"
eeg.urevent = []
I need eeg.urevent to see what trials were removed due to artifacts.
This is the code I have so far:
clear all
eeglab;
EEG = pop_loadset('/Users/Name/Desktop/Data/SubjectA.set');
The .set has some basic filters, then I extracted bin based epochs.
Thanks for your help!
0 件のコメント
回答 (1 件)
Sanju
2024 年 2 月 15 日
編集済み: Sanju
2024 年 2 月 20 日
The warning message you are seeing indicates that there is an inconsistency between the “urevent” and “event” structures in your EEG data. The “urevent” structure is typically used to store additional information about events, such as trial removal due to artifacts. In this case, the “urevent” structure is being removed, which means you won't be able to access the information about removed trials directly from “eeg.urevent”.
However, you can still access the information about removed trials by checking the “event” structure. The “event” structure contains information about all the events in your data, including the removed trials. You can use the type of field in the event structure to identify the removed trials.
you can modify the code to automatically detect the type of the removed trials. One way to do this is by iterating over the event structure and checking the unique types of events present in the data.
Here’s an example code you can refer to,
% Load the EEG data
EEG = pop_loadset('/Users/Name/Desktop/Data/SubjectA.set');
% Get the unique event types
eventTypes = unique({EEG.event.type});
% Check the event structure for removed trials
removedTrials = [];
for i = 1:length(EEG.event)
if any(strcmp(EEG.event(i).type, eventTypes))
removedTrials = [removedTrials, EEG.event(i).latency];
end
end
% Display the removed trials
disp(removedTrials);
In the above example, the code dynamically retrieves the unique event types present in the data using the unique function. Then, it checks if the type of each event matches any of the unique event types, and if so, adds the latency to the removedTrials array.
You can also refer to the below documentation links if required,
Hope this Helps!
参考
カテゴリ
Help Center および File Exchange で EEG/MEG/ECoG についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!