Concatenating coherence matrices

Hi all,

Hope you can help,
I have 300 individual coherence matrices (600sec in 2sec epochs).
Is there some way to concatenate them all into a single data structure for convenient export?

Many thanks!

-Tom.

Hi Tom,

Note that it might be more meaningful to concatenate your epochs in time first before computing the coherence in order to get a single matrix over the whole time period, depending on what you're trying to do here.

Can you clarify how you would like to concatenate the matrices and what type of export you have in mind? One way to do this would be to use the Standardize -> Concatenate signals process. You won't be able to manipulate the resulting object in Brainstorm since its dimensions will not be valid anymore, but you can export it to Matlab and all your connectivity matrices will have been concatenated in the first dimension of the TF field.

Let us know,
Martin

Hi Martin,

Many thanks for your reply.

So concatenation is complete.

One question though, just for the sake of example, if I extract one of these imaginary coherence matrices (before 2019 algorithm; 68x68) I get a data structure 2346x1x30.

I understand this is the upper triangular part, however, why are there 30 frequency components? How do I get the structure I see in brainstorm when I select 'display as image'.

I see now the image displayed in brainstorm is the first frequency component.

So when you calculate coherence you have a choice of frequency resolution (2Hz) and highest frequency of interest (60Hz). I only want to find coherence in alpha band. Do I average in the 2Hz frequency bins corresponding to alpha 8-12Hz?

Thanks!

-Tom.

PTE: How is the connectivity matrix stored?
How the Corr matix is saved? - #2 by Francois

I understand this is the upper triangular part, however, why are there 30 frequency components?

This is combined result of the options you selected and the sampling frequency of your signals:

  • frequency resolution: defines the duration of the estimator window used for the FFT,
  • highest frequency of interest: cuts anything above a given threshold after computation for display purposes)

I see now the image displayed in brainstorm is the first frequency component.

You have a slider in the brainstorm window to see the other frequencies

I only want to find coherence in alpha band. Do I average in the 2Hz frequency bins corresponding to alpha 8-12Hz?

Yes, you can do this with the process "Frequency > Group in time of frequency bands" or "Extract > Extract values".

https://neuroimage.usc.edu/brainstorm/Tutorials/Connectivity#Coherence_.28FFT-based.29

Many thanks Francois!