[Eeglablist] conversion of dipoles Eeglab coord into Talairach

Arnaud Delorme arno at salk.edu
Mon Jun 6 14:19:42 PDT 2005


The small program below convert spherical (head radius 85 mm) to MNI 
coordinates, then MNI to Talairach coordinates. These functions will be 
part of the new DIPFIT 2 plugin that we will release soon.

coords = [ 0 0 0]; % exemple of spherical coordinates
mnicoords = sph2spm*[ coords 1]';
talcoords   = mni2tal( mnicoords(1:3)' )

talcoords =

    0.5532  -17.3600    2.5313


Best,

Arno

# 
--------------------------------------------------------------------------------

% sph2spm() - compute homogenous transformation matrix from
%             BESA spherical coordinates  to SPM 3-D coordinate
%
% Usage:
%  >> trans = sph2spm;
%
% Outputs:
%   trans - homogenous transformation matrix
%
% Note: head radius for spherical model is assumed to be 85 mm.
%
% Author: Robert Oostenveld, SMI/FCDC, Nijmegen 2005
%         Arnaud Delorme, SCCN, La Jolla 2005

% SMI, University Aalborg, Denmark http://www.smi.auc.dk/
% FC Donders Centre, University Nijmegen, the Netherlands 
http://www.fcdonders.kun.nl/

function besa2SPM_result = sph2spm;

besa2SPM_result = [
   0.0101   -0.9400         0    0.5588
    1.1889    0.0080    0.0530  -18.0041
   -0.0005   -0.0000    1.1268    1.8045
         0         0         0    1.0000
          ];

# 
--------------------------------------------------------------------------------

% MNI2TAL - MNI to Talairach coordinates (best guess)
%
% outpoints = mni2tal(inpoints)
%
% inpoints - Nx3 or 3xN matrix of coordinates
%            (N being the number of points)
%
% outpoints - the coordinate matrix with Talairach points
%
% See also, TAL2MNI, MNI2TAL_MATRIX &
% http://www.mrc-cbu.cam.ac.uk/Imaging/mnispace.html
%

% $Revision: 1.5 $ $Date: 2004/02/07 01:41:51 $

% Licence:  GNU GPL, no express or implied warranties
% Matthew Brett 10/8/99, matthew.brett at mrc-cbu.cam.ac.uk
% modified 02/2003, Darren.Weber_at_radiology.ucsf.edu
%                   - removed dependence on spm_matrix and
%                     abstracted the matrix in case it changes
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

dimdim = find(size(inpoints) == 3);
if isempty(dimdim),
    error('input must be a Nx3 or 3xN matrix')
end
if dimdim == 2,
    inpoints = inpoints';
end

% Transformation matrices, different zooms above/below AC
M2T = mni2tal_matrix;

inpoints = [inpoints; ones(1, size(inpoints, 2))];

tmp = inpoints(3,:) < 0;  % 1 if below AC

inpoints(:,  tmp) = (M2T.rotn * M2T.downZ) * inpoints(:,  tmp);
inpoints(:, ~tmp) = (M2T.rotn * M2T.upZ  ) * inpoints(:, ~tmp);

outpoints = inpoints(1:3, :);
if dimdim == 2,
    outpoints = outpoints';
end

return


Paolo Andre wrote:

>Hi all
>
>I have a problem on how to convert dipole cordinates as they as they appear
>in the pop_dipfit_manual window into Talairach mm coordinates. 
>Any help is appreciated
>Many thanks
>
>Paolo  
>
>_______________________________________________
>eeglablist mailing list eeglablist at sccn.ucsd.edu
>http://sccn.ucsd.edu/mailman/listinfo/eeglablist
>Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
>To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.ucsd.edu
>
>
>  
>


-- 

*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*:

    Love feels no burden, thinks nothing of trouble, attempts what is
    above its strength, pleads no excuse of impossibility; for it thinks
    all things lawful for itself, and all things possible.

        /Thomas a Kempis/  

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20050606/1721e975/attachment.html>


More information about the eeglablist mailing list