[Eeglablist] newtimef

Malte Anders malteanders at gmail.com
Thu Oct 21 08:45:48 PDT 2021


Dear Sara,

please find my quick and dirty script attached to extract ERSP and ITC
matrices from .set EEGLAB data. You might want to alter the settings in the
newtimef-function to fit your specific case - its tailored to extract 200
frequencies at 400 timepoints at electrode 16 from the data. "times" is the
timevector and "freqs" the frequency vector where you can extract specific
time- and frequency-windows from.  'plotitc' , 'off', 'plotersp', 'off',
'plotphase', 'off turns the plotting option off.

Best,
Malte

clear all
ersp_average = struct();
itc_average = struct();

popfile = 'eeg_data.set'
popfolder = 'C:\\EEG_DATA\\final_new_average';
count_buf = 1;
for index = [1:26 101:112 201 202 204:215]
[ALLEEG EEG CURRENTSET ALLCOM] = eeglab;
indexnum = int2str(index)
EEG = pop_loadset('filename',popfile,'filepath',[popfolder '\\' indexnum
'\\']);
[ALLEEG, EEG, CURRENTSET] = eeg_store( ALLEEG, EEG, 0 );
[ersp,itc,powbase,times,freqs,erspboot,itcboot,tfdata] = newtimef(
EEG.data(16,:,:), EEG.pnts, [-1000  1996], 256, [3         0.8] ,
'topovec', 16, 'elocs', EEG.chanlocs, 'chaninfo', EEG.chaninfo, 'caption',
'Cz', 'baseline',[0],'nfreqs', 200, 'freqs', [3 100], 'plotitc' , 'off',
'plotersp', 'off', 'plotphase', 'off', 'ntimesout', 400, 'padratio', 1);
ersp_average.oc_pinprick_normal(:,:,count_buf) = ersp;
itc_average.oc_pinprick_normal(:,:,count_buf) = itc;
count_buf = count_buf + 1;
clear ALLCOM ALLEEG CURRENTSET CURRENTSTUDY EEG eeglabUpdater globalvars
LASTCOM PLUGINLIST STUDY ersp itc powbase
end
clear count_buf erspboot index indexnum itcboot popfile popfolder tfdata

Am Do., 21. Okt. 2021 um 17:18 Uhr schrieb Sara Kamali via eeglablist <
eeglablist at sccn.ucsd.edu>:

>
> Dear all,
>
>
> Is there any command to get the matrix of ERSP values of a channel on
> specific frequencies?
> With pop_newtimef the poping plot makes my code slow, and I do not
> need the plot.
>
> Best,
> Sara
>
> _______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to
> eeglablist-unsubscribe at sccn.ucsd.edu
> For digest mode, send an email with the subject "set digest mime" to
> eeglablist-request at sccn.ucsd.edu
>


-- 
Mit freundlichen Grüßen,

Malte Anders


More information about the eeglablist mailing list