-
Notifications
You must be signed in to change notification settings - Fork 311
More control to show/hide objects based on class (& other criteria) #1752
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
Conversation
Support regex for filtering, code cleanup
Use nanoseconds for timestamp - this reduces the risk that changes are missed
When a classification is hidden, hide all derived classifications that contain the same names - and represent this with an `X` icon.
Add 'Add...' and 'Remove' buttons, splitting out context menus and helping address qupath#1644
I've made further changes & tried to tackle #1644 There are now buttons to add & remove classifications. This makes it easier for users to find and means that the right-click popup menus can be much shorter. Classification toggling is now more clearly defined - as shown in the screenshots. An icon with an open eye will indicate the classification is visible, an eye with a stroke will indicate it is not. Taking an example of Similarly hiding This is the same for multiplexed images, where classifications often have multiple parts. It is assumed that, most of the time, all the possible combinations won't be shown in this list: usually the list will have 'single' classifications, one for each marker (and not for combinations of markers). Taking an example of But derived classifications can be shown, as in this screenshot: Setting a derived classification to be hidden means that any object with all the parts of the hidden classification will be hidden. In the screenshot, This is indicated with an The tooltip text attempts to explain this, making the information also available under the context help. This may seem complicated and won't deal with every scenario, but it's the best I've come up with so far. I think it feels intuitive to use, but need more people trying it for longer to be sure of that. Certainly, the v0.5.x behavior didn't feel intuitive to me at all for multiplexed images - because it had much more tortured logic to deal with intensity subclassifications as a special case...
|
The X looks to me like clicking it will delete that class |
Fair, any ideas for a better icon? Easiest if it's from https://fontawesome.com/v5/search?ic=free - but ControlsFX doesn't have all of them, so we're even more restricted than it first appears (unless we add another dependency... or can draw it ourselves) (There's one |
Hi @lauranicolass sorry, missed you’d posted this in between. I quite like the circle-based icons - and there are more options (checks, crosses, filled, unfilled). Would you replace the eyes entirely? Which icons specifically for each of these 3 conditions?
|
Add edit button to annotation list title
More awkward than it sounds... if we have multiple annotations with different classifications, we need an extra option that doesn't make changes - since otherwise we can't change the name or any other property without also changing the classification
Allows more fine-grained control of which objects are shown, when the other show/hide options are insufficient.
Added This aims to make it possible to control which objects are visible with more detail than any other methods. It should be used sparingly (and triggers a warning in the context help), but can be useful. Example script: Platform.runLater {
var o = getQuPath().getOverlayOptions()
o.setShowObjectPredicate {
p -> p.measurements['Nucleus: Area'] > 100
}
// Call this when done!
// o.resetShowObjectPredicate()
} Although it adds some complexity, I think the benefits may be worth it as it can be very powerful. Here's another example, this time intended for multiplexed images, to show all objects with a neighbor that is CD8 positive (based on a Delaunay triangulation using centroids): Platform.runLater {
var hierarchy = getCurrentHierarchy()
var o = getQuPath().getOverlayOptions()
o.setShowObjectPredicate {
p -> hierarchy.findAllNeighbors(p).find(n -> 'CD8' in n.classifications) != null
}
} |
This looks great! Only question I have is whether the option to be more or less liberal with showing/hiding detections should be a persistent preference |
Thanks! Do you think it should or shouldn't be persistent? Currently it is - although because it's via (Well, it is via |
I err on the side of persistent, yeah - certainly I can imagine grumbling if I always want it one way or the other. Persistent may confuse people who don't realise it's set, but I think that's less problematic given there's good UI indications anyway |
One more thought while you guys are working on this, it would be nice if there were (and may already be, I have not dug through everything) a quick way to filter by derived class length. Be it a sort by length, filter by 0, 1, ... n colons, or what have you. We can already 'Populate' base classes or all classes, but it would be nicer to be able to change and adjust the visibility rather than repopulating the list - especially in cases where not all classes will be present in every image. |
I don't think I understand, but it sounds like it might be possible using the regex feature in the filter field under the list of classifications. Or using the new predicate option of May need to be more related changes in a day or two after we've used this a bit more (and been annoyed by its limitations) |
Ah, if the filter accepts regex, then it is definitely already possible. |
This PR cleans up the classification list and introduces icons so that it is easier to see that visibility can be toggled.
We still need to figure out what the right behavior is when toggling...