Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NDPI: Prevent Null Pointer Exception #3248

Closed
wants to merge 2 commits into from
Closed

Conversation

dgault
Copy link
Member

@dgault dgault commented Oct 17, 2018

This issue was raised on the mailing list and a sample file has been provided: http://lists.openmicroscopy.org.uk/pipermail/ome-users/2018-October/007233.html

The images failed to open due to a NullPointerException on line 176, with the markers variable being null.

To test:

  • Ensure builds and tests remain green
  • Using the sample file provided on the mailing list test that the file is able to be open and read correctly

@sbesson
Copy link
Member

sbesson commented Oct 24, 2018

Closing/reopening to include #3251

@sbesson sbesson closed this Oct 24, 2018
@sbesson sbesson reopened this Oct 24, 2018
@sbesson
Copy link
Member

sbesson commented Oct 25, 2018

@dgault is the sample file available somewhere? Should we configure it alongside our QA repository (and potentially make it public with the agreement of the author)?

@dgault
Copy link
Member Author

dgault commented Oct 31, 2018

I have a copy of the sample file as it no longer appears to be available on the previous link. I will get it configured for the repo tests at least.

@sbesson sbesson added this to the 6.0.0 milestone Nov 1, 2018
@sbesson
Copy link
Member

sbesson commented Feb 11, 2019

Retested using the sample file uploaded as part of http://lists.openmicroscopy.org.uk/pipermail/ome-users/2019-February/007381.html.

The reader initialization via the initial setId call is no longer failing with a NPE. In an OMERO server with this PR included, smaller resolutions are correctly read but there is an issue while accessing the large resolutions and the thumbnail:

screen shot 2019-02-11 at 11 29 36
screen shot 2019-02-11 at 11 29 55

Looking at the server logs, it looks like the change is in the JPEGTurboService in the absence of markers.

java.lang.RuntimeException: java.io.IOException: Restart interval and markers invalid
	at omeis.providers.re.data.PlaneFactory.createPlane(PlaneFactory.java:223) ~[rendering.jar:na]
...
Caused by: java.io.IOException: Restart interval and markers invalid
	at loci.formats.services.JPEGTurboServiceImpl.initialize(JPEGTurboServiceImpl.java:222) ~[formats-bsd.jar:6.0.0-SNAPSHOT]
	at loci.formats.in.NDPIReader.openBytes(NDPIReader.java:167) ~[formats-gpl.jar:6.0.0-SNAPSHOT]
	at loci.formats.ImageReader.openBytes(ImageReader.java:460) ~[formats-api.jar:6.0.0-SNAPSHOT]
	at loci.formats.ChannelFiller.openBytes(ChannelFiller.java:156) ~[formats-bsd.jar:6.0.0-SNAPSHOT]
	at loci.formats.ChannelFiller.openBytes(ChannelFiller.java:148) ~[formats-bsd.jar:6.0.0-SNAPSHOT]
	at loci.formats.ChannelSeparator.openBytes(ChannelSeparator.java:200) ~[formats-bsd.jar:6.0.0-SNAPSHOT]
	at loci.formats.ReaderWrapper.openBytes(ReaderWrapper.java:348) ~[formats-api.jar:6.0.0-SNAPSHOT]
	at ome.io.bioformats.BfPixelsWrapper.getTile(BfPixelsWrapper.java:350) ~[romio.jar:na]
	at ome.io.bioformats.BfPixelBuffer.getTile(BfPixelBuffer.java:499) ~[romio.jar:na]
	at omeis.providers.re.data.PlaneFactory.createPlane(PlaneFactory.java:193) ~[rendering.jar:na]
	... 58 common frames omitted

@sbesson sbesson removed this from the 6.0.0 milestone Feb 12, 2019
@dgault dgault added this to the 6.0.1 milestone Feb 27, 2019
@dgault
Copy link
Member Author

dgault commented Feb 27, 2019

A similar report has been received in https://forum.image.sc/t/a-couple-of-problems-with-ndpi-files/23194/6 and a sample file has been provided.

I will modify this PR to fix both issues and include for 6.0.1

@dgault dgault modified the milestones: 6.0.1, 6.1.0 Mar 13, 2019
@sbesson sbesson removed this from the 6.1.0 milestone May 10, 2019
@dgault
Copy link
Member Author

dgault commented Jul 12, 2019

After a lot of effort to rewrite the JPEGTurboServiceImpl it turns out that you can just ignore the restart markers being empty and the things are much better. The images should display but there is still an issue with the thumbnails however.

@dgault
Copy link
Member Author

dgault commented Jul 12, 2019

The thumbnail issue seems to be a problem with the lowest resolution image, Im not sure if its a bug or if the image is as intended.

@dgault dgault added this to the 6.2.0 milestone Jul 13, 2019
@sbesson
Copy link
Member

sbesson commented Jul 16, 2019

At the level of the non-regression tests, the changes to the JPEGTurboServiceImpl required some configuration changes for two sample JPEG files.

Tested the import of these two jpeg files into a server. Given the size of the planes, this leads to the generation of pyramids server-side:

Screen Shot 2019-07-16 at 16 44 02
Screen Shot 2019-07-16 at 16 44 10

  • with this PR included

Screen Shot 2019-07-16 at 16 44 28
Screen Shot 2019-07-16 at 16 44 36

Also tested the import of a few NDPI files including the ones uploaded as part of the original bug report - http://lists.openmicroscopy.org.uk/pipermail/ome-users/2018-October/007233.html

Without this PR

Screen Shot 2019-07-16 at 16 44 46
Screen Shot 2019-07-16 at 16 46 20
Screen Shot 2019-07-16 at 16 46 38

With this PR

Screen Shot 2019-07-16 at 16 44 50
Screen Shot 2019-07-16 at 16 46 16
Screen Shot 2019-07-16 at 16 46 36

  • 06-T05322_1A_HEc_FTU.ndpi the issue primarily affects the low levels of resolution of the WSI. Without this PR, the loading fails leading to no thumbnails. With this PR, the plane looks corrupted and generate a thumbnail which seems to indicate
  • SN120-18-7_HE.ndpi still fails to import with or without this PR with a NPE at import time when calling openBytes
  • the TurboJPEG change seems to introduce a regression for two jpeg images

Thanks for giving this issue another try to try and get it as part of the 6.2.0 release. Given the review, it looks like more investigation is required so I would not hold the release further.

@dgault dgault added the exclude label Jul 17, 2019
@dgault dgault modified the milestones: 6.2.0, 6.2.1 Jul 17, 2019
@dgault dgault removed this from the 6.2.1 milestone Aug 28, 2019
@melissalinkert
Copy link
Member

I propose to close this in favor of #3505, since all of the files I could find are now configured in https://github.com/openmicroscopy/data_repo_config/pull/442

@dgault dgault closed this Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants