[Eeglablist] position of electrodes

Tim Mullen mullen.tim at gmail.com
Tue Dec 4 19:29:24 PST 2012


PS: for now, you should probably save the modified topoplot.m as a separate
function (i.e. topoplot2.m) since other EEGLAB functions that call topoplot
may throw errors if they expect the output sequence to be in its original
form. Note that it doesn't fix the problem to move the new (x,y) outputs to
the end of the output sequence, since most of the preceding outputs are not
defined when the first argument to topoplot() is empty and this will also
throw an error.

Tim


On Tue, Dec 4, 2012 at 7:21 PM, Tim Mullen <mullen.tim at gmail.com> wrote:

> Hi Iman,
>
> topoplot() does not return the transformed electrode locations by default
> (it should, so we'll change that), but fortunately a very small
> modification to the function output will get what you want. Just edit
> topoplot.m and add variables 'x' and 'y' to the list of function outputs.
>
> i.e. replace line 193 of topoplot.m with this line:
>
> function [*x*,*y*,handle,Zi,grid,Xi,Yi] =
> topoplot(Values,loc_file,varargin)
>
> now call topoplot as follows:
>
> >> [x,y] = topoplot([],EEG.chanlocs,'electrodes','on');
>
> (note you can also use {'electrodes', 'labelpoint'} or other display
> options).
>
> x and y now contain the x,y cartesian coordinates sorted in ascending
> order of channel number i.e. [ x(i) , y(i) ] are the x,y coordinates for
> the ith channel. The z-coordinate is the same for all channels and is
> hard-coded in topoplot.m to be *z=2.1*.
>
> Try this scriptlet to test it out:
>
>
> % ---------------------------------------------
>
> % call topoplot and retrieve x,y,z electrode locations ...
>
> figure;
>
> [x,y] = topoplot([],EEG.chanlocs,'electrodes','labelpoint');
>
> z = ones(size(x))*2.1;
>
> % ... verify the locations by drawing markers at the retrieved
> coordinates
>
> %    (red markers should be exactly superimposed on original channel
> markers)
>
> hold on; plot3(y,x,z,'.r');
>
> % ---------------------------------------------
>
>
> Best,
>
> Tim
>
>
> On Tue, Dec 4, 2012 at 4:34 PM, Iman M.Rezazadeh <irezazadeh at ucdavis.edu>wrote:
>
>> Dear EEGlabers.****
>>
>> Do you have any idea how can I retrieve the  position of the electrodes
>> on the displayed screen after using topoplot(). The point is when using
>> topoplot() it needs the electrodes location and it has its own mapping to
>> display it on the screen. Now, if sb wants to use the output of topoplot()
>> as layout then the location of the electrodes on the screen is important!
>> ****
>>
>> ** **
>>
>> ** **
>>
>> Iman M.Rezazadeh, PhD****
>>
>> Postdoctoral Research Fellow****
>>
>> Center for Mind and Brain****
>>
>> University of California, Davis****
>>
>> irezazadeh at ucdavis.edu****
>>
>> Cell:310-490-1808****
>>
>> Skype: Imanmr****
>>
>> ** **
>>
>> _______________________________________________
>> 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
>>
>
>
>
> --
> ---------  αντίληψη -----------
>



-- 
---------  αντίληψη -----------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20121204/cd5941c3/attachment.html>


More information about the eeglablist mailing list