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

Sebastien Besson (Staff) s.besson at dundee.ac.uk
Thu Apr 14 08:45:58 BST 2016


Hi Christian,

many thanks for both the bug report and the proposed bug fix at once.

I was able to reproduce the stack trace you reported by generating large NIFTI
files using the MATLAB toolbox. As the samples are large, uploading them via
our QA system will not work as there is a 2GB limit. I will generate a few samples
and add them to our data repository.

For the bug fix, what you proposed looks completely sensible. Feel free to open
a Pull Request directly under the Bio-Formats repository [1]. Otherwise, we can
do it on your behalf. Let us know what you prefer.

Best,
Sebastien

[1] https://github.com/openmicroscopy/bioformats/blob/develop/CONTRIBUTING.md

On 13 Apr 2016, at 16:04, Christian Niedworok <Christian.Niedworok at crick.ac.uk<mailto:Christian.Niedworok at crick.ac.uk>> wrote:

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.
_______________________________________________
ome-users mailing list
ome-users at lists.openmicroscopy.org.uk<mailto:ome-users at lists.openmicroscopy.org.uk>
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users


The University of Dundee is a registered Scottish Charity, No: SC015096
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-users/attachments/20160414/83285af8/attachment.html>


More information about the ome-users mailing list