[ome-users] [bug] Opening Nifty (.nii) files fails on large images

Christian Niedworok Christian.Niedworok at crick.ac.uk
Wed Apr 13 16:04:57 BST 2016


I have actually managed to find the culprit.

Line 151 of NiftiReader:

pixelFile.seek(pixelOffset + no * planeSize);

all of these variables are declared as int, causing the calculation to
be done in int-space, leading to an overflow, before being cast to long.
One solution is to change line 150 from

int planeSize = FormatTools.getPlaneSize(this);

to

long planeSize = FormatTools.getPlaneSize(this);


Cheers,
Christian
The Francis Crick Institute Limited is a registered charity in England and Wales no. 1140062 and a company registered in England and Wales no. 06885462, with its registered office at 215 Euston Road, London NW1 2BE.


More information about the ome-users mailing list