[Neuroimaging] Nibabel. Loading HCP data.

Matthew Brett matthew.brett at gmail.com
Thu Jul 9 00:47:28 CEST 2015


On Wed, Jul 8, 2015 at 11:03 PM, Matthew Brett <matthew.brett at gmail.com> wrote:
> 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.

https://github.com/numpy/numpy/issues/6056

https://github.com/nipy/nibabel/pull/325

Having said that, I don't think your 32-bit platform can handle an
array of that size anyway...

Cheers,

Matthew


More information about the Neuroimaging mailing list