[Eeglablist] position of electrodes
Tim Mullen
mullen.tim at gmail.com
Tue Dec 4 20:18:37 PST 2012
PPPS(!): note also that, for various reasons, the roles of the variables
named 'x' and 'y' are interchanged inside topoplot.m -- so the internal
variable 'x' actually refers to the ordinate (y-axis) and 'y' refers to the
abscissa (x-axis). That's why I wrote *plot3(y,x,...)* instead of *
plot3(x,y,...)*. Naturally this is confusing, so in the near future
topoplot will be modified to output x,y,z electrode locations with the
expected interpretation.
Tim
On Tue, Dec 4, 2012 at 8:00 PM, Tim Mullen <mullen.tim at gmail.com> wrote:
> PPS: the following option (which uses "~" denote missing outputs, avoiding
> the need to save a separate function) was pointed out by a user. I didn't
> suggest this because the "~" notation was only introduced in Matlab 2009b.
> But if you have 2009b or later, it's a good option.
>
> ---------- Forwarded message ----------
> From: Tide Gu <tidegu at me.com>
>
> Why not put x, y at the end of parameters? i.e.,
>
> function [handle,Zi,grid,Xi,Yi, *x*,*y*] =
> topoplot(Values,loc_file,varargin)
>
> I think if you do so, it won't conflict with other EEGLAB functions and
> you can call:
>
> >> [~,~, ~, ~, ~, x,y] = topoplot([],EEG.chanlocs,'electrodes','on');
>
> to access x and y.
>
> Although it kind of complex and weird, but you don't need to save a new
> file :)
>
> Regards,
>
> Tide
>
> -----------------------------------------------
> Tide / Shenkai *GU*
>
> Department of Computing, FEPS
> University of Surrey
> Guildford, Surrey
> GU2 7XH, United Kingdom
> -----------------------------------------------
>
>
> Tim
>
>
> On Tue, Dec 4, 2012 at 7:29 PM, Tim Mullen <mullen.tim at gmail.com> wrote:
>
>> 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/c59eef5f/attachment.html>
More information about the eeglablist
mailing list