A short update...
On Fri, Jul 27, 2007 at 08:24:35PM +0200, Michael Hanke wrote:
> My wild guess would be, that this is somehow related to the fslio
> library as most avwtools are affected, but libniftiio (which is used by
> PyNIfTI) has no problems with files of that size).
A tried saving the file with PyNIfTI and get an error as well:
In [3]: nim.save('test.nii')
** ERROR: NWAD: wrote only 0 of -1985847296 bytes to file
The resulting file only has the header written.
But the negative value of to be written bytes makes me think: Perhaps
there is an integer overflow in the nifti library.
The size of the file in byte is 2309120352 while the int (not unsigned)
is: -2,147,483,648 -> +2,147,483,647
And now look at this:
(to write) (max int)
2309120352 - 2147483647 = 161636705
(max int) (overflow)
2147483647 - 161636705 = 1985846942
(overflow) (error msg)
1985846942 - 1985847296 = 354
This number is very close to the size of the nifti header. I guess this
is some evidence for the int-overflow hypothesis.
Debian FSL is compiled and linked against the niftilib version within the FSL
tarball and not the latest upstream version.
Any idea where the overflow is?
Thanks,
Michael
--
GPG key: 1024D/3144BE0F Michael Hanke
http://apsy.gse.uni-magdeburg.de/hanke
ICQ: 48230050
|