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

Opening the same image in multiple viewers results in detections being wrongly shown in both #1217

Closed
petebankhead opened this issue Jan 25, 2023 · 1 comment
Labels
Milestone

Comments

@petebankhead
Copy link
Member

Bug report

Describe the bug
There's a problem with the tile caching v0.3.2 and v0.4.2 (probably other versions) when using the the same image opened in multiple viewers.

Basically, detections made in one image can show up in the other. The reason is that tiles that show the detections are being cached using the same key in both viewers, because the underlying image files are the same.

To Reproduce

  1. Create a project & add an image
  2. Duplicate the image in the project
  3. Open the original image & its duplicate in different QuPath viewers
  4. Detect cells in a small region in one viewer
  5. Detect cells in a different region in the second viewer
  6. See the cells magically appear in both viewers

Expected behavior
It's possible to work with the same image in multiple viewers.

Screenshots
mixed-viewers

Desktop (please complete the following information):

  • OS: All
  • QuPath Version: v0.4.2 (also v0.3.2 and likely other versions)

Additional context
Because it's a tile caching issue, the problem isn't evident when zoomed in (since the tile cache isn't used to paint detections).

The issue was first reported at https://forum.image.sc/t/qupath-problem-with-showing-detections-in-multi-view/76334/3

The cell counts etc. should be unaffected.

One workaround is to duplicate the underlying image file, so that it has a different key for caching (based upon the file name/path).

@petebankhead
Copy link
Member Author

petebankhead commented Jan 25, 2023

The fix seems straightforward, just to remove the getPath() method from
https://github.com/qupath/qupath/blob/v0.4.2/qupath-gui-fx/src/main/java/qupath/lib/gui/images/servers/PathHierarchyImageServer.java#L151

I'll submit a PR, the main question is whether there will be a v0.4.3 or if the next release will be v0.5.0 (further in the future).

petebankhead added a commit to petebankhead/qupath that referenced this issue Jan 25, 2023
Fixes
* qupath#1217

The problem was the the same 'path' was used as a key for caching tiles from the object hierarchy overlay, whenever the same image was opened in two viewers simultaneously.
@petebankhead petebankhead added this to the v0.4.3 milestone Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant