FreeSurfer experts, I am trying to mark points on a surface in tksurfer, then obtain their original  voxel coordinates. These are some of the problems I have encountered, and some of the instructions and examples I do not yet understand.
-Jeff

From: Bruce Fischl <fischl@nmr.mgh.harvard.edu>
Date: Thursday, January 3, 2013 6:27 PM
To: Jeff Eriksen <eriksenj@ohsu.edu>
Subject: Re: [Freesurfer] FW: how to obtain MRI coordinates of scalp surface points marked in tksurfer

Can you cc the list so others can answer? Freeview can rotate....



On Jan 3, 2013, at 8:06 PM, Jeff Eriksen <eriksenj@ohsu.edu> wrote:

Bruce,

This is what I get when I try to use tksurfer to open the scalp surface created with mkseghead:

*********************************************************************************************
kje-macbook:mri jefferiksen$ tksurfer AIRC0001 lh seghead
subject is AIRC0001
hemi    is lh
surface is seghead
surfer: current subjects dir: /Users/jefferiksen/Documents/Fair_lab/hdEEG_subjects
surfer: not in "scripts" dir ==> using cwd for session root
surfer: session root data dir ($session) set to:
surfer:     /Users/jefferiksen/Documents/Fair_lab/hdEEG_subjects/AIRC0001/mri
Reading image info (/Users/jefferiksen/Documents/Fair_lab/hdEEG_subjects/AIRC0001)
Reading /Users/jefferiksen/Documents/Fair_lab/hdEEG_subjects/AIRC0001/mri/orig.mgz
surfer: Reading header info from /Users/jefferiksen/Documents/Fair_lab/hdEEG_subjects/AIRC0001/mri/orig.mgz
ltMNIreadEx: could not open file /Users/jefferiksen/Documents/Fair_lab/hdEEG_subjects/AIRC0001/mri/transforms/talairach.xfm
No such file or directory
surfer: Talairach xform file not found (ignored)
surfer: vertices=219128, faces=442484
MRISreadVertexPosition(/Users/jefferiksen/Documents/Fair_lab/hdEEG_subjects/AIRC0001/surf/lh.orig): could not open file /Users/jefferiksen/Documents/Fair_lab/hdEEG_subjects/AIRC0001/surf/lh.orig
No such file or directory
MRISreadOriginalProperties: could not read surface file /Users/jefferiksen/Documents/Fair_lab/hdEEG_subjects/AIRC0001/surf/lh.orig
No such file or directory
surfer: single buffered window
surfer: tkoInitWindow(AIRC0001)
surfer: using interface /Applications/freesurfer/lib/tcl/tksurfer.tcl
Reading /Applications/freesurfer/lib/tcl/tkm_common.tcl
Reading /Applications/freesurfer/lib/tcl/tkm_wrappers.tcl
Reading /Applications/freesurfer/lib/tcl/fsgdfPlot.tcl
Reading /Applications/freesurfer/lib/tcl/tkUtils.tcl
Successfully parsed tksurfer.tcl
reading white matter vertex locations...
mrisReadTriangleFile(/Users/jefferiksen/Documents/Fair_lab/hdEEG_subjects/AIRC0001/surf/lh.white): surface doesn't match /Users/jefferiksen/Documents/Fair_lab/hdEEG_subjects/AIRC0001/surf/lh.seghead

mrisReadTriangleFile failed.
***********************************************************************************************

The surface displays, but when I click on a point it puts all 0.0s in the Vertex RAS fields. I presume this is because I have not specified a volume or transform.

I am confused by the example given below which uses orig.mgz. I tried to substitute T1.mgz, but it still tries to use orig.mgz above.

***********************************************************************************************

1. I have a point on the surface and want to compute the CRS for voxel in the orig.mgz that corresponds to this point:

VoxCRS = inv(Torig)*[tkrR tkrA tkrS 1]'

where [tkrR tkrA tkrS] is the "Vertex RAS" as seen in the tksurfer Tools window (also output of mris_convert). Torig is the Vox2tkrRAS matrix obtained from "mri_info --vox2ras-tkr orig.mgz" (note: this is the same for all orig volumes).

Test: click on a point in tksurfer. Use "Vertex RAS" to compute Vox2CRS. Round Vox2CRS to the nearest integer. Hit Save Point in tksurfer. In tkmedit, Goto Saved Point. Compare VoxCRS to "Volume Index". Note: you may need to use the "Volume RAS" from tkmedit in the computation above to get an exact match

************************************************************************************************

I tried mri_info --vox2ras-tkr T1.mgz and got a matrix, which I could use in Matlab to transform, but not without knowing the vertex RAS coordinates.

Have I confused you enough? 

From: Bruce Fischl <fischl@nmr.mgh.harvard.edu>
Date: Wednesday, January 2, 2013 7:08 PM
To: Jeff Eriksen <eriksenj@ohsu.edu>
Cc: "freesurfer@nmr.mgh.harvard.edu" <freesurfer@nmr.mgh.harvard.edu>
Subject: Re: [Freesurfer] FW: how to obtain MRI coordinates of scalp surface points marked in tksurfer

Hi Jeff
The coordinate conversions are documented on our wiki. Or you could do the marking in tkmedit or freeview which will show you voxel and surface RAS coords.  There might also be an option to view them in tksurfer too, I can't remember (view->information or something like that)
Cheers
Bruce


On Jan 2, 2013, at 7:43 PM, Jeff Eriksen <eriksenj@ohsu.edu> wrote:

HI,

I created a scalp surface mesh with mkheadsurf. I need to mark or select some scalp surface points and obtain their MRI coordinates. That is, if my MRI is 256-cubed I need the (ix,iy,iz) MRI voxel coordinates closest to the scalp mesh point I mark, where these run from 1 to 256 (or 0-255 if you must).  The tksurfer display shows several types of floating point coordinates, but they assume an origin in the center of the head somewhere. If I knew the MRI coordinates of this origin I could calculate the original MRI.

Thanks,
-Jeff

_______________________________________________
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.