[Eeglablist] Extracting epochs with variable time-length

Tarik S Bel-Bahar tarikbelbahar at gmail.com
Thu Sep 15 14:37:11 PDT 2016


Hello Martin, some thoughts below. Best wishes.





*******************************************
Overall having different epoch lengths is unusual and requires you use a
non-traditional strategy. See below for some suggestions about that.
If you haven't had a chance to, try googling  "eeglablist _ your topic"
such as "eeglablist list epoching" or "eeglablist triggers/markers".  or
"eeglablist different length epochs"

***********************************************

Yes I don't think that eeglab allows epochs of different lengths for it's
functions, at single-subject and at Study level. So you may want to decide
on a common event across trials, such as a stimulus or feedback onset, and
cut the epochs to be a similar length relative to one of those events. With
pop_epoch I think you are limited to same-length epochs. To generate
single-subject averages across individual epochs, one traditionally needs a
common event in each trial, and a common trial length. Same for all-subject
grand-averages. You may have to figure out some alignment strategy
regardless of whether your epochs are same or different lengths. your best
best is to follow the strategy published by EEG researchers for a similar
paradigm and problem, in a good journal.

One option might be to save out ALL the EPOCHS that HAVE THE SAME LENGTH as
unique trials in a unique subject file, and then do the same for other
different length epochs. This assumes you have a few major classes of epoch
length. Alternatively, each epoch could be saved out independently and
analyzed at single-trial level, but you would  have to align them somehow
for any averaging across epochs. Technically, you could estimate an EEG
metric for each different length epoch, and then average those metrics, but
this is unusual, as the single-epoch data is the same time length in usual
EEG analyses.


********************to modify events before epoching

You can edit the events one by one from the gui, or use eegh, after doing
some from the gui, in order to repeat that process in a script. Then epoch.

You can create a matlab loop that looks at each event (and it's context)
and then adds new events. Examine the online eeglab tutorial about event
structures in eeglab. You would want to make a set of rules that creates a
new set of events for you to use.

See previous eeglablist posts or google the documentation for an eeglab
function called eeg_addnewevents, or something like that, and similar
discussions of dealing with events. This should allow you to create a set
of labels and times, and then apply them , in one function call to a
continuous file (via the aforementioned add new events function, or some
other similar method). Then you should be able to epoch on the events of
your choice.
Another way to do it is to "import" a list of new/additional events. See
the eeglab tutorials/pages on events, events structure, and importing
events.

​***Not sure if this directly related to your question, but perhaps it will
help:: You could also build a loop that checks for some conditions in the
event sequence before the loop creates one or more epochs in a new file
with pop_epoch.​

​So in this case, your loop would pop_epoch only if the event in the
continuous file has the correct conditions (events before and after it)
that you are seeking.​ Then your loop would reload the original file, go to
the next set of events, and decide again whether or not to epoch.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20160915/144e5003/attachment.html>


More information about the eeglablist mailing list