[Neuroimaging] RFC: Changes to nibabel API for .mgh/.mgz files

Christopher Markiewicz effigies at bu.edu
Tue Oct 31 21:13:55 EDT 2017

Hi all,

I'd like to solicit input for the Python interface to .mgh/.mgz files in

I've recently had cause to dig into this interface (MGHImage[1]), and found
that the naming of header fields[2] (the low-level interface to the raw
binary data) is inconsistent with all of my experience with how FreeSurfer
refers to these fields in the code (MRI_IMAGE[3]) as well as in the outputs
of many programs, such as mri_info. (In fact, the current names seem to
reflect the intermediate variables used in load/save_mgh.m and the
description of the affine transforms in the FS Coordinates powerpoints[4].)

I'm proposing (https://github.com/nipy/nibabel/pull/569) an API change in
nibabel, with field names[5] that more closely reflect what I deem to be
common FreeSurfer usage (although it does not adhere precisely to the C
structure fields). Given that, it was felt that the Python-using FreeSurfer
community more broadly should have some say in the final API. To put a few
specific questions: Do you depend on the current MGHHeader field names?
Would you be averse to updating the field names? Are there alternatives to
my proposal you would find preferable?

While I would be willing to discuss in more detail on this list, I would
prefer (if reasonably convenient) discussion to remain on the Github pull
request as much as possible, so participants can follow easily.

Chris Markiewicz

[0] http://nipy.org/nibabel/
[4] https://surfer.nmr.mgh.harvard.edu/fswiki/CoordinateSystems
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/neuroimaging/attachments/20171031/e9ed1cfa/attachment.html>

More information about the Neuroimaging mailing list