[Eeglablist] How can I apply headplot to time windows?
Arnaud Delorme
arno at salk.edu
Thu Nov 18 17:55:48 PST 2004
Hi Niko,
> i have got a question concerning 'headplot'. this function plots field
> maps for a certain latency, i.e. a single data point. how can i plot
> an average map, averaged across sampling points, e.g. the average map
> of the time window from 300 to 500 ms?
% first find out data points corresponding to your latencies of interest
% the easiest way to do that is to use the function "eeg_lat2point"
%
------------------------------------------------------------------------------------------
tlim = eeg_lat2point( [0.3 0.5], 1, EEG.srate, [EEG.xmin EEG.xmax]);
% alternativelly you may compute it yourself
% note that the +1 at the end is because the first data point has index
1 and not 0
% ---------------------------------------------------------
tlim(1) = (0.3-EEG.xmin)*EEG.srate+1;
tlim(2) = (0.5-EEG.xmin)*EEG.srate+1;
% then compute the average for this time period
% ------------------------------------------------------------
tlim = round(tlim); % find closest data points
ERP = mean(EEG.data, 3); % averages over data trials,
i.e., compute the ERP
ERP300to500 = mean(ERP(:,tlim(1):tlim(2)), 2); % average of time points
% plot the resulting average using headplot
% (assuming you have already computed the splinefile by calling the
% "Plot > ERP map series > In 3-D" menu item at least once)
% ------------------------------------------------------
figure; headplot(ERP300to500, EEG.splinefile, 'title', 'Average ERP from
300 to 500 ms');
Arno
--
*Arnaud Delorme, Ph.D.*
Swartz Center for Computational Neuroscience, INC, University of San
Diego California
La Jolla, CA92093-0961, USA
*Tel* :/(+1)-858-458-1927 ext 15/
*Fax* :/(+1)-858-458-1847/
*Web page*: sccn.ucsd.edu/~arno <http://www.sccn.ucsd.edu/%7Earno>
*To think upon*:
In the process of defining myself, I have a tendency to set up rules
and boundaries and then forget that rules are made to be broken, as
are boundaries to be expanded and crossed.
/Kathleen Casey Theisen/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20041118/18704521/attachment.html>
More information about the eeglablist
mailing list