pythonmatlabepochmne-python

Epoch EEG data between two events, instead of min_max seconds?


I would like to epoch my EEG data, but not based on the duration in seconds as it it commonly done, but one epoch should last the length of the stimuli presentation that is jittered. Therefore, I would like to indicate the start and end of an epoch by the beginning of the stimuli (marked by an event) and the beginning of the stimuli of the next trial (another event). (One epoch will contain other events which should stay in the epoch but not considered for the moment.)

For example I have this line of events: 104 1 2 3 4 5 105 1 2 3 4 5 103 1 2 3 4 5

And I want epochs containing the events from 104 to 105 (105 not included); then from 105 to 103 (103 not included) and 103 to the end.

Do you know if this is possible to be done in matlab (or python)?

Thank you very much :)


Solution

  • I finally changed my way of analysing, but I got this advice here: "You may want to have a look at https://www.fieldtriptoolbox.org/example/making_your_own_trialfun_for_conditional_trial_definition/."

    Maybe it can help someone else one day :)