Epochs with different lenghts

Hi BrainStorm forum,

Can BrainStorm handle epochs with different lengths?

I have some data were there is a stimuli present and then a reaction. I would like to extract the time between the stimuli and the reaction but as the reaction is different on each trial the epochs would have different lenghts. Is this possible in BrainStorm?

best regards,
mads

Hello,

You can define “extended events” to mark the time between the stim and the response.
To create extended events from the interface: click and drag your mouse over the time series figure, then create a new category of event and add a new event.
If you select an extended event in the “Import MEG/EEG” option window, the option “Epoch time” will not be used and epochs of different length will be imported.

There is nothing that creates those extended events for you yet, but we could work on that.
Before, I would like to make sure that this is really the way you want to proceed…
Dealing with epochs of different lengths is quite difficult: you cannot average them, you cannot load or visualize them at the same time. It could be easier for this reason to just use a fixed epoch size based on the longest time response. In the imported epochs, you would keep your “response” markers.

Let me know what you think.
Francois

1 Like

Hi Francois,

I know that epochs with different lengths has some things to consider when analysing them. I plan on making a TF transform and extract the mean from different frequency bands (e.g. alpha and beta). In essence I will analyse so that I get on value per epoch that is independent (or close to) of the time length of the epoch.

What I thought I would do was to first import the epochs based on the stimuli trigger. Then run analysis on the epochs, e.g. TF with a Morlet Wavelet, and then extract the time windows from the first trigger, i.e. time 0, until the response trigger. And then calculate the final measurement, e.g. mean value or change from start to end. Doeas that sound reasonable?

best regards,
mads

Hello
Yes, it can make sense.

I added an option for you to do that easily in the process “Events > Combine stim/response”.
By using the keyword “extend”, you can create and extend event instead of a simple event.
You can also set a maximum delay between the two events to group, to have some tolerance for errors in the stim/response structure.

Then import the extend events into your database (Import MEG/EEG). Say NO when asked if the shorter trials should be ignored.

Francois

Great, thanks Francois for adding this feature and so fast.

best,
mads