Home > rest_20090422 > rest_tal2mni.m

rest_tal2mni

PURPOSE ^

Converts coordinates to MNI brain best guess

SYNOPSIS ^

function outpoints = rest_tal2mni(inpoints)

DESCRIPTION ^

 Converts coordinates to MNI brain best guess
 from Talairach coordinates
 FORMAT outpoints = tal2mni(inpoints)
 Where inpoints is N by 3 or 3 by N matrix of coordinates
  (N being the number of points)
 outpoints is the coordinate matrix with MNI points
 Matthew Brett 2/2/01

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

rest_tal2mni.m

SOURCE CODE ^

0001 function outpoints = rest_tal2mni(inpoints)
0002 % Converts coordinates to MNI brain best guess
0003 % from Talairach coordinates
0004 % FORMAT outpoints = tal2mni(inpoints)
0005 % Where inpoints is N by 3 or 3 by N matrix of coordinates
0006 %  (N being the number of points)
0007 % outpoints is the coordinate matrix with MNI points
0008 % Matthew Brett 2/2/01
0009 
0010 dimdim = find(size(inpoints) == 3);
0011 if isempty(dimdim)
0012   error('input must be a N by 3 or 3 by N matrix')
0013 end
0014 if dimdim == 2
0015   inpoints = inpoints';
0016 end
0017 
0018 % Transformation matrices, different zooms above/below AC
0019 rotn = rest_spm_matrix([0 0 0 0.05]);
0020 upz = rest_spm_matrix([0 0 0 0 0 0 0.99 0.97 0.92]);
0021 downz = rest_spm_matrix([0 0 0 0 0 0 0.99 0.97 0.84]);
0022 
0023 inpoints = [inpoints; ones(1, size(inpoints, 2))];
0024 % Apply inverse translation
0025 inpoints = inv(rotn)*inpoints;
0026 
0027 tmp = inpoints(3,:)<0;  % 1 if below AC
0028 inpoints(:, tmp) = inv(downz) * inpoints(:, tmp);
0029 inpoints(:, ~tmp) = inv(upz) * inpoints(:, ~tmp);
0030 outpoints = inpoints(1:3, :);
0031 if dimdim == 2
0032   outpoints = outpoints';
0033 end
0034 
0035 
0036 
0037

Generated on Wed 29-Apr-2009 01:06:38 by m2html © 2005