Dear Doug,
Thanks a lot for the fast reply. I got it to work with your tips. The missing link for me was especially that I could get the vertices locations by using read_surf over the mgz file. Instead of the fmri_info rotation matrix I can also use the matrix from the nii-file, can't I? They are almost exactly equal.
Now I got the tal coordinates and try to convert them to indices in my nii matrix. I now do that by add the origin of the nii scan to the found tal coordinates (converted to mni or not). But this makes the brain end up too high in the figure. Any idea how this can be? This is true irrespective of the rotation matrix I take.
Thanks a lot in advance, it looks really promising,
kind regards,
Frank
----- Original Message ----- From: "Douglas N Greve" greve@nmr.mgh.harvard.edu To: "Frank Leoné" f.leone@donders.ru.nl Cc: freesurfer@nmr.mgh.harvard.edu Sent: Monday, May 3, 2010 5:55:33 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna Subject: Re: [Freesurfer] Vertices to matrix coordinates
The coordinate system is not easy to explain in an email. There are power point slides on our wiki about the geometry used. To get from surface xyz to column, row, slice in the orig.mgz, first get a matrix from the orig.mgz with
mri_info --tkrvox2ras orig.mgz
this will be 4x4, multiply the inverse of this matrix by the surface xyz (adding a one to make it 4x1) to get the col, row, slice in the orig.
doug
f.leone@donders.ru.nl wrote:
Hi all,
I checked quite a number of previous posts, but still can't seem to figure out what the vertices numbers given by read_annotation in matlab stand for. My questions are:
- In what reference frame are they?
- How do I convert them to coordinates in my original structural image (an x * y * z matrix, based on a nii-file)?
Thanks a lot in advance!
kind regards, Frank
freesurfer@nmr.mgh.harvard.edu