[Neuroimaging] Nibabel API change - always read as float

Nate Vack njvack at wisc.edu
Mon Jul 6 19:03:38 CEST 2015

FWIW, I'd prefer nibabel not do automatic type casting, but this is an
emotional response, rather than one backed up by "hey this will break my

But! If we're to do it, I don't like the approach of an as_float parameter.
Passing dtype (probably defaulting to np.float64) would be much better, or
it might make more sense to add a new method, say,


On Mon, Jul 6, 2015 at 11:45 AM Matthew Brett <matthew.brett at gmail.com>

> On Mon, Jul 6, 2015 at 5:32 PM, Bertrand Thirion
> <bertrand.thirion at inria.fr> wrote:
> > +1 we (and more importantly, our students)  should rely as much as
> possible
> > on the standard behavior of numpy arrays and make adequate decisions,
> rather
> > than having to figure out the details of the API of neuroimaging
> libraries.
> > So the defaut should be unchanged.
> Your reasoning implies the opposite.   Numpy tries very hard not to
> return arrays of unknown or unpredictable data types, and that is the
> situation we have here.   The returned datatype from a nibabel image
> is essentially arbitrary, in that very few sources of nifti files
> place any weight on whether there are non-default scalefactors or not.
> At the moment, we do, depend on this, silently, and that is extremely
> confusing, and quite contrary to the standard numpy way,
> Cheers,
> Matthew
> _______________________________________________
> 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/20150706/2272037f/attachment.html>

More information about the Neuroimaging mailing list