8000 add a comment regarding datatype support · nipy/nibabel@e03cacc · GitHub
[go: up one dir, main page]

Skip to content

Commit e03cacc

Browse files
committed
add a comment regarding datatype support
1 parent dd17469 commit e03cacc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

nibabel/freesurfer/mghformat.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@
5757

5858
# caveat: Note that it's ambiguous to get the code given the bytespervoxel
5959
# caveat 2: Note that the bytespervox you get is in str ( not an int)
60+
# FreeSurfer historically defines codes 0-10 [1], but only a subset is well supported.
61+
# Here we use FreeSurfer's MATLAB loader [2] as an indication of current support.
62+
# [1] https://github.com/freesurfer/freesurfer/blob/v8.0.0/include/mri.h#L53-L63
63+
# [2] https://github.com/freesurfer/freesurfer/blob/v8.0.0/matlab/load_mgh.m#L195-L207
6064
_dtdefs = ( # code, conversion function, dtype, bytes per voxel
6165
(0, 'uint8', '>u1', '1', 'MRI_UCHAR', np.uint8, np.dtype('u1'), np.dtype('>u1')),
6266
(1, 'int32', '>i4', '4', 'MRI_INT', np.int32, np.dtype('i4'), np.dtype('>i4')),

0 commit comments

Comments
 (0)
0