PTE: How is the connectivity matrix stored?

I computed NxN PTE from 100 surface scouts. When I export the connectivity matrix to matlab, I don’t get a connectivity matrix, but instead a 10000x1 vector (TF). This vector can be reshaped easily to regain the connectivity matrix. However, since PTE is a directed measure of connectivity, the matrix is not mirrorsymmetric. Therefore, I would like to know the organisation of the TF vector.

Is it:
SeedA - TargetA
SeedA - TargetB

SeedA - TargetZ
SeedB - TargetA

or rather
SeedA - TargetA
SeedB - TargetA
SeedC - TargetA

Thanks a lot!

1 Like

Hi Sebastian,

To get the connectivity matrix correctly formatted, you can do the following:

  • Read the file timefreq_connect…mat into the variable TfMat, or right-click > File > Export to Matlab > “TfMat”
  • R = bst_memory(‘GetConnectMatrix’, TfMat);
  • The matrix R is the connectivity matrix [signalsA x signalsB x Frequencies]
  • The frequency bins are described in the TfMat.Freqs: R(:,:,1) is frequency TfMat.Freqs(1)

For details on the algorithm, see directly the process function process_compress_sym.m


Another question about PTE data. Is the phase-lag variable stored somewhere in the .mat file or just the PTE values?


Only the PTE data.
You can check how this is done directly in the code: