You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] mne coreg GUI saves fiducials in meg space but labels as mri space #7081
It's not the same as voxel coordinates. If you want to go from "MRI" to "MRI voxels", you'd want (the inverse of) the img.header.get_vox2ras_tkr() transform from nibabel, e.g.:
What I'm confused about is that the fiducials saved out of the mri gui are in meters (<<1) whereas the mri_space is related to voxels (>1). I'll keep working through it but if there's a simple explanation that would help a lot.
To clarify, the mri_voxel coordinates can be passed directly to deface and work, the mri_coordinates have to do the second transform and the meg_coordinates have to do both transforms to work.
Activity
larsoner commentedon Nov 19, 2019
What we call
MRIis the "Surface RAS" used by FreeSurfer documented here:https://mne.tools/dev/overview/implementation.html?highlight=coordinate%20frames%20voxel#meg-eeg-and-mri-coordinate-systems
It's not the same as voxel coordinates. If you want to go from "MRI" to "MRI voxels", you'd want (the inverse of) the
img.header.get_vox2ras_tkr()transform fromnibabel, e.g.:https://gist.github.com/larsoner/0ac6fad57e31cb2d9caa77350a9ff366#file-sample_mri_pos-py-L28
FYI that gist was used to get the electrodes from head coords onto the MRI for use in this example:
https://mne.tools/dev/auto_tutorials/source-modeling/plot_eeg_mri_coords.html
alexrockhill commentedon Nov 19, 2019
Very cool example, my mistake on the coordinate system. Looks good to me!
alexrockhill commentedon Nov 19, 2019
Ok sorry still a bit confused.
I was using
To get to what I thought was the mri space you are referencing.
Then
to get to voxels.
That worked for the landmarks saved out of the GUI, but skipping the first step (meg to mri) did not.
i.e. voxel space
mri space
meg/head space
What I'm confused about is that the fiducials saved out of the mri gui are in meters (<<1) whereas the mri_space is related to voxels (>1). I'll keep working through it but if there's a simple explanation that would help a lot.
To clarify, the mri_voxel coordinates can be passed directly to deface and work, the mri_coordinates have to do the second transform and the meg_coordinates have to do both transforms to work.
alexrockhill commentedon Nov 19, 2019
Ahhh I think I was just missing a conversion to mm
drammock commentedon Nov 19, 2019
@alexrockhill now that you understand it thoroughly, care to write a tutorial on coordinate transformations?
alexrockhill commentedon Nov 19, 2019
I could do that. Is there a tutorial for something else that it would be helpful if I modeled it off @drammock?
drammock commentedon Nov 19, 2019
Start here: https://mne.tools/dev/auto_tutorials/source-modeling/plot_source_alignment.html
See if it makes more sense to edit / improve that one, or if a separate stand-alone tutorial would be better.
alexrockhill commentedon Nov 19, 2019
Ok sorry super basic question: it looks like auto_tutorials are maybe in the .gitignore? How do I make a feature branch with this edited?
drammock commentedon Nov 19, 2019
the source of the tutorials are in
/path/to/mnepython/tutorials/. The rendered versions get put in.../doc/auto_tutorialsby sphinx.