-
Notifications
You must be signed in to change notification settings - Fork 76
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
stretch histogram: handle mixed state #2606
Conversation
9327b46
to
d353080
Compare
if self.layer_multiselect: | ||
data = self.layer.selected_obj[0][0].layer | ||
elif len(self.layer.selected_obj): | ||
data = self.layer.selected_obj[0].layer | ||
else: | ||
if not len(self.layer.selected_obj): | ||
# skip further updates if no data are available: | ||
return | ||
if isinstance(self.layer.selected_obj[0], list): | ||
# multiselect case (but we won't check multiselect since the selection can lag behind) | ||
data = self.layer.selected_obj[0][0].layer | ||
else: | ||
data = self.layer.selected_obj[0].layer |
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 just fixes a weird bug I ran into where changing from multi -> single select which then applies the first selection as default triggered a length error here since self.layer_multiselect
was temporarily out-of-date with the selection. I can split into a separate PR or changelog entry if anyone feels necessary.
Hmm, this doesn't seem to work for me in Cubeviz (see video below). I don't see the mixed state un-mixers, and I get an error traceback if I try to switch to layer B. Screen.Recording.2023-12-12.at.11.40.39.AM.movTraceback:
|
They should only show when the selected layer appears in multiple of the selected viewers AND have mixed state.
Fixed in the latest commit - thanks for catching this! |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #2606 +/- ##
==========================================
- Coverage 91.55% 91.53% -0.02%
==========================================
Files 161 161
Lines 19932 19847 -85
==========================================
- Hits 18248 18167 -81
+ Misses 1684 1680 -4 ☔ View full report in Codecov by Sentry. |
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.
Looks good to me now, approved. I did run into a case where the histogram viewer wasn't resizing when expanding the plugin tray, but I don't think it was caused by this and I haven't been able to reproduce it. I'll keep an eye out to see if it happens again.
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.
Tested in Imviz! Looks good to me!
* single layer but with multiple viewers is supported by the stretch histogram, but could have different values for the curve, and so need to indicate that the state in mixed and have the overlay to unmix.
4696669
to
c634cbf
Compare
currently updating to also handle stretch params (knots) now that #2545 got merged first. |
ac61f1e
to
1c13b97
Compare
This comment was marked as resolved.
This comment was marked as resolved.
* stretch histogram handle mixed state * single layer but with multiple viewers is supported by the stretch histogram, but could have different values for the curve, and so need to indicate that the state in mixed and have the overlay to unmix. * fix traceback in cubeviz when switching layers in multi viewer select
* stretch histogram handle mixed state * single layer but with multiple viewers is supported by the stretch histogram, but could have different values for the curve, and so need to indicate that the state in mixed and have the overlay to unmix. * fix traceback in cubeviz when switching layers in multi viewer select
Description
This pull request implements the "mixed state overlay" for the stretch histogram when ANY of the inputs (stretch function, vmin, vmax, color mode, color, colormap - and knots should be added either her or #2545, whichever is merged second) are mixed and unmixes ALL of them when clicking.
Screen.Recording.2023-12-11.at.4.51.46.PM.mov
Change log entry
CHANGES.rst
? If you want to avoid merge conflicts,list the proposed change log here for review and add to
CHANGES.rst
before merge. If no, maintainershould add a
no-changelog-entry-needed
label.Checklist for package maintainer(s)
This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.
trivial
label.