Hi Ali
If you use read_patch.m I believe it returns a structure that has the original vertex index in it. It’s been a *long* time since I looked at that code, but it looks like we actually store it twice for some reason:
for i=1:patch.npts
ind = fread(fid, 1, 'int', 0, 'b') ;
if (ind < 0)
ind = -ind - 1 ;
else
ind = ind - 1 ;
end
patch.ind(i) = ind ;
patch.x(i) = fread(fid, 1, 'float', 0, 'b') ;
patch.y(i) = fread(fid, 1, 'float', 0, 'b') ;
patch.z(i) = fread(fid, 1, 'float', 0, 'b') ;
patch.vno(i) = ind ;
end
so patch.vno should be the original vertex number, which you can use to index into any of the other surfaces (for that subject/hemi)
cheers
Bruce
From: freesurfer-bounces@nmr.mgh.harvard.edu <freesurfer-bounces@nmr.mgh.harvard.edu>
On Behalf Of Alison McDonnell
Sent: Wednesday, March 30, 2022 11:45 AM
To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu>
Subject: Re: [Freesurfer] FREESURFER Maintaining vertex Id during transformations
External Email - Use Caution
Hi Bruce,
If I have the coordinate on the flat map how do I get the corresponding vertex ID? And then from that same ID get the 3D coordinates?
Ali
On Wed, 30 Mar 2022 at 16:09, Fischl, Bruce <BFISCHL@mgh.harvard.edu> wrote:
Hi Ali
We keep track of the vertex index of the flat maps, so you should just be able to use it to look up the coordinate of whatever other (white, pial) surface you want, then see what volumetric coordinates it is at
Cheers
Bruce
From: freesurfer-bounces@nmr.mgh.harvard.edu <freesurfer-bounces@nmr.mgh.harvard.edu> On Behalf Of Alison McDonnell
Sent: Wednesday, March 30, 2022 11:04 AM
To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu>
Subject: [Freesurfer] FREESURFER Maintaining vertex Id during transformations
External Email - Use Caution
Hi all,
I have been able to create my flat map in freesurfer and then do calculations using it to find a point. I then want to map that point back into the 3D space maintaining the coordinates. I was wondering if anyone had done something similar before and had any ideas. I am using MATLAB for the calculations and transformations.
Ali
_______________________________________________
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be 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 Mass General Brigham Compliance HelpLine at MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be https://www.massgeneralbrigham.org/complianceline <MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be https://www.massgeneralbrigham.org/complianceline> .
Please note that this e-mail is not secure (encrypted). If you do not wish to continue communication over unencrypted e-mail, please notify the sender of this message immediately. Continuing to send or respond to e-mail after receiving this message means you understand and accept this risk and wish to continue to communicate over unencrypted e-mail.