[Eeglablist] plotting topographies for an average time window and for the difference between conditions
James Desjardins
jdesjardins at brocku.ca
Thu Jun 9 06:51:18 PDT 2011
Hi Sebastian,
I don't think that there are any one line solutions to what you are
trying to do, but with a couple extra calls from the command line I
think that the following example will work for you.
This example assumes that the epoch duration is -200ms to 800ms with a
500Hz sampling rate.
For your first question:
If you have a single dataset loaded into EEGLAB the following calls
from the Matlab command line will (1) create a "data" vector that is
the average epoch of the current data set, (2) make a new timtopo
figure plotting the topography for the 450ms time point (mid point of
your 300ms to 600ms area), (3) obtains the handles of the axes
children in the current timtopo figure, (4) makes the 3rd child of the
timtopo figure the current axis (this is topoplot), (5) updates the
topoplot with the mean of the time points from 250 to 400 (note that
this line uses data points where as the timtopo uses ms values, this
example is correct assuming a 500Hz sampling rate and a desired area
between 300ms and 600ms).
data=mean(EEG.data,3); %1
figure;timtopo(data,EEG.chanlocs,'limits',[-200 800],'plottimes',450); %2
ChildH=get(gcf,'Children'); %3
axes(ChildH(3)); %4
topoplot(mean(data(:,[250:400]),2),EEG.chanlocs); %5
For your second question:
To instead make this figure with the difference waves between two
conditions you now just have to load two dataset and change the first
line from the example above to create the "data" vector as a
difference between two averages as follows (steps 2 through 5 remain
the same):
data=mean(ALLEEG(1).data,3)-mean(ALLEEG(2).data,3); %1
figure;timtopo(data,EEG.chanlocs,'limits',[-200 800],'plottimes',450); %2
ChildH=get(gcf,'Children'); %3
axes(ChildH(3)); %4
topoplot(mean(data(:,[250:400]),2),EEG.chanlocs); %5
James Desjardins
Technician, MA Student
Department of Psychology, Behavioural Neuroscience
Cognitive and Affective Neuroscience Lab
Brock University
500 Glenridge Ave.
St. Catharines, ON, Canada
L2S 3A1
905-688-5550 x4676
Quoting seba <Sebastian.Korb at unige.ch>:
> Dear Eeglab people,
>
> 2 questions concerning the plotting of 2-D topographies:
>
> 1) I am trying to plot the average of all trials over all channels
> with pop_timtopo, which works fine, but instead of plotting
> topographical maps at specific latencies (e.g at 300 and 600 ms) I
> would like to plot the topography of the average of a time window
> (e.g. the average for each channel from 300 to 600 ms).
> How can I do that?
> Is it possible to do so in standard Eeglab or do I need to use
> Erplab and/or the massive univariate toolbox?
> I would prefer being able to do it only with eeglab/matlab, as if I
> got it right Erplab requires continuous data for creating an
> eventlist, while I already have epoched data in eeglab
> I also haven't been able to add bin events to the EEGLAB setfiles,
> as required for the massive univariate toolbox.
>
>
> 2) I would also like to plot the topography corresponding to the
> difference of two conditions, again by averaging a certain time-range.
>
> Thank you very much for your help!
>
> Best
>
> Sebastian
>
>
> ----------------------------------------------------------------------
> Sebastian Korb, Ph.D.
> Swiss Center for Affective Sciences
> University of Geneva, Switzerland
> Tel.: +41223799812
> Email: Sebastian.Korb at unige.ch
> Webpage: http://www.affective-sciences.org/user/34
>
>
>
>
>
>
More information about the eeglablist
mailing list