[Eeglablist] Generating Wave graphs using EEGLAB
Suzan Tokac (HDR)
suzan.tokac at hdr.mq.edu.au
Fri Jul 10 04:38:18 PDT 2020
Hello all,
I am analyzing my ERP data (linguistics stimuli - sentence reading-violation paradigm) and want to generate waveform graphs.
I have two condition levels (direct vs indirect and 2 grammaticality levels (grammatical vs ungrammatical). The graphs should be generated for the duration of -0.2 trigger onset till 1 second for 9 separate regions of interest (MA-Midline Anterior, MC Midline Central,LP-Left Posterior, etc.).
I am using the following MATLAB code but I would like to be able to do it via EEGLAB GUI. Can you please guide me on how to do it? I couldn't manage it using the wiki page explanations. I use the 2019 version (it's different than the ones on the website)
Thank you in advance.
ROIs = {LA;MA;RA;LC;MC;RC;LP;MP;RP};
ROIs_names = {'LA','MA','RA','LC','MC','RC','LP','MP','RP'};
load('allsubs.mat')
cfg = [];
cfg.channel = 'all';
cfg.latency = 'all';
cfg.parameter = 'avg';
cfg.keepindividual = 'no';
cond_1 = ft_timelockgrandaverage(cfg,allsubs.trig_11{:});
cond_2 = ft_timelockgrandaverage(cfg,allsubs.trig_12{:});
cond_3 = ft_timelockgrandaverage(cfg,allsubs.trig_13{:});
cond_4 = ft_timelockgrandaverage(cfg,allsubs.trig_14{:});
%% ERPs
close all
for k=1:2
figure;
for i=1:length(ROIs_names)
subplot(3,3,i)
hold on
line([min(cond_1.time) max(cond_1.time)],[0 0],'linewidth',1,'linestyle','-','color',[0 0 0])
line([0 0],[-2 2],'linewidth',1,'linestyle','-','color',[0 0 0])
title(ROIs_names{i})
xlabel('Time')
set(gca, 'YDir','reverse')
if k==1
A = plot(cond_1.time,nanmean(cond_1.avg(ismember(cond_1.label,ROIs{i}),:)),'linewidth',2, 'color',[0 0 0]);
B = plot(cond_4.time,nanmean(cond_4.avg(ismember(cond_4.label,ROIs{i}),:)),'linewidth',2,'color',[1 0 0]);
legend([A B],'Seen-Direct','Heard-Direct*')
else
A = plot(cond_3.time,nanmean(cond_3.avg(ismember(cond_3.label,ROIs{i}),:)),'linewidth',2, 'color',[0 0 0]);
B = plot(cond_2.time,nanmean(cond_2.avg(ismember(cond_2.label,ROIs{i}),:)),'linewidth',2,'color',[1 0 0]);
legend([A B],'Heard-Indirect','Seen-Indirect*')
end
end
end
More information about the eeglablist
mailing list