-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EEG.event is empty after calling clean_artifact with channels_ignore #837
Comments
Apologies for the late response. I do not see the same code on the lines you mentioned. https://github.com/sccn/clean_rawdata/blob/master/clean_artifacts.m I am having a hard time understanding the issue. Is your issue that your events are numerical and this section of the code is not called? |
Hi Arnaud! Thanks for looking into this. Say I have an EEG structure with events, and the online reference channel is labeled as '5Z.' I want to remove noisy channels using the following line of code while making sure that '5Z' is ignored (i.e., not get removed).
However, when I run this code, the returned EEG structure has an empty EEG.event field, and the channel '5Z' is removed. I would have expected that including 'channels_ignore', {'5Z'} was to retain that channel. If I call the function without including 'channels_ignore', {'5Z'} as an input, the EEG.event struct keeps its initial events. ‘5Z’ gets removed regardless.
I will send you an example .set file where this issue occurs. |
OK, that makes sense. Let me look into that. |
Note for self: data downloaded in bug837 folder. |
Description
[EEG.event returns empty when calling clean_artifacts() with channels_ignore]
On line 225 (+/- 1) of clean_artifacts function, EEG.event is emptied (EEG.event = []).
It appears that Events get added back only if EEG = oriEEG gets called on line 345. However, line 345 only gets called if line 322
~isempty(EEG.event) && isfield(EEG.event, 'type') && isstr(EEG.event(1).type)
is true. In situations where there is no event added to EEG between line 225 and line 322, then the original events never get added back.#### Steps to Reproduce
EEG = pop_clean_rawdata(EEG, ...
'FlatlineCriterion',5,'ChannelCriterion',0.7, ...
'LineNoiseCriterion',4,'Highpass','off', ...
'BurstCriterion','off','WindowCriterion','off', ...
'BurstRejection','off','Distance','Euclidian', ...
'channels_ignore',{'5Z'},'fusechanrej',1)
#### Expected behavior:
EEG.event should be the same as what was passed into pop_clean_rawdata. I assume the ignored channel will also be placed back.
#### Actual behavior:
EEG.event is empty and the channel that was ignored never got placed back.
#### Versions
The text was updated successfully, but these errors were encountered: