Visualize Connectivity matrix using imagesc

Hi,

I want to visualize the correlation matrix using the Matlab command "imagesc".
But, the matrix exported from Brainstorm to Matlab is a somewhat different matrix to visualize N x N matrix.
Here I am having
TF: [36856×1×100 double]
36856 indicates ch information
100 indicates frequency information from 1Hz to 100Hz.
The number of MEG channels is 271.
How can I visualize the 271x271 matrix at Frequency f.

conn =

struct with fields:

``````           TF: [36856×1×100 double]
Std: []
DataType: 'data'
Time: 315
TimeBands: []
Freqs: [100×1 double]
RefRowNames: {1×271 cell}
RowNames: {1×271 cell}
Measure: 'other'
Method: 'henv'
DataFile: ''
SurfaceFile: ''
GridLoc: []
GridAtlas: []
Atlas: []
nAvg: 30
Leff: 1
ColormapType: []
DisplayUnits: []
Options: [1×1 struct]
``````

The connectivity matrix (`TF` field) is saved as: ` [Nr x Ntime x Nfreq]`.
`Nr` represents the connectivity between two files, thus `Na x Nb`. However, the relation between `Na x Nb` and Nr may not be direct as it's optimized to save storage space for some connectivity metrics.
https://neuroimage.usc.edu/brainstorm/Tutorials/Connectivity#On_the_hard_drive

E.g. in correlation, as corr(a,b) == corr(b,a) only one value is saved. In your case 271*271 = 73441 elements; then the upper triangle of the connectivity matrix (36585 elements) plus the diagonal (271 elements) are saved, giving 36856 elements.

You can retrieve the connectivity matrix in the shape: `[Na x Nb x Ntime x Nfreq]` by using:

``````R = bst_memory('GetConnectMatrix', conn);
``````

Best,
Raymundo

Hi, Raymundo,

I could reshape TF: [36856×1×100 double] using bst_memory and visualize the connectivity matrix by Matlab command.

Thanks a lot!

Hi,
I want to get each connectivity scout label from the exported connectivity structure from Brainstorm to Matlab.
Could you let me know how I can get all the combinations of scout labels (6328 scout x scout labels) from the below information?

struct with fields:

``````           TF: [6328×1×100 double]
Std: []
DataType: 'matrix'
Time: 15
TimeBands: []
Freqs: [100×1 double]
RefRowNames: {1×112 cell}
RowNames: {1×112 cell}
Measure: 'other'
Method: 'henv'
DataFile: ''
SurfaceFile: ''
GridLoc: [11602×3 double]
GridAtlas: []
Atlas: [1×1 struct]
The labels for rows and columns are `RefRowNames` and `RowNames`.