Hello,
I am presenting this paper Friday, and would like to present some additional figure not present in the original article. The author shared their connectivity map estimated using wPLI. https://figshare.com/s/a3f3f7c95d60cb48c295?file=47381569
I am able to visualize the connectivity matrix in matlab:
How can i import this in Brainstorm ?
i know the connectivity matrix (ROi x ROI) is stored in R = sData.new_results.eeg.noIED.beta.wpli; and that the labels for the ROI are in sData.new_results.eeg.labels
Summary
i tried this, but the file cant be displayed in Brainstorm:
FileMat = db_template('timefreqmat');
FileMat.Atlas = db_template('atlas');
FileMat.Atlas.Name = 'Desikan-Killiany';
% Reshape: [nA x nB x nTime x nFreq] => [nA*nB x nTime x nFreq]
FileMat.TF = process_compress_sym('Compress', sData.new_results.eeg.noIED.beta.wpli(:));
FileMat.DisplayUnits = 'Weighted phase lag index';
FileMat.Comment = 'wppli - beta';
FileMat.RefRowNames = sData.new_results.eeg.labels;
FileMat.RowNames = sData.new_results.eeg.labels;
FileMat.DataType = 'data';
FileMat.Method = 'corr';
FileMat.DataFile = [];
FileMat.nAvg = 1;
Update 1:
Summary
with the following code, i can see the matrix in Brainstorm:
sSubject = bst_get('Subject', 'Subject01');
sCortex = in_tess_bst(sSubject.Surface(sSubject.iCortex).FileName);
Atlas = sCortex.Atlas(strcmp({sCortex.Atlas.Name}, 'Desikan-Killiany'));
FileMat = db_template('timefreqmat');
FileMat.Atlas = db_template('atlas');
FileMat.Atlas.Name = 'Desikan-Killiany';
% Reshape: [nA x nB x nTime x nFreq] => [nA*nB x nTime x nFreq]
FileMat.TF = process_compress_sym('Compress', sData.new_results.eeg.noIED.beta.wpli(:));
FileMat.DisplayUnits = 'Weighted phase lag index';
FileMat.Comment = 'wppli - beta';
FileMat.RefRowNames = sData.new_results.eeg.labels;
FileMat.RowNames = sData.new_results.eeg.labels;
FileMat.DataType = 'data';
FileMat.Method = 'corr';
FileMat.DataFile = [];
FileMat.nAvg = 1;
FileMat.Time = [1];
FileMat.ProcessName = '';
FileMat.Options = bst_connectivity();
But i cant visualize the graph:
Unable to perform assignment because the left and right sides have a different number of elements.
Error in figure_connect>LoadFigurePlot (line 1223)
SelChan(iRow) = find(strcmpi({GlobalData.DataSet(iDS).Channel.Name}, RowNames{iRow}));
Error in figure_connect (line 29)
eval(macro_method);
Error in view_connect (line 284)
figure_connect('LoadFigurePlot', hFig);
Error in tree_callbacks>@(h,ev)view_connect(filenameRelative,'GraphFull') (line 2078)
gui_component('MenuItem', jPopup, [], 'Display as graph [NxN]', IconLoader.ICON_CONNECTN, [], @(h,ev)view_connect(filenameRelative, 'GraphFull'));
Update 2: The followinf code is working:
FileMat = db_template('timefreqmat');
FileMat.Atlas = db_template('atlas');
FileMat.Atlas.Scouts =repmat(db_template('scout'), 1, 72);
ColorTable = panel_scout('GetScoutsColorTable');
for i = 1:72
FileMat.Atlas.Scouts(i).Label = sData.new_results.eeg.labels(i);
iColor = mod(i-1, length(ColorTable)) + 1;
FileMat.Atlas.Scouts(i).Color = ColorTable(iColor,:);
end
FileMat.Atlas.Name = 'Desikan-Killiany';
% Reshape: [nA x nB x nTime x nFreq] => [nA*nB x nTime x nFreq]
FileMat.TF = process_compress_sym('Compress', sData.new_results.eeg.noIED.beta.wpli(:));
FileMat.DisplayUnits = 'Weighted phase lag index';
FileMat.Comment = 'wppli - beta';
FileMat.RefRowNames = sData.new_results.eeg.labels;
FileMat.RowNames = sData.new_results.eeg.labels;
FileMat.DataType = 'results';
FileMat.Method = 'corr';
FileMat.DataFile = [];
FileMat.nAvg = 1;
FileMat.Time = [1];
FileMat.ProcessName = '';
FileMat.Options = bst_connectivity();
Is there a way to have the region nicely organized ? (eg, left vs right and lobes..)
Thanks a lot
Edouard










