Home > rest_20090422 > rest_mni2tal.m

rest_mni2tal

PURPOSE ^

Converts coordinates from MNI brain to best guess

SYNOPSIS ^

function outpoints = rest_mni2tal(inpoints)

DESCRIPTION ^

 Converts coordinates from MNI brain to best guess
 for equivalent Talairach coordinates
 FORMAT outpoints = mni2tal(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 Talairach points
 Matthew Brett 10/8/99

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

rest_mni2tal.m

SOURCE CODE ^

0001 function outpoints = rest_mni2tal(inpoints)
0002 % Converts coordinates from MNI brain to best guess
0003 % for equivalent Talairach coordinates
0004 % FORMAT outpoints = mni2tal(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 Talairach points
0008 % Matthew Brett 10/8/99
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 upT = rest_spm_matrix([0 0 0 0.05 0 0 0.99 0.97 0.92]);
0020 downT = rest_spm_matrix([0 0 0 0.05 0 0 0.99 0.97 0.84]);
0021 
0022 tmp = inpoints(3,:)<0;  % 1 if below AC
0023 inpoints = [inpoints; ones(1, size(inpoints, 2))];
0024 inpoints(:, tmp) = downT * inpoints(:, tmp);
0025 inpoints(:, ~tmp) = upT * inpoints(:, ~tmp);
0026 outpoints = inpoints(1:3, :);
0027 if dimdim == 2
0028   outpoints = outpoints';
0029 end
0030 
0031 
0032 
0033

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