Different Epoch length and data covariance

Hello, I am new to Brainstorm and would like to clarify some issues!

Firstly, the experiment that was run by my lab consists of different segments of interest, mainly the following: S4 for presentation of a dot (visual stimuli), S8 when the dot disappears, S16 when the correct dot position is presented, and S32 when an incorrect one is presented, and finally S64 when the participant responds. Each of the inter-stimulus length differs between each stimuli (eg, 500ms between S4 and S8, 2mins between S8 and S16 etc). Is it alright to import epochs of different lengths in that case around each segment of interest?

In addition, when it comes to computing the data covariance, due to the different epoch lengths, do i compute the data covariance for each trial separately and then merge them?

Thank you!


Processing epochs of different durations is quite complicated: you cannot average them or display them simultaneously.
But in most cases, you don’t need to have epochs of different durations. What is your question?
For instance, if you are interested in what the brain does after the second dot disappears (S16/S32), then you just need to epoch around this time, and use the same epoch length for all the conditions.

If you are interested both in the presentation of the dots and the subject response, you can import epochs for both with different epoch durations if you want. It doesn’t matter because these are epochs you won’t compare or average directly (it doesn’t make much sense to compare a visual presentation with a motor response).

What you need to do before epoching is classifying your markers before epoching so that you can import and average separately the trials where the dot position is correct vs. incorrect, or when the response of the subject is correct/incorrect. You can find many processes to help you sorting your events in the category “Events”, especially “Combine stim/response”.

For the computation of the noise covariance: use as much data as possible, but not data in the middle of the sequence of stimulation, you can use rest recordings, or the concatenation of the pre-stimulus baselines (before the presentation of the first dot).
For the data covariance: I don’t know, I don’t have much experience with this. I will try to ask if someone else can help you with this.


The simplest approach would consist in assuming non informative noise covariance, hence selecting the identity matrix option in Brainstorm. For data covariance, you may compute over all your epochs taken together. An alternative would be to use the minimum norm source estimator (MNE) in Brainstorm, which does not require the estimation of data covariance. After you obtain the MNE sources, use a standardization process such as z-score with respect to baseline.

Hey Francois and Sylvain,

Thank you for all your help! I greatly appreciate it.

Dear Sylvain,

May I further clarify that if I choose the identity matrix option in Brainstorm, would I still be able to get good results using dSPM as I read in the brainstorm tutorial that it uses the noise covariance?

Thank you and Best regards!

It's the best you can do with no information on baseline noise.
I personally have little experience with dSPM but I don't anticipate a specific issue. I would recommend you compare the dSPM outputs with the minimum-norm estimates after z-score standardization in BST. For this latter, select the entire epoch length as baseline.
If the resulting source maps are qualitatively similar, you can be more confident about the dSPM outcome.

Hello Sylvain,

I was reading your answer regarding the computation of the data covariance. Do you think it is more correct to compute data covariance over all epochs taken together (having different temporal lengths) or concatenate the epochs and compute the data covariance on the concatenated file?

Thank you.

Hi there,

This would be the same thing: in principle, data covariance could be derived by concatenating epochs of different lengths. However, Brainstorm may check for consistency of the epoch duration across trials and may halt if they are different; but you could hardcode to proceed nevertheless. The question would be rather why using epochs of different lengths in the first place?

Perfect, thank you for the answer. Usually, I use epochs of the same length. This time I wanted to select portions of the signals clean from artifacts, despite their temporal lengths. If I do not concatenate them, Brainstorm shows the temporal length of the #1 segment as automatic option when estimating the data covariance (for both Baseline and Data). Whereas with the concatenated epochs, it will show the total duration of the concatenated file in the Baseline and Data input.

I see, thanks!
I think the latter option is best then because it would use the maximum of data available to derive the best possible estimate of the covariance stats.

1 Like

When using the Process1 tab to compute the noise covariance, it shows only the time window of the first file, but you can select "All file" to use all the time available in all the input files.

If you right-click on the group of data blocks > Noise covariance > Compute from recordings, indeed, there was no option to get the full span of time points.
I fixed that, with the expense that now it needs to read all the time vectors of all the trials. The older version was faster but could lead to wrong results.

Please update Brainstorm and try again.