<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
  <title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
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.<br>
<br>
coords = [ 0 0 0]; % exemple of spherical coordinates<br>
mnicoords = sph2spm*[ coords 1]';<br>
talcoords   = mni2tal( mnicoords(1:3)' )<br>
<br>
talcoords =<br>
<br>
    0.5532  -17.3600    2.5313<br>
<br>
<br>
Best,<br>
<br>
Arno<br>
<br>
#
--------------------------------------------------------------------------------<br>
<br>
% sph2spm() - compute homogenous transformation matrix from<br>
%             BESA spherical coordinates  to SPM 3-D coordinate<br>
%<br>
% Usage:<br>
%  >> trans = sph2spm;<br>
%<br>
% Outputs:<br>
%   trans - homogenous transformation matrix<br>
%<br>
% Note: head radius for spherical model is assumed to be 85 mm.<br>
%<br>
% Author: Robert Oostenveld, SMI/FCDC, Nijmegen 2005<br>
%         Arnaud Delorme, SCCN, La Jolla 2005<br>
<br>
% SMI, University Aalborg, Denmark <a class="moz-txt-link-freetext" href="http://www.smi.auc.dk/">http://www.smi.auc.dk/</a><br>
% FC Donders Centre, University Nijmegen, the Netherlands
<a class="moz-txt-link-freetext" href="http://www.fcdonders.kun.nl/">http://www.fcdonders.kun.nl/</a><br>
<br>
function besa2SPM_result = sph2spm;<br>
<br>
besa2SPM_result = [<br>
   0.0101   -0.9400         0    0.5588<br>
    1.1889    0.0080    0.0530  -18.0041<br>
   -0.0005   -0.0000    1.1268    1.8045<br>
         0         0         0    1.0000<br>
          ];<br>
<br>
#
--------------------------------------------------------------------------------<br>
<br>
% MNI2TAL - MNI to Talairach coordinates (best guess)<br>
%<br>
% outpoints = mni2tal(inpoints)<br>
%<br>
% inpoints - Nx3 or 3xN matrix of coordinates<br>
%            (N being the number of points)<br>
%<br>
% outpoints - the coordinate matrix with Talairach points<br>
%<br>
% See also, TAL2MNI, MNI2TAL_MATRIX &<br>
% <a class="moz-txt-link-freetext" href="http://www.mrc-cbu.cam.ac.uk/Imaging/mnispace.html">http://www.mrc-cbu.cam.ac.uk/Imaging/mnispace.html</a><br>
%<br>
<br>
% $Revision: 1.5 $ $Date: 2004/02/07 01:41:51 $<br>
<br>
% Licence:  GNU GPL, no express or implied warranties<br>
% Matthew Brett 10/8/99, <a class="moz-txt-link-abbreviated" href="mailto:matthew.brett@mrc-cbu.cam.ac.uk">matthew.brett@mrc-cbu.cam.ac.uk</a><br>
% modified 02/2003, Darren.Weber_at_radiology.ucsf.edu<br>
%                   - removed dependence on spm_matrix and<br>
%                     abstracted the matrix in case it changes<br>
%<br>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%<br>
<br>
dimdim = find(size(inpoints) == 3);<br>
if isempty(dimdim),<br>
    error('input must be a Nx3 or 3xN matrix')<br>
end<br>
if dimdim == 2,<br>
    inpoints = inpoints';<br>
end<br>
<br>
% Transformation matrices, different zooms above/below AC<br>
M2T = mni2tal_matrix;<br>
<br>
inpoints = [inpoints; ones(1, size(inpoints, 2))];<br>
<br>
tmp = inpoints(3,:) < 0;  % 1 if below AC<br>
<br>
inpoints(:,  tmp) = (M2T.rotn * M2T.downZ) * inpoints(:,  tmp);<br>
inpoints(:, ~tmp) = (M2T.rotn * M2T.upZ  ) * inpoints(:, ~tmp);<br>
<br>
outpoints = inpoints(1:3, :);<br>
if dimdim == 2,<br>
    outpoints = outpoints';<br>
end<br>
<br>
return<br>
<br>
<br>
Paolo Andre wrote:<br>
<blockquote type="cite"
 cite="mid3.0.32.20050603130310.007b1100@dial-up.unipi.it">
  <pre wrap="">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 <a class="moz-txt-link-abbreviated" href="mailto:eeglablist@sccn.ucsd.edu">eeglablist@sccn.ucsd.edu</a>
<a class="moz-txt-link-freetext" href="http://sccn.ucsd.edu/mailman/listinfo/eeglablist">http://sccn.ucsd.edu/mailman/listinfo/eeglablist</a>
Eeglablist page: <a class="moz-txt-link-freetext" href="http://sccn.ucsd.edu/eeglab/eeglabmail.html">http://sccn.ucsd.edu/eeglab/eeglabmail.html</a>
To unsubscribe, send an empty email to <a class="moz-txt-link-abbreviated" href="mailto:eeglablist-unsubscribe@sccn.ucsd.edu">eeglablist-unsubscribe@sccn.ucsd.edu</a>


  </pre>
</blockquote>
<br>
<br>
<div class="moz-signature">-- <br>
<br>
<b><font face="Arial,Helvetica"><font size="+1">Arnaud Delorme, Ph.D.</font></font></b>
<br>
<font face="Arial,Helvetica"><font size="+1"><font color="#3333ff">Swartz
Center for Computational Neuroscience,</font> <font color="#3333ff">INC,
University of San Diego California</font></font></font>
<br>
La Jolla, CA92093-0961, USA
<p><font face="Arial,Helvetica"><b>Tel</b> :<i>(+1)-858-458-1927 ext 15</i></font>
<br>
<font face="Arial,Helvetica"><b>Fax</b> :<i>(+1)-858-458-1847</i></font>
<br>
<font face="Arial,Helvetica"><b>Web page</b>: <a
 href="http://www.sccn.ucsd.edu/%7Earno">sccn.ucsd.edu/~arno</a></font>
<br>
<font face="Arial,Helvetica"><b>To think upon</b>:</font></p>
<blockquote><dt><font face="Arial,Helvetica"> 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.
    <font size="-5"><br>
    <br>
    </font></font></dt>
  <dd><font face="Arial,Helvetica"><i>Thomas a Kempis</i></font></dd>
</blockquote>
</div>
</body>
</html>