-
Notifications
You must be signed in to change notification settings - Fork 2
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
Tooltip when hovering over atlas images #85
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #85 +/- ##
==========================================
+ Coverage 97.05% 97.30% +0.25%
==========================================
Files 7 7
Lines 339 371 +32
==========================================
+ Hits 329 361 +32
Misses 10 10
☔ View full report in Codecov by Sentry. |
a4e7c7f
to
989e7f3
Compare
989e7f3
to
f725498
Compare
tooltip does not need to depend on annotation improve docstrings
9301da5
to
d134d0d
Compare
@alessandrofelder this works for me, but for some reason the brain region tooltip is displayed with an offset. The other tooltips in the widget work fine. |
@@ -15,23 +18,40 @@ class NapariAtlasRepresentation: | |||
mesh_opacity: float = 0.4 | |||
mesh_blending: str = "translucent_no_depth" | |||
|
|||
def __post_init__(self) -> None: | |||
"""Setup a custom QLabel tooltip and enable napari layer tooltips""" | |||
self._tooltip = QLabel(self.viewer.window.qt_viewer.parent()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line produces a deprecation warning:
FutureWarning: Public access to Window.qt_viewer is deprecated and will be removed in
v0.5.0. It is considered an "implementation detail" of the napari
application, not part of the napari viewer model. If your use case
requires access to qt_viewer, please open an issue to discuss.!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes - I don't think we have a nice way around this if we want a tooltip until napari allows custom layer tooltips. It's something that should be easy to contribute to napari before 0.5.0 and then fix here, but better to get the tool to users earlier, I think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, but is there an ETA for v0.5.0? If it's soon, then we'll have an issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from a zulip convo in June, it's not soon, but I could be wrong.
Thanks, that offset shouldn't be as big! I'll try to fix! |
Description
What is this PR
Why is this PR needed?
Being able to display the region info when hovering over any atlas image in 2d is a sought-after feature.
What does this PR do?
(This PR is a workaround until napari allows developers to provide custom tooltips for the selected layer. We can track this sort of thing in meta-issue #87)
An initial implementation of a layer tooltip.
brainreg-segment
displays as helpnapari_atlas_representation
constructor switches on all layer tooltips in napariReferences
Closes #26
How has this PR been tested?
Two additional tests added that cover added functionality
Existing tests pass
Manual testing looks reasonable
Is this a breaking change?
No
Does this PR require an update to the documentation?
Opened an issue in the docs brainglobe/brainglobe.github.io#59
Checklist: