PSD surface view and save figures using script

Hi,

I am trying to use the script_view_source function to save figures with a script.

The sLORETA results are working well,

rst='test1.edf/@rawtest1/results_sLORETA_EEG_KERNEL_240806_1312.mat';
hFig1 = script_view_sources(rst, 'cortex');

however, the surface of the PSD results is not working.

rst='test1.edf/@rawtest1/timefreq_psd_240806_1313.mat';
hFig1 = script_view_sources(rst, 'cortex');

Is there a way to create and save the PSD resuts using a script?

Thank you for your help.

The function script_view_sources.m has been updated to plot TimeFreq (including PSD) files obtained from sources. Commit 2efa196

Update your Brainstorm instance to get this feature.
After that, the shared code should work.

You can set the displayed frequency with:

panel_freq('SetCurrentFreq', 22, 0); % To set it to 22 Hz

% Or, if the PSD is resolved in frequency bands
panel_freq('SetCurrentFreq', 2); % To set it to the Second frequency band
1 Like