Hi,
please find attached some matlab functions this transformation. All of my freesurfer_*.m files are available by anonymous cvs checkout, see http://eeg.sf.net for details.
Kind regards, Darren
Doug Greve wrote:
If you've done the freesurfer recon, then you should have one in yoursubject/mri/transforms.
The matlab file just converts MNI talairach coordinates to "true" talairach coordinates. The MNI talairach atlas does not map to the true talairach atlas very well, and this attempts to fix it. The talairach.xfm maps from subject RAS to MNI talairach RAS.
doug
Ajay Pillai wrote:
Thank you Doug,
What I have is MEG data in RAS coordinates and I want to convert it to Talairach.
So I do not have a talairach.xfm file.So how does one do it. will the m file you gave work without the .xfm file
Ajay
Doug Greve wrote:
If you have the RAS in a vector: v = [R A S 1]';
And the talairach.xfm matrix X, then MNI talairach cooridnates are:
vMNI = X*v;
These can be computed to something closer to true talairach coords using the attached mfile, originally from Matthew Brett.
doug
Ajay Pillai wrote:
Hello all,
Does any one have a matlab routine to convert given coordinates from RAS to talarach space.
If not atleas give an indication of how to do it?
Ajay _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
function outpoints = mni2tal(inpoints) % 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
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]);
tmp = inpoints(3,:)<0; % 1 if below AC inpoints = [inpoints; ones(1, size(inpoints, 2))]; inpoints(:, tmp) = downT * inpoints(:, tmp); inpoints(:, ~tmp) = upT * inpoints(:, ~tmp); outpoints = inpoints(1:3, :); if dimdim == 2 outpoints = outpoints'; %' end
-- ..so long as the people do not care to exercise their freedom, those who wish to tyrannize will do so; for tyrants are active and ardent, and will devote themselves in the name of any number of gods, religious and otherwise, to put shackles upon sleeping men. -- Voltairine de Cleyre
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer