<div dir="ltr"><div>Hi all,</div><div><br></div><div>I'd like to solicit input for the Python interface to .mgh/.mgz files in nibabel[0].</div><div><br></div><div>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].)</div><div><br></div><div>I'm proposing (<a href="https://github.com/nipy/nibabel/pull/569">https://github.com/nipy/nibabel/pull/569</a>) 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?</div><div><br></div><div>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.</div><div><br></div><div>Thanks,</div><div>Chris Markiewicz</div><div><br></div><div>[0] <a href="http://nipy.org/nibabel/">http://nipy.org/nibabel/</a></div><div>[1] <a href="https://github.com/nipy/nibabel/blob/master/nibabel/freesurfer/mghformat.py">https://github.com/nipy/nibabel/blob/master/nibabel/freesurfer/mghformat.py</a></div><div>[2] <a href="https://github.com/nipy/nibabel/blob/2139ce0d24e65a83295bb6b3eaaf005eaeaebb5f/nibabel/freesurfer/mghformat.py#L28-L35">https://github.com/nipy/nibabel/blob/2139ce0d24e65a83295bb6b3eaaf005eaeaebb5f/nibabel/freesurfer/mghformat.py#L28-L35</a></div><div>[3] <a href="https://github.com/freesurfer/freesurfer/blob/master/include/mri.h#L157-L252">https://github.com/freesurfer/freesurfer/blob/master/include/mri.h#L157-L252</a></div><div>[4] <a href="https://surfer.nmr.mgh.harvard.edu/fswiki/CoordinateSystems">https://surfer.nmr.mgh.harvard.edu/fswiki/CoordinateSystems</a></div><div>[5] <a href="https://github.com/effigies/nibabel/blob/55c9bf905ec8785617755f900635fc31bae43232/nibabel/freesurfer/mghformat.py#L30-L49">https://github.com/effigies/nibabel/blob/55c9bf905ec8785617755f900635fc31bae43232/nibabel/freesurfer/mghformat.py#L30-L49</a></div></div>