Refactor Bio-Formats reading code#2134
Merged
Merged
Conversation
Attempt to recover from more tile request failures. Original issue could be replicated by opening a highly-multiplexed image (using Bio-Formats) and creating a thresholder. Adjusting the threshold and/or smoothing would result in many tile requests in quick succession, with interrupts to pending requests. This caused 2 issues: - ClosedChannelExceptions, which broke the Bio-Formats reader (which was cached for reuse, so this was a big problem) - Exceptions could become stored in AbstractTileableImageServer, so were returned even when the situation had been 'fixed'. This PR improves things by making sure the Bio-Formats reader is open and has the correct ID, and by 'forgetting' failed tiles more readily.
Trying to split it up into more manageable pieces...
A step towards protecting access to all IFormatReader instances.
Failed tests remain a mystery (working locally)
Still trying to figure out what's going wrong
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Major refactoring of the code used to read images using Bio-Formats.
The main goal was to split up large methods into smaller methods and classes to improve maintainability and help track down bugs.
The most problematic bug occurred whenever adjusting thresholds interactively on (usually highly-multiplexed) images: thread interrupts could cause exceptions at inopportune moments. This can still occur, but the updated code should be able to recover (whereas the previous code could repeatedly throw exceptions until QuPath was restarted).
One major change was the introduction to
SynchronizedImageReaderso there is far less exposure of classes from Bio-Formats itself. It is still possible to grab anOMEPyramidStoreand modify it unwisely, but it's not possible/much harder to get theIFormatReaderitself.Along the way, some improvements (hopefully) were made to ROI reading, but I lack good data to check this with.
Otherwise, I've tried to preserve compatibility with recent QuPath releases - but more testing will be needed to ensure this has been successful.