PLV correlation matrix

Dear Francois,

I hope you are well.

I've read a number of other threads explaining how the phase locking values are stored in brainstorm, however, I am still unsure how to extract these values.

**How would I go about getting a matrix of 68X68 containing the PLV for this participant/condition. I'd like to calculate the group average PLV across participants eventually, yielding a 68X68 matrix containing PLV values. Please let me know how to do this. I do not know what TF [2346X1X6] corresponds to. Also, I read in another thread that I might need to 1) export to matlab and 2) execute the following: "R = bst_memory(‘GetConnectMatrix’, TfMat);", however, I am not sure exactly how to do the second step (e.g., paste in command window?). **

A little more information regarding my analysis steps:
I've performed source analyses and downsampled to the DK 68 source atlas. I then computed the phase locking value (PLV) for each participant and condition. For a single participant and condition I get the following output (pasted below):

Thank you very much,

Manda Fischer

Name: Subject01/pilot1_710_ST-export-export_cor/timefreq_connectn_plv_210416_1231.mat

|
|- TF: [2346x1x6 double]
|- TFmask: []
|- Std: []
|- Comment: 'PLV: Full'
|- DataType: 'matrix'
|- Time: [-2, 2]
|- TimeBands: {'plv', -2, 2}
|- Freqs: {6x3 cell}
|- RefRowNames: {68x1 cell}
|- RowNames: {68x1 cell}
|- Measure: 'other'
|- Method: 'plv'
|- DataFile: 'Subject01/pilot1_710_ST-export-export_cor/matrix_scout_210408_1055.mat'
|- SurfaceFile: '@default_subject/tess_cortex_pial_low.mat'
|- GridLoc: []
|- GridAtlas: []
|- Atlas:
| |- Name: 'process_extract_scout'
| |- Scouts: []
|- HeadModelFile: []
|- HeadModelType: []
|- nAvg: 1
|- Leff: 1
|- ColormapType: []
|- DisplayUnits: []
|- Options:
| |- Method: 'plv'
| |- ProcessName: 'process_plv1n'
| |- TargetA: []
| |- TargetB: []
| |- Freqs: {6x3 cell}
| |- TimeWindow: [-2, 2]
| |- IgnoreBad: 0
| |- ScoutFunc: 'all'
| |- ScoutTime: 'before'
| |- RemoveMean: 1
| |- CohMeasure: 'mscohere'
| |- MaxFreqRes: []
| |- MaxFreq: []
| |- CohOverlap: 0.5
| |- GrangerOrder: 10
| |- GrangerDir: 'out'
| |- RemoveEvoked: 0
| |- isMirror: 0
| |- PlvMeasure: 'magnitude'
| |- isSymmetric: 1
| |- pThresh: 0.05
| |- OutputMode: 'input'
| |- iOutputStudy: []
| |- isSave: 1
| |- isScoutA: 0
| |- isScoutB: 0
| |- sScoutsA: []
| |- sScoutsB: []
|- History: {'16-Apr-2021 12:31:19', 'compute', 'Connectivity measure: plv (see the field "Options" for input parameters)'}

Compute the PLV results in Brainstorm, and average them in Brainstorm.
You don't need to go in the details of the storage of the files for that.

Also, I read in another thread that I might need to 1) export to matlab and 2) execute the following: "R = bst_memory(‘GetConnectMatrix’, TfMat);", however, I am not sure exactly how to do the second step (e.g., paste in command window?)

Copy-paste in the command window, or use in a Matlab script.
If you are expecting to do some scripting in Brainstorm, start by reading the Scripting tutorial:
https://neuroimage.usc.edu/brainstorm/Tutorials/Scripting

Note that you need to be confident with your Matlab scripting skills before writing Matlab scripts. If this is not the case, start by following Matlab programming tutorials.

I've performed source analyses and downsampled to the DK 68 source atlas

This is not recommended.
Compute the connectivity measures directly from the source files, just like you would do with time-frequency analysis:
https://neuroimage.usc.edu/brainstorm/Tutorials/TimeFrequency#Scouts

Hello Francois,

Thank you very much for your prompt reply. The response is very helpful.
I just have a few clarification questions.

  1. To clarify, when you say that "this is not recommended", do you mean that it is better to calculate the coherence NxN directly on the sLoretta source (before downsampling to atlas)?

If yes, I tried this but encounter an error:

Please let me know what the issue might be.

  1. Also, when would be possible to downsample to the DK atlas, if it is not recommended to do it before calculating coherence?

  2. Finally, I tried exporting the PLV results to MATLAB and executing the command in the command window, but got the following error:
    >> R = bst_memory(‘GetConnectMatrix’, TfMat);
    ** R = bst_memory(‘GetConnectMatrix’, TfMat);**
    ** ↑**
    Error: Invalid text character. Check for unsupported symbol, invisible
    character, or pasting of non-ASCII characters.

Please advise.

Thank you very much for all your help,

Manda

Do not use the process "downsample to atlas" at all. Instead, use the capability of the connectivity processes to compute directly the scouts time series on the fly.

If you get this, it is because you have select the option "scout function: after": it first computes the connectivity for all the pairs of sources (15000x15000) within all the scouts, and then groups them (typically by averaging them) to obtain only one value for each pair of scouts (68x68). This would need to create matrices that are too large to fit in memory (and would take hours or days to compute).

Selecting the option "scout function: before" does something more similar to what you do with your downsampling: first compute the scouts time series and then the connectivity measure. This is much lighter in terms of memory usage and computation time, but averaging many source signals over large and very inhomogenous regions (such as the ones of the DK atlas) include high risks of destroying the information you are interested in (the fine temporal dynamics of each signal).

Computing full brain connectivity graphs based on anatomical atlases is not something for which we have clear recommendations to share yet.
@Raymundo.Cassani @hossein27en @tmedani @Sylvain Could you include this topic in your new connectivity tutorial? This is a recurrent question, and we still have no clear answer to give.

@mfischer
My advice for the moment would be for you to restrict your analysis to the ROIs involved in your hypothesis. Make sure you use relatively focal anatomical regions, with a similar number of vertices. In that case you will be able to use both the before and after options and compare the results.
Do not compare the connectivity values between regions, but only for a given region between experimental conditions or groups of participants.

Finally, I tried exporting the PLV results to MATLAB and executing the command in the command window, but got the following error

As I recommended before: Start with generic Matlab tutorials, and the Brainstorm tutorial about Scripting.