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!

回答(1 个)

Sanju
Sanju 2024-2-15
编辑:Sanju 2024-2-20
Hi @Bridget,
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!
  1 个评论
Bridget
Bridget 2024-2-15
Thank you for your thoughtful answer @Sanju!
For anyone else having this problem, I solved it by downlaoding an older version of EEGLAB (2022.1). This restored urevent.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 EEG/MEG/ECoG 的更多信息

产品


版本

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by