<div dir="ltr">Dear Seb,<div><br></div><div>Sorry for belated response.</div><div>If you look into the graphic object (quite a deeper level), you'll find data. So this is one way to do it.</div><div>Another approach is generative. It is probably more straightforward to use the ERSP data to generate scalp maps. In this case, you need to code using newtimef() and topoplot().</div><div><br></div><div>Makoto<br><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 21, 2017 at 11:18 AM, Pollet S.C. <span dir="ltr"><<a href="mailto:sebastien.pollet@soton.ac.uk" target="_blank">sebastien.pollet@soton.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Makoto,<br>
<br>
Good point. Someone also told me that there might be a normalisation process applied to compensate for different ERSP amplitudes. So I'll stick to feeding 10 separate files!<br>
<br>
My question now is: is there a way to access the data generated to produce the scalp maps so that I can plot ERSP over time for a specific channel?<br>
<br>
Thanks<br>
Seb<br>
<span class=""><br>
<br>
<br>
-----Original Message-----<br>
From: Makoto Miyakoshi [mailto:<a href="mailto:mmiyakoshi@ucsd.edu">mmiyakoshi@ucsd.edu</a>]<br>
</span><span class="">Sent: 18 February 2017 02:06<br>
To: Pollet S.C. <<a href="mailto:sebastien.pollet@soton.ac.uk">sebastien.pollet@soton.ac.uk</a>><br>
Cc: <a href="mailto:eeglablist@sccn.ucsd.edu">eeglablist@sccn.ucsd.edu</a><br>
Subject: Re: [Eeglablist] Scalp maps vs. scripted ERSP<br>
<br>
Dear Pollet,<br>
<br>
</span><span class="">This is just a pure guess, but if you have different number of trials etc, when they are concatenated they would have different weight. For example, if A has 10 trials and B has 100 trials, after concatenating both and average, you'll see mostly B's data and A's data has only 1:10 weight. Is it what you mean?<br>
<br>
Makoto<br>
<br>
</span><span class="">On Fri, Feb 10, 2017 at 6:27 AM, Pollet S.C. <<a href="mailto:sebastien.pollet@soton.ac.uk">sebastien.pollet@soton.ac.uk</a><<wbr>mailto:<a href="mailto:sebastien.pollet@soton.ac.uk">sebastien.pollet@soton.<wbr>ac.uk</a>>> wrote:<br>
Thanks for the suggestion Makoto,<br>
<br>
I've carried out an experiment.<br>
<br>
Previously I had produced some averaged scalp maps using 10 datasets using STUDY functions. I've now appended those 10 datasets together into one, precomputed channel measures for that one dataset, and produced scalp maps for the same frequency range and time frames as the previous ones.<br>
<br>
They are similar to the ones produced with 10 datasets averaged together, but have significant differences, which probably explains why the graphs I was plotting didn't quite match what I could see on the scalp maps.<br>
<br>
</span>Do you think this might have something to do with how significance is calculated statistically? If it does it separately for 10 files (which is what it does from what I can see - there is one *.datersp file per dataset) then combines them, it might not produce the same results when all movements considered as a whole in one dataset?<br>
<br>
Thanks<br>
Seb<br>
<br>
<br>
From: Makoto Miyakoshi [mailto:<a href="mailto:mmiyakoshi@ucsd.edu">mmiyakoshi@ucsd.edu</a><<wbr>mailto:<a href="mailto:mmiyakoshi@ucsd.edu">mmiyakoshi@ucsd.edu</a>>]<br>
<span class="">Sent: 10 February 2017 02:35<br>
</span>To: Pollet S.C. <<a href="mailto:sebastien.pollet@soton.ac.uk">sebastien.pollet@soton.ac.uk</a><<wbr>mailto:<a href="mailto:sebastien.pollet@soton.ac.uk">sebastien.pollet@soton.<wbr>ac.uk</a>>><br>
Cc: <a href="mailto:eeglablist@sccn.ucsd.edu">eeglablist@sccn.ucsd.edu</a><<wbr>mailto:<a href="mailto:eeglablist@sccn.ucsd.edu">eeglablist@sccn.ucsd.<wbr>edu</a>><br>
<span class="">Subject: Re: [Eeglablist] Scalp maps vs. scripted ERSP<br>
<br>
Dear Pollet,<br>
<br>
> I don't know where I've got it wrong. Is there an obvious error I have made?<br>
<br>
I can't answer to this question. I also want someone to take a look at my groupSIFT code to guarantee there is no error.<br>
<br>
> I wonder if the way EEGLAB calculates things when producing scalp maps is different from the script I have, and if you might know of a way that I could check this? Can I access the data that is used to create the scalp maps?<br>
<br>
Yes, you can use a debug mode in Matlab. Open one of the functions being used to generate the figure, put a red circle on the left column of the edit window, then run the code. The process will stop there, so you can trace the process line by line. It's a basic technique so if you haven't tried it yet, I recommend you challenge it this time!<br>
<br>
Makoto<br>
<br>
</span><span class="">On Mon, Feb 6, 2017 at 3:14 AM, Pollet S.C. <<a href="mailto:sebastien.pollet@soton.ac.uk">sebastien.pollet@soton.ac.uk</a><<wbr>mailto:<a href="mailto:sebastien.pollet@soton.ac.uk">sebastien.pollet@soton.<wbr>ac.uk</a>>> wrote:<br>
Hello,<br>
<br>
</span>I have 20 epoched datasets from 10 different subjects - 2 datasets per subject as there were 2 different conditions. I created averaged scalp maps (for all 10 subjects together, for all channels) in the alpha range (8-12Hz) using the 'Study/Precompute channel measures' and 'Study/Plot channel measures' functions. I used 10 EEGLAB '.set' files for one condition and another 10 for a different condition.<br>
<span class=""><br>
When I ran the 'Precompute channel measures routine', I used these parameters: 'cycles', [3 0.5], 'baseline', [-3500 -1500], 'freqs', [2 60], 'alpha', 0.05, 'ntimesout', 400, 'padratio',1.<br>
<br>
I then used 'Plot channel measures', using '8 12' (8-12Hz) as the frequency parameter and did this repeatedly for 100ms time windows to see what is happening from -1000ms before the event to 1500ms after the event.<br>
<br>
</span>I then wanted to plot ERSP over time for a select number of channels (as visually identified using the scalp maps - those with strong ERD/ERS ), so I used a function created in MatLab that uses the 'newtimef' function, which creates the 'ersp_sig' variable containing significant ERSP. 'ersp_sig' is a 3-element vector - ersp_sig(a,b,c) where 'a' is frequency,'b' is time points (400 per epoch), and 'c' is channels (35 in this case).<br>
<div><div class="h5"><br>
Here is the function I used:<br>
------------------------------<wbr>------------------------------<wbr>-------------------<br>
<br>
function [ersp,ersp_sig] = plotERSPTopo(dirname,filename)<br>
<br>
eegchannels = 1:35;<br>
cycles = [3 0.5];<br>
freqs = [2 60];<br>
baseline = [-3500 -1500];<br>
tlimits = [-4000 4000];<br>
alpha = 0.05;<br>
mine = -7;<br>
maxe = 7;<br>
<br>
eeg = pop_loadset(filename,dirname);<br>
<br>
close all;<br>
for i=eegchannels<br>
<br>
    tmpsig = eeg.data(i,:,:);<br>
    tmpsig = tmpsig(:);<br>
    triallength = size(eeg.data,2);<br>
    close all;<br>
    fprintf('PROCESSING CHANNEL #%2.0f\n' ,i);<br>
    [ersp(:,:,i),itc,powbase,<wbr>times,freqs,erspboot,itcboot] = ...<br>
        newtimef(tmpsig,triallength,<wbr>tlimits,eeg.srate,cycles, ...<br>
        'baseline',baseline, 'alpha', alpha, 'freqs', freqs,'padratio',1, ...<br>
        'plotersp','on','plotitc','<wbr>off','timesout',400, ...,<br>
        'title',eeg.chanlocs(i).<wbr>labels,'erspmax',7);<br>
<br>
    erspimage{i} = getframe(gcf,[116 80 347 308]);<br>
<br>
<br>
    for i1=1:size(ersp,1);<br>
        for i2=1:size(ersp,2);<br>
            if (ersp(i1,i2,i)>erspboot(i1,1)) & (ersp(i1,i2,i)<erspboot(i1,2))<wbr>;<br>
                ersp_sig(i1,i2,i)=0;<br>
            else<br>
                ersp_sig(i1,i2,i)=ersp(i1,i2,<wbr>i);<br>
            end<br>
        end<br>
    end<br>
<br>
end<br>
<br>
------------------------------<wbr>------------------------------<wbr>-------------------<br>
I then used the following function to plot what I was interested in.<br>
X is the file with all 10 datasets appended together for one condition and Y is another file with 10 appended datasets for the other condition.<br>
(These are the same datasets I used to create the scalp maps).<br>
------------------------------<wbr>------------------------------<wbr>-------------------<br>
<br>
function erd_alpha_AB10 = erd_alpha_AB10(X,Y)<br>
<br>
% Plot, for AB10, ERD% for selected channels<br>
<br>
%Load file for left movements<br>
ersp_alpha_left_sig = load(X,'ersp_sig'); ersp_alpha_left_sig = ersp_alpha_left_sig.ersp_sig;<br>
<br>
%Load file for right movements<br>
ersp_alpha_right_sig = load(Y,'ersp_sig'); ersp_alpha_right_sig = ersp_alpha_right_sig.ersp_sig;<br>
<br>
%Convert to ERD/ERS%<br>
erd_alpha_left_sig=((10.^((<wbr>ersp_alpha_left_sig)/10))-1)*<wbr>100;<br>
erd_alpha_right_sig=((10.^((<wbr>ersp_alpha_right_sig)/10))-1)*<wbr>100;<br>
<br>
%Calculate mean values for the alpha range %(alpha range (8-12Hz) is actually indices 7-11 as frequency range starts at 2Hz)<br>
<br>
for j=1:400;<br>
    for k=1:35;<br>
            erd_alpha_left_sig_mean(j,k)= (erd_alpha_left_sig(7,j,k)+<wbr>erd_alpha_left_sig(8,j,k)+erd_<wbr>alpha_left_sig(9,j,k)+erd_<wbr>alpha_left_sig(10,j,k)+erd_<wbr>alpha_left_sig(11,j,k))/5;<br>
    end<br>
end<br>
<br>
for j=1:400;<br>
    for k=1:35;<br>
            erd_alpha_right_sig_mean(j,k)= (erd_alpha_right_sig(7,j,k)+<wbr>erd_alpha_right_sig(8,j,k)+<wbr>erd_alpha_right_sig(9,j,k)+<wbr>erd_alpha_right_sig(10,j,k)+<wbr>erd_alpha_right_sig(11,j,k))/<wbr>5;<br>
    end<br>
end<br>
<br>
% Plots<br>
t=[-4000:20:3999];<br>
<br>
% Left<br>
ch1_left=12; %FC2<br>
ch2_left=27; %CP4<br>
ch3_left=23; %CP3<br>
figure;<br>
title(['Alpha ERD% for all AB10 subjects for left sided movements']); xlabel('Time, in ms (relative to movement onset at 0)'); ylabel('ERD/ERS %')<br>
axis([-4000 4000 -100 100]);<br>
hold on;<br>
plot(t,erd_alpha_left_sig_<wbr>mean(:,ch1_left));<br>
plot(t,erd_alpha_left_sig_<wbr>mean(:,ch2_left),'r');<br>
plot(t,erd_alpha_left_sig_<wbr>mean(:,ch3_left),'g');<br>
legend('FC2','CP4','CP3','<wbr>Location','NorthWest');<br>
<br>
% Right<br>
ch1_right=11; %FCz<br>
ch2_right=23; %CP3<br>
ch3_right=27; %CP4<br>
figure;<br>
title(['Alpha ERD% for all AB10 subjects for right sided movements']); xlabel('Time, in ms (relative to movement onset at 0)'); ylabel('ERD/ERS %')<br>
axis([-4000 4000 -100 100]);<br>
hold on;<br>
plot(t,erd_alpha_right_sig_<wbr>mean(:,ch1_right));<br>
plot(t,erd_alpha_right_sig_<wbr>mean(:,ch2_right),'r');<br>
plot(t,erd_alpha_right_sig_<wbr>mean(:,ch3_right),'g');<br>
legend('FCz','CP3','CP4','<wbr>Location','NorthWest');<br>
<br>
end<br>
<br>
------------------------------<wbr>------------------------------<wbr>-------------------<br>
</div></div>When I look at the plots, they don't quite match what I see on the scalp maps. For example when I plot FC2, CP3 and CP4 together, my plots show that CP4 is activated before FC2 and a with a greater value, which is not what I see on the scalp maps - FC2 has a dark blue 'patch' (strong ERD) whilst CP4 is green - so I was expecting to see this reflected on the plot.<br>
<span class=""><br>
<br>
I don't know where I've got it wrong. Is there an obvious error I have made? I wonder if the way EEGLAB calculates things when producing scalp maps is different from the script I have, and if you might know of a way that I could check this? Can I access the data that is used to create the scalp maps?<br>
<br>
<br>
Thanks for any advice on this.<br>
<br>
Seb<br>
<br>
Sebastien Pollet<br>
University of Southampton<br>
</span><a href="mailto:sebastien.pollet@soton.ac.uk">sebastien.pollet@soton.ac.uk</a><<wbr>mailto:<a href="mailto:sebastien.pollet@soton.ac.uk">sebastien.pollet@soton.<wbr>ac.uk</a>><br>
<span class=""><br>
<br>
______________________________<wbr>_________________<br>
Eeglablist page: <a href="http://sccn.ucsd.edu/eeglab/eeglabmail.html" rel="noreferrer" target="_blank">http://sccn.ucsd.edu/eeglab/<wbr>eeglabmail.html</a><br>
</span>To unsubscribe, send an empty email to <a href="mailto:eeglablist-unsubscribe@sccn.ucsd.edu">eeglablist-unsubscribe@sccn.<wbr>ucsd.edu</a><mailto:<a href="mailto:eeglablist-unsubscribe@sccn.ucsd.edu">eeglablist-<wbr>unsubscribe@sccn.ucsd.edu</a>><br>
For digest mode, send an email with the subject "set digest mime" to <a href="mailto:eeglablist-request@sccn.ucsd.edu">eeglablist-request@sccn.ucsd.<wbr>edu</a><mailto:<a href="mailto:eeglablist-request@sccn.ucsd.edu">eeglablist-request@<wbr>sccn.ucsd.edu</a>><br>
<span class=""><br>
<br>
<br>
--<br>
Makoto Miyakoshi<br>
Swartz Center for Computational Neuroscience Institute for Neural Computation, University of California San Diego<br>
<br>
</span><span class="">______________________________<wbr>_________________<br>
Eeglablist page: <a href="http://sccn.ucsd.edu/eeglab/eeglabmail.html" rel="noreferrer" target="_blank">http://sccn.ucsd.edu/eeglab/<wbr>eeglabmail.html</a><br>
</span>To unsubscribe, send an empty email to <a href="mailto:eeglablist-unsubscribe@sccn.ucsd.edu">eeglablist-unsubscribe@sccn.<wbr>ucsd.edu</a><mailto:<a href="mailto:eeglablist-unsubscribe@sccn.ucsd.edu">eeglablist-<wbr>unsubscribe@sccn.ucsd.edu</a>><br>
For digest mode, send an email with the subject "set digest mime" to <a href="mailto:eeglablist-request@sccn.ucsd.edu">eeglablist-request@sccn.ucsd.<wbr>edu</a><mailto:<a href="mailto:eeglablist-request@sccn.ucsd.edu">eeglablist-request@<wbr>sccn.ucsd.edu</a>><br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
--<br>
Makoto Miyakoshi<br>
Swartz Center for Computational Neuroscience Institute for Neural Computation, University of California San Diego<br>
______________________________<wbr>_________________<br>
Eeglablist page: <a href="http://sccn.ucsd.edu/eeglab/eeglabmail.html" rel="noreferrer" target="_blank">http://sccn.ucsd.edu/eeglab/<wbr>eeglabmail.html</a><br>
To unsubscribe, send an empty email to <a href="mailto:eeglablist-unsubscribe@sccn.ucsd.edu">eeglablist-unsubscribe@sccn.<wbr>ucsd.edu</a><br>
For digest mode, send an email with the subject "set digest mime" to <a href="mailto:eeglablist-request@sccn.ucsd.edu">eeglablist-request@sccn.ucsd.<wbr>edu</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Makoto Miyakoshi<br>Swartz Center for Computational Neuroscience<br>Institute for Neural Computation, University of California San Diego<br></div></div>
</div></div>