-
Notifications
You must be signed in to change notification settings - Fork 264
Description
In order to use orig.mgz
files to transform surface vertex locations to MNI coordinates, two pieces of information must be extracted from orig.mgz
. The first is the vox2ras
transformation, accessible via $ mri_info --vox2ras orig.mgz
using Freesurfer or in nibabel
:
import nibabel as nib
img = nib.load('orig.mgz')
img.get_affine()
# or
img.get_header().get_vox2ras()
However, the second necessary piece of information stored in orig.mgz
is the vox2ras-tkr
matrix, accessible via $ mri_info --vox2ras-tkr orig.mgz
. There is currently no way (that I know of) to get this information in nibabel
. It would be great if this info could be added so that Freesurfer command-line dependencies could be removed (e.g., mne-tools/mne-python#524).
For reference in the associated transform, see the MNI305RAS
conversion:
http://surfer.nmr.mgh.harvard.edu/fswiki/CoordinateSystems