Skip to content

Add support for vox2ras-tkr reading in .mgz files #163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
larsoner opened this issue Mar 20, 2013 · 2 comments
Closed

Add support for vox2ras-tkr reading in .mgz files #163

larsoner opened this issue Mar 20, 2013 · 2 comments

Comments

@larsoner
Copy link
Contributor

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

@agramfort
Copy link
Contributor

if you have some matlab code that reads this you should be able to patch :

https://github.com/nipy/nibabel/blob/master/nibabel/freesurfer/mghformat.py

to add this feature.

@larsoner
Copy link
Contributor Author

matthew-brett added a commit that referenced this issue Mar 28, 2013
ENH: Adding vox2ras_tkr

This adds the support requested in issue #163 for access to the vox2ras_tkr output from the MGH format.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants