External Email - Use Caution Dear FreeSurfer devs,
I'm writing a program in JavaScript that converts FreeSurfer surface (mesh) files to other formats, which require the vertices to sit in scanner RAS coordinates. Right now I'm relying on the FreeSurfer *brain.finalsurf.mgz* or *T1.mgz* file to obtain the Torig (vox to tkr-ras) and Norig (vox to scanner ras) matrices, and using these matrices to calculate the rigid transform. This approach requires the users to upload the mgz volume files (but I only need the transforms). Today I found that each binary surface file (e.g. lh.pial) has a little footer that starts with uint32 sequence `2 0 20`, followed by the meta information such as xras, yras, zras, and cras. For example: valid = 1 # volume info valid filename = ../mri/filled-pretess127.mgz volume = 256 256 256 voxelsize = 1.000000000000000e+00 1.000000000000000e+00 1.000000000000000e+00 xras = -1.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 yras = 0.000000000000000e+00 0.000000000000000e+00 -1.000000000000000e+00 zras = 0.000000000000000e+00 1.000000000000000e+00 0.000000000000000e+00 cras = -1.000000000000000e+00 -1.700000000000000e+01 1.900000000000000e+01 \u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0001 From what I understand, cras is the xyz of the volume center, which is the translation from mesh vertices xyz (in tkr-ras) to native scanner RAS. I wonder if I can rely on this information to calculate the transform from tkr-ras to scan-ras, if so, where are the rotation matrices? (Affine/rigid transform is a 4x4 matrix, if cras is the translation, where are the first 3x3 elements, are those always identity matrices?) Best, - Dipterix
_______________________________________________ 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 Mass General Brigham Compliance HelpLine at https://www.massgeneralbrigham.org/complianceline <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.