function outpoints = tal2mni(inpoints)
% Converts coordinates from Tal brain coordinates
% MNI mm 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 Talairach points
% mni2tal Matthew Brett 10/8/99 / tal2mni KC 07-07-2000

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

% Transformation matrices, different zooms above/below AC
upT = spm_matrix  ([0 0 0 0.05 0 0 0.99 0.97 0.92]);
downT = spm_matrix([0 0 0 0.05 0 0 0.99 0.97 0.84]);

invupT   = inv(upT);
invdownT = inv(downT);


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




