[Neuroimaging] Nibabel API change - always read as float

Satrajit Ghosh satra at mit.edu
Wed Jul 22 15:09:44 CEST 2015


hi matthew,


> Oh - sorry - you were only trying to say that either 0 or scalefactors
> (1, 0) mean that scaling does not get applied?  Yes, sure, it would be
> inefficient to apply scaling where it has no effect.
>
> I was only saying that scl_slope of 1 and 0 are treated the same
> (apart from the fact that scl_slope of 0 results in scl_inter being
> discarded).
>

> But you agree that scl_slope of 1 or 0 are treated the same (apart
> from scl_inter being discarded for scl_slope == 0)?   In both cases
> the check returns False.
>

i do agree that these are being treated similarly, but unlike the proposed
change in nibabel, the ITK library would return unscaled data in its native
datatype when scalefactors (0, X) or (1, 0).

with the proposed change to as_float, i was hoping that these instances
would allow for some flexibility in the nibabel api to at least get at the
raw header version of these values, or perhaps set a property based on the
raw values. if we read unscaled data and wanted to do something with it, we
could read the original intent of the writer of the file (whether rightly
or wrongly). currently, it appears that we cannot recover this information
without re-reading the binary header.

cheers,

satra
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/neuroimaging/attachments/20150722/9fbffb61/attachment.html>


More information about the Neuroimaging mailing list