<!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&nbsp;&nbsp; = mni2tal( mnicoords(1:3)' )<br>
<br>
talcoords =<br>
<br>
&nbsp;&nbsp;&nbsp; 0.5532&nbsp; -17.3600&nbsp;&nbsp;&nbsp; 2.5313<br>
<br>
<br>
Best,<br>
<br>
Arno<br>
<br>
#
--------------------------------------------------------------------------------<br>
<br>
% sph2spm() - compute homogenous transformation matrix from<br>
%&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BESA spherical coordinates&nbsp; to SPM 3-D coordinate<br>
%<br>
% Usage:<br>
%&nbsp; &gt;&gt; trans = sph2spm;<br>
%<br>
% Outputs:<br>
%&nbsp;&nbsp; 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>
%&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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>
&nbsp;&nbsp; 0.0101&nbsp;&nbsp; -0.9400&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp; 0.5588<br>
&nbsp;&nbsp;&nbsp; 1.1889&nbsp;&nbsp;&nbsp; 0.0080&nbsp;&nbsp;&nbsp; 0.0530&nbsp; -18.0041<br>
&nbsp;&nbsp; -0.0005&nbsp;&nbsp; -0.0000&nbsp;&nbsp;&nbsp; 1.1268&nbsp;&nbsp;&nbsp; 1.8045<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp; 1.0000<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ];<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>
%&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (N being the number of points)<br>
%<br>
% outpoints - the coordinate matrix with Talairach points<br>
%<br>
% See also, TAL2MNI, MNI2TAL_MATRIX &amp;<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:&nbsp; 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>
%&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - removed dependence on spm_matrix and<br>
%&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; abstracted the matrix in case it changes<br>
%<br>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%<br>
<br>
dimdim = find(size(inpoints) == 3);<br>
if isempty(dimdim),<br>
&nbsp;&nbsp;&nbsp; error('input must be a Nx3 or 3xN matrix')<br>
end<br>
if dimdim == 2,<br>
&nbsp;&nbsp;&nbsp; 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,:) &lt; 0;&nbsp; % 1 if below AC<br>
<br>
inpoints(:,&nbsp; tmp) = (M2T.rotn * M2T.downZ) * inpoints(:,&nbsp; tmp);<br>
inpoints(:, ~tmp) = (M2T.rotn * M2T.upZ&nbsp; ) * inpoints(:, ~tmp);<br>
<br>
outpoints = inpoints(1:3, :);<br>
if dimdim == 2,<br>
&nbsp;&nbsp;&nbsp; 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>