[Eeglablist] Removing event manually
Dan Kleinman
kleinman at gmail.com
Fri Oct 23 10:12:13 PDT 2020
Dear Martin,
If you want to remove boundary events entirely, this can be accomplished more efficiently (and, more importantly, with less potential for error) with a single line of code:
EEG.event = EEG.event(~strcmp({EEG.event.type},'boundary’));
That replaces the entire event list with the subset of events that are not boundary events.
This will not ‘damage’ your dataset in that the underlying EEG data will remain intact since you are only editing the event list. However, I should note that boundary events are useful markers when performing operations like filtering (not a good idea to filter across non-continuous segments of EEG) and epoching (you won’t want to retain an epoch that contains a boundary event). As such, I find it’s best to leave them in the event list. But if these situations don’t apply to you, perhaps because all of your boundary events exist only in segments of the data that would be discarded anyway during epoching, it shouldn’t cause problems.
Best,
Dan Kleinman
—
Daniel Kleinman, Ph.D.
Research Scientist
Haskins Laboratories
> On Oct 22, 2020, at 7:57 AM, Martin Simoneau <Martin.Simoneau at kin.ulaval.ca> wrote:
>
> Dear EEGlab users,
>
> I want to remove events manually. Here is my MATLAB script. I want to make sure that this is not going to mess up my dataset.
>
> listDINs = {EEG.event.type};
> % remove boundary, for example
> for n = 1:length(listDINs)
> if strcmp(EEG.event(n).type),'boundary')
> EEG.event(n).type = [];
> EEG.event(n).description = [];
> EEG.event(n).begintime = [];
> EEG.event(n).classid = [];
> EEG.event(n).code = [];
> EEG.event(n).duration = [];
> EEG.event(n).label = [];
> EEG.event(n).relativebegintime = [];
> EEG.event(n).sourcedevice = [];
> EEG.event(n).name = [];
> EEG.event(n).tracktype = [];
> EEG.event(n).latency = [];
> EEG.event(n).mffkeys = [];
> EEG.event(n).mffkeys_gidx = [];
> EEG.event(n).mffkeys_cidx = [];
> EEG.event(n).mffkeysbackup = [];
> end
> end
>
> I am sure it is necessary to set all fields to []; otherwise, it should be confusing for EEGlab to sort things out. However, I want to make sure that this script will not cause any damage to my dataset.
>
>
> Thanks for your help,
>
> Martin
>
>
>
> Martin Simoneau, PhD
> Professeur | Professor
> Faculté de médecine - Département de kinésiologie
> 2300, rue de la Terrasse (PEPS)
> Université Laval
> Québec, (Qc) Canada
> G1V 0A6
>
> Chercheur | Researcher
> Centre interdisciplinaire de recherche en réadaptation et intégration sociale (CIRRIS)
> 525 boul. Wilfrid-Hamel, Québec (Qc), Canada, G1M 2S8
>
> _______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.ucsd.edu
> For digest mode, send an email with the subject "set digest mime" to eeglablist-request at sccn.ucsd.edu
More information about the eeglablist
mailing list