[Neuroimaging] Nibabel API change - always read as float

Matthew Brett matthew.brett at gmail.com
Tue Jul 21 01:15:05 CEST 2015


On Mon, Jul 20, 2015 at 9:53 PM, Brendan Moloney <moloney at ohsu.edu> wrote:
> Hi Matthew,
> How about the case where you want float32 instead of float64 to save memory?  You would need to go through the dataobj and handle the scaling yourself (including all the special cases)?

Yes, I guess you would have to either go through float64 or handle the
scaling yourself.  But isn't that just:

data = data.astype(np.float32) * scale + inter?

But I do see the point.  My only worry is that this involves handling
all possible type conversions inside the  get_data routine, when the
cases where you really need this are restricted to very tight memory
management, which seems like an expert use-case to me.

Thanks for the specifics though, I'm still thinking,



More information about the Neuroimaging mailing list