Hi Bruce,
Very sorry but I'm still confused. When I click on a point in
TKSURFER and then SAVE the point, I see the following effect on the
logs (NOTE: this vertex happens to be the 0th Vertex):
surfer: dmin=0.0569, vno=0, x=-32.9801, y=-124.2833, z=-37.1158
surfer: curv=-0.230000, fs=0.000000
surfer: val=0.000000, val2=0.000000
surfer: amp=0.000000, angle=0.000000 deg (0.000000)
surfer: vertex 0 marked (curv=-0.230000, stat=0.000000)
x = (-33.0, -124.3, -37.1), n = (-0.5, -0.9, -0.1).
writing coordinates to file
/home/alkim/freesurfer_alpha/subjects/E12410/tmp/edit.dat
vertex 0 coordinates:
ORIGINAL (11.5 -88.5 -8.5)
SPHERICAL (6.7 -90.2 -41.2): (114.5, -85.8)
If I goto this point in Tkmedit, I land at the following "Volume
Index": 116, 136, 39
which are voxel coords. Now, I see that these voxel coords can be
transformed into the "ORIGINAL" coords above by swapping the second
and third dimensions and offsetting things by 127.5.
-116 + 127.5 = 11.5
39 - 127.5 = -88.5
-136 + 127.5 = -8.5
And I can see that these "ORIGINAL" coordinates are what are called
the "Volume RAS" coords in TKMEDIT and "Vertex RAS" in TKSURFER. But
I still do not understand the x,y,z coordinates:
surfer: dmin=0.0569, vno=0, x=-32.9801, y=-124.2833, z=-37.1158
These xyz coordinates are the output I see when I use mris_convert to
convert my rh.inflated surface into ascii format. For instance the
first row of the rh.inflated.ascii file is:
-32.980091 -124.283272 -37.115761, which is the same as the
stuff above.
I apologize if I'm missing something obvious here.
Al
On Wed, 6 Mar 2002, Bruce Fischl wrote:
> Hi Al,
>
> the matrix to convert row,col,slice voxel coords into the vertex
> coordinates (which are RAS in the COR file coordinate system with the
> origin at the center of the volume) should be:
>
> -1 0 0 128.5
> 0 1 -128.5
> 0 -1 0 128.5
>
>
> we have been plagued by off-by-ones and off-by-1/2s, but I think this is
> correct.
>
> cheers,
> Bruce
>
> --------------------------------------------------------
> Bruce Fischl email: [EMAIL PROTECTED]
> Mass. General Hosp. NMR Center. tel:(617)-726-4897
> Rm. 2328, Building 149, 13th Street fax:(617)-726-7422
> Charlestown, MA 02129 USA
>
>
>
> On Wed, 6 Mar 2002, Albert Kim wrote:
>
> >
> >
> > Bruce,
> > Thanks. I'm approaching a solution, but not quite there yet.
> >
> > I'm assuming you meant that I should use mris_convert (not
> > mri_convert) to create the ascii version of my surface file. I did
> > this as follows:
> > mris_convert rh.inflated rh.inflated.asc
> >
> > However, the resulting ascii file does not contain RAS coordinates.
> > Rather, it contains x,y,z coordinates in a format I do not understand,
> > exemplified by this:
> >
> > #!ascii version of rh.inflated
> > 145185 290366
> > -32.980091 -124.283272 -37.115761 0
> > -33.141834 -124.183533 -37.142693 0
> > -33.435402 -123.985886 -37.259331 0
> > -32.554119 -124.488083 -37.194771 0
> > ...etc...
> >
> > I've been wondering what these coordinates are (I hope I"m not missing
> > something obvious here). These coordinates are not RAS nor voxel
> > coords. They are, however, shown in the tksurfer logs when I click on
> > points. That is, if I click on the 0th vertex in Tksurfer and then
> > SAVE that point, I see the following effects in the log (the x,y,z
> > coords below are the same as in the first row of the ascii
> > file shown above):
> > ----------------------------
> > surfer: dmin=0.1721, vno=0, x=-32.9801, y=-124.2833, z=-37.1158
> > surfer: curv=-0.230000, fs=0.000000
> > surfer: val=0.000000, val2=0.000000
> > surfer: amp=0.000000, angle=0.000000 deg (0.000000)
> > surfer: vertex 0 marked (curv=-0.230000, stat=0.000000)
> > x = (-33.0, -124.3, -37.1), n = (-0.5, -0.9, -0.1).
> >
> > writing coordinates to file
> > /home/alkim/freesurfer_alpha/subjects/E12410/tmp/edit.dat
> > vertex 0 coordinates:
> > ORIGINAL (11.5 -88.5 -8.5)
> > SPHERICAL (6.7 -90.2 -41.2): (114.5, -85.8)
> > ----------------------------
> >
> > So... could you either:
> > 1) Tell me how to produce RAS coordinates in my ascii file or
> > 2) Could you point me to an explanation of the coordinates that I am
> > seeing in my ascii file
> >
> > Thanks very much,
> > Al
> >
> > Department of Psychology
> > University of Washington, Box 351525
> > Seattle, WA. 98195, USA
> > E-Mail: [EMAIL PROTECTED]; Tel: (206)543-2395
> >
> >
> > On Mon, 4 Mar 2002, Bruce Fischl wrote:
> >
> > > Hi Albert,
> > >
> > > you should be able to use spherical coordinates in order to compute
> > > approximate geodesic distances (the length of the arc along the great
> > > circle connecting two points will be an approximation of the geodesic
> > > distance on the gray/white boundary surface). The typical error for cortex
> > > is around 10-15%.
> > >
> > > I'm not clear what you want to do when you say "draw on the
> > > Freeurfer-reconstructed surface". There is a coordinate transform in the
> > > COR-.info file that should be able to take you from RAS coords to voxel
> > > ones, but there's really no need. If you have the RAS coordinates, you
> > > should be able to read out the vertex coordinates from the ascii version of
> > > the surface file (generating using mri_convert) and search through the
> > > vertex list to find the closest one to each of your points. You could also
> > > enter these into a label file, which has a simple ascii format, and load it
> > > to display your points.
> > >
> > > Does that help?
> > >
> > > Bruce
> > >
> > >
> > > On Mon, 4 Mar 2002, Albert Kim wrote:
> > >
> > > > Hi,
> > > >
> > > > I have a set of coordinates, indicating sites on a patient's cortical
> > > > surface (data from intraoperative cortical stimulation studies), which I
> > > > would like to draw on the Freeurfer-reconstructed surface. That is, I
> > > > would like the ability to relate my coordinates to locations (vertex
> > > > numbers??) on the reconstructed surface. [I have the coordinates of
> > > > these locations with respect to the scanner, and I can transform such
> > > > coordinates into coordinates within the COR-image space.]
> > > >
> > > > Note: I suppose one possiblity is to create a "fake" functional volume,
> > > > in which I light up the voxels that are closest to my surface locations,
> > > > and use the existing functional overlay mechanism. But if possible, I'd
> > > > like to do things more directly.
> > > >
> > > > If possible, I'd also like to know how to calculate distance along the
> > > > cortical surface between two points.
> > > >
> > > > Is there some function in the system that will accomplish these goals?
> > > > I'm assuming that there is some way to just tap into the existing overlay
> > > > functionality or the SEND and GOTO point utilities.
> > > >
> > > > Thanks,
> > > > Al Kim
> > > > Department of Psychology
> > > > University of Washington, Box 351525
> > > > Seattle, WA. 98195, USA
> > > > E-Mail: [EMAIL PROTECTED]; Tel: (206)543-2395
> > > >
> > > >
> > >
> > >
> >
>
>