roiconnect icon indicating copy to clipboard operation
roiconnect copied to clipboard

pop_roi_connectplot erases EEG structure

Open amisepa opened this issue 1 year ago • 3 comments

After computing POwer and FC at source level, I try to plot with EEG = pop_roi_connectplot(EEG, 'measure', 'roipsd', 'plotcortex', 'on', 'freqrange', [8 13]);

And it gives this warning and erases everything... Warning: EEG.roi.cortex does not contain the field "Faces" required to plot surface topographies.

amisepa avatar Apr 12 '24 01:04 amisepa

You could try our test_pipes/pipeline_connectivity.m test script that uses a source model with a compatible atlas (= one that contains a Faces field).

Sorry that it erases everything though, that shouldn’t happen. Not sure if that’s a Matlab thing but we can try to make it at least not delete the whole struct. Could you please also point me to the line where this error message is triggered in the function?

nguyen-td avatar Apr 12 '24 06:04 nguyen-td

I was using 'LORETA-Talairach-BAs.mat' to compute the leadfield matrix, whereas the pipeline uses 'head_modelColin27_5003_Standard-10-5-Cap339.mat' But then pop_roi_activity uses the 'LORETA-Talairach-BAs' atlas. That's why I was using it for the field to match. Shouldn't they match?

NOte that Faces can be found in EEG.roi.leadfield.tri which may work with any atlas and avoid this issue since this is from leadfield.

amisepa avatar Apr 12 '24 20:04 amisepa

Actually it is empty with the Talairach atlas so that doesn't work. I'll just use the Colin atlas

amisepa avatar Apr 12 '24 21:04 amisepa