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

Viewers not removed from internal list after closing #38

Closed
petebankhead opened this issue Jan 7, 2017 · 0 comments
Closed

Viewers not removed from internal list after closing #38

petebankhead opened this issue Jan 7, 2017 · 0 comments
Assignees
Labels

Comments

@petebankhead
Copy link
Member

When using multiple viewers, these are stored in an internal list, accessible with

QuPathGUI.getInstance().getViewers()

However, whenever viewers are closed and removed, they remain within the list - when the expectation is that they would be removed. It can be hard to distinguish between viewers that are 'still there' and ones that are not, but the following code does so:

def viewers = qupath.getViewers().collect() // Original list is unmodifiable... so collect
println("Number of viewers: " + viewers.size())

// Remove viewers that are unattached to any scene
viewers.removeAll { it.getView().getScene() == null }
println("Number of viewers attached to scene: " + viewers.size())

In any case, for most users and most uses of QuPath, this does not matter.

Nevertheless, it can cause trouble when scripting with multiple viewers and is a bug that should be fixed.

(Bug encountered and described here)

@petebankhead petebankhead self-assigned this Jan 7, 2017
petebankhead added a commit to petebankhead/qupath that referenced this issue Jan 24, 2018
Scrolling with Ctrl/Cmd pressed now changes the overlay opacity used
with viewers.

When rows/columns are removed from the viewer grid, the viewers no
longer returned from a call QuPathGUI.getViewers() - see
qupath#38
petebankhead added a commit that referenced this issue Feb 14, 2020
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