[Neuroimaging] Nibabel API change - always read as float

Brendan Moloney moloney at ohsu.edu
Tue Jul 7 20:16:15 CEST 2015

> the nifti-1 standard (http://nifti.nimh.nih.gov/pub/dist/src/niftilib/nifti1.h)
> has a datatype field. there are two scenarios with scaling:
> 1. scl_slope == 0:
> 2. scl_slope != 0:
>    data should be converted to IEEE-754  floats as per the nifti standard.
> given nifti was around 2001 this probably did not reflect the updated
> IEE754-2008 standard, but > relied on the 1985 standard. i don't think the
> nifti-1 standard makes it clear what this float should correspond to, i.e.,
> 16/32/64/128 bit floats.

I don't see that in the standard.  All I see is:

   If the scl_slope field is nonzero, then each voxel value in the dataset
   should be scaled as
      y = scl_slope * x + scl_inter
   where x = voxel value stored
         y = "true" voxel value
   Normally, we would expect this scaling to be used to store "true" floating
   values in a smaller integer datatype, but that is not required.  That is,
   it is legal to use scaling even if the datatype is a float type (crazy,
   perhaps, but legal).

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/neuroimaging/attachments/20150707/0fde7aba/attachment.html>

More information about the Neuroimaging mailing list