[Neuroimaging] Nibabel. Loading HCP data.

Matthew Brett matthew.brett at gmail.com
Thu Jul 9 00:03:43 CEST 2015


On Wed, Jul 8, 2015 at 10:45 PM, Jesus-Omar Ocegueda-Gonzalez
<jomaroceguedag at gmail.com> wrote:
> I get the following:
> In [17]: dwi_nib.shape
> Out[17]: (140, 140, 96, 552)
> In [18]: dwi_nib.get_data_dtype()
> Out[18]: dtype('<f4')
> In [19]: np.prod(dwi_nib.shape) * 4
> Out[19]: -140394496
> In [20]: np.int64(np.prod(dwi_nib.shape)) * 4
> Out[20]: 4154572800

Most unfortunately, it looks as though numpy casts to int32 by default
on 32-bit platforms, which is what is causing this problem.

Your fix is fine, I'll submit another in a little while.

Cheers,

Matthew


More information about the Neuroimaging mailing list