Space transformation

MNE Version 1.10.0

Operating system: Windows 11

Hi all,

I have a question regarding space transformations. I have fiducial locations in MRI RAS space. When I try to use those locations when running mne.gui.coregistration, the locations don’t match. I am assuming this is because the freesurfer space is surface RAS and not MRI RAS. I’m wondering what transformation I need to apply to the fiducial locations to get them surface RAS space.

You may be right. See: How MNE uses FreeSurfer’s outputs — MNE 1.10.2 documentation for more information about these coordinate systems. You can get the RAS->surface RAS transform with the nibabel package:

import mne
import nibabel as nib

# Load a FreeSurfer MRI image
img = nib.read(mne.datasets.sample.data_path() / "subjects/sample/mri/T1.mgz")

# Get the RSA to surface RSA transform
print(img.header.get_vox2ras_tkr())

For me, this gives:

[[  -1.    0.    0.  128.]
 [   0.    0.    1. -128.]
 [   0.   -1.    0.  128.]
 [   0.    0.    0.    1.]]