[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
nibabel[0].

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.

Thanks,
Chris Markiewicz

[0] http://nipy.org/nibabel/
[1]
https://github.com/nipy/nibabel/blob/master/nibabel/freesurfer/mghformat.py
[2]
https://github.com/nipy/nibabel/blob/2139ce0d24e65a83295bb6b3eaaf005eaeaebb5f/nibabel/freesurfer/mghformat.py#L28-L35
[3]
https://github.com/freesurfer/freesurfer/blob/master/include/mri.h#L157-L252
[4] https://surfer.nmr.mgh.harvard.edu/fswiki/CoordinateSystems
[5]
https://github.com/effigies/nibabel/blob/55c9bf905ec8785617755f900635fc31bae43232/nibabel/freesurfer/mghformat.py#L30-L49
-------------- 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