[Eeglablist] Trouble with std_erspplot output
Raval, Vyom Manish
Vyom.Raval at utdallas.edu
Sat Mar 7 15:10:10 PST 2020
Dear eeglablist,
I'm trying to extract numeric time-frequency data for multiple time ranges using the std_erspplot function. However, the erspdata output cell array's elements are not of size [freqs x times x subjects] as indicated in the documentation. They are instead of size [1 x channels x subjects]. I can still get the desired data for the specified time and frequency ranges, but I need to loop over the different time ranges and this takes a long time as I have a large study.
Is there a way to speed up this process, either by getting the correct [freqs x times x subjects] output or making sure that the saved ersp data does not have to be read from disk each time I call std_erspplot (which I suspect is why it takes so long)?
Any help would be amazing. Below is the snippet of code I am using:
% Time and frequency range
arrTimeRange = [0 4000];
arrFreqRange = [4 8];
nWindowSize = 50;
% Ensure that this has no repeats and each electrode is
% typed correctly with no spaces. eg- 'C1'
cElecs = {'FP1', 'Fpz','FP2','Af3','af4','f7','f5','f3','f1','fz','f2', ...
'f4','f6','f8','fc5','fc3','fc1','fcz','fc2','fc4','fc6'};
% Loop over time ranges
for nStart = arrTimeRange(1):nWindowSize:arrTimeRange(2)
arrTimeRangeToPlot = [nStart nStart + nWindowSize];
%Compute ersp with std_erspplot
STUDY = pop_statparams(STUDY, 'groupstats','on','condstats','on',...
'naccu',1000,'method','perm','alpha',0.05);
STUDY = pop_erspparams(STUDY, 'topotime', arrTimeRangeToPlot,'topofreq', arrFreqRange);
[STUDY erspdata ersptimes erspfreqs pgroup pcond pinter] = std_erspplot(STUDY,...
ALLEEG, 'channels', cElecs);
% ... saving numerical data ... %
end
Thank you!
Best,
Vyom
More information about the eeglablist
mailing list