how to visualize the EEG functional connectivity data with circularGraph?

Hi everyone,
Currently I have completed the functional connection analysis of my EEG data. PLI was calculated among the 32 channels for 22 subjects with 2 conditions. the difference of PLI between 2 conditions was tested using NBS. my script for visualization is attached to this post, which is not pretty and clear. So I want to display the functional connectivity data and significant stats with circularGraph.m to get the graph like the below one.
I have read the documentation for circularGraph.m(https://github.com/paul-kassebaum-mathworks/circularGraph/tree/master), but there are still many errors that I can't handle. Have anyone used this function to visualize the EEG functional connectivity data and stats? could you please help me modify the attached script with circularGraph.m?
Thanks in advance.
Elaine

 Réponse acceptée

See if your issues have been addressed among the 36 existing Discussions on the File Exchange page, here (click the discussions tab). Start a new discussion, if necessary.
Or
Raise the issue on github, here: click the green "New Issue" button and enter your question.

5 commentaires

I downlopaded your script and function, and ran the script. I cannot answer the questions the script asks, because I don't have all the necessary data files and folders and toolboxes. Therefore I cannot observe the errors which you said you get.
Your question is specifically about making a circular connectivity plot. I recommend that you separate the analysis and plotting tasks into separate scripts. I assume, based on your question, that the analysis part runs. The analysis script should save the connectivity results in a file of the appropriate format. Post the results file and the script for plotting (which will read the data from the results file) in this thread, along with the error messages. Then we may make some progress.
You asked for help using circularGraph(), and you said you were getting a lot of errors. I assumed you meant you were getting errors when you tried to use circularGraph(). But I assumed wrongly. Your script calls topoplot_connect(), which is from a different File Exchange submission by a different author. Your script does not call circularGraph().
The code below makes simulated PLI data and uses circularGraph to make a plot like the one you requested. As you know, the PLI data for a 32-electrode data set is a symmetric 32x32 array, with zeros on the diagonal, and other values between 0 and +1. You will use the PLI data you have computed.
I have attached the functions from circularGraph on the File Exchange.
N=32; % number of electrodes
a=triu(rand(N),1);
pli=a+a'; % simulated PLI data
Electrode labels, for the plot:
myLabels={'F8', 'FC5','FC1','FC2','FC6','M1', 'T7', 'C3',...
'Cz', 'C4', 'T8', 'M2', 'CP5','CP1','CP2','CP6',...
'P7', 'P3', 'Pz', 'P4', 'P8', 'POz','O1', 'Oz',...
'O2', 'Fp1','Fpz','Fp2','F7', 'F3', 'Fz', 'F4'};
Make the circular graph:
circularGraph(pli,'Label',myLabels);
The plot above is a completely-connected circular plot, because there is a non-zero value for every pair of points. There seems to be a bug for connected points around 5 to 6 o'clock on the circle. To make it more interesting, let's only plot the connections where PLI exceeds a threshold.
thresh=0.95;
pli1=pli.*(pli>thresh);
figure
circularGraph(pli1,'Label',myLabels);
This plot looks like the example plot in your original request.
It works! Although similar bug occurs, it is resolved by setting a specific threshold for plotting.
I really appreciate your help and time! Thank you sooooo much!
@Elaine, you're welcome. Good luck with your research. You can accept the answer if you wish.
Accepted! Thanks again for your kind help and support.

Connectez-vous pour commenter.

Plus de réponses (0)

Produits

Version

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by