[Eeglablist] Import XY channel locations

Makoto Miyakoshi mmiyakoshi at ucsd.edu
Wed May 21 19:28:04 PDT 2014


Dear Simon,

I'm not sure if it's related to your case, but I needed to make a solution
like this for myself when I analyzed data with Polhemus... let me share my
code with you.

Makoto

    % redo channels (transform meter to millimeter!)
    tmpNoDataChans = EEG.chaninfo.nodatchans;
    tmpNoDataChans = rmfield(tmpNoDataChans,'datachan');
    EEG.chanlocs   = [EEG.chanlocs tmpNoDataChans];
    for n = 1:length(EEG.chanlocs)
        EEG.chanlocs(1,n).X = EEG.chanlocs(1,n).X*1000;
        EEG.chanlocs(1,n).Y = EEG.chanlocs(1,n).Y*1000;
        EEG.chanlocs(1,n).Z = EEG.chanlocs(1,n).Z*1000;
    end
    EEG.chaninfo.nodatchans = [];
    EEG = pop_chanedit(EEG, 'eval','chans = pop_chancenter( chans,
[],[]);');

    % compute transform parameter
    [~,transform] = coregister(EEG.chaninfo.nodatchans,
'/data/common/matlab/eeglab/plugins/dipfit2.3/standard_BEM/elec/standard_1005.elc',
'warp', 'auto', 'manual', 'off')



2014-05-21 1:32 GMT-07:00 Simon Kamronn <simon at kamronn.dk>:

> Hi,
>
>
>
> I’m trying to import channel locations from a Neuromag MEG scanner in XY
> coordinates, but for some reason the conversion from Cartesian to polar and
> spherical goes wrong.
>
>
>
> The channel locations file is here:
>
>
> https://github.com/FBK-NILab/DecMeg2014/blob/master/additional_files/Vectorview-all.lay
>
>
>
> and I’m reading the file using
>
>
>
>     [chNum,X,Y,Width,Height,Lbl,Rem] = textread(layout,'%f %f %f %f %f %q
> %q');
>
>     EEG.chanlocs = struct('labels', Lbl, 'X', mattocell(X/max(X)), 'Y',
> mattocell(Y/max(Y)), 'Z', mattocell(zeros(length(X),1)));
>
>     EEG=pop_chanedit(EEG,'convert','cart2all');
>
>
>
> The 3D plot looks fine btw.
>
>
>
> Best,
>
>
>
> Simon
>
> _______________________________________________
> 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
>



-- 
Makoto Miyakoshi
Swartz Center for Computational Neuroscience
Institute for Neural Computation, University of California San Diego
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20140521/01478a18/attachment.html>


More information about the eeglablist mailing list