[Neuroimaging] Nibabel API change - always read as float
Satrajit Ghosh
satra at mit.edu
Wed Jul 8 04:35:17 CEST 2015
hi brendan,
here is the line:
Floating point types are presumed to be stored in IEEE-754 format.
this is about how data are stored on disk. nifti-1 does not say
anything about what a user does with data. i only intended to say that
data stored back should conform to ieee-754 when stored as dt_float.
cheers,
satra
On Tue, Jul 7, 2015 at 2:16 PM, Brendan Moloney <moloney at ohsu.edu> wrote:
> > 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).
>
>
>
> _______________________________________________
> Neuroimaging mailing list
> Neuroimaging at python.org
> https://mail.python.org/mailman/listinfo/neuroimaging
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/neuroimaging/attachments/20150707/09dbdb64/attachment.html>
More information about the Neuroimaging
mailing list