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

stretch histogram support multi-select #2582

Merged
merged 2 commits into from
Nov 29, 2023

Conversation

kecnry
Copy link
Member

@kecnry kecnry commented Nov 29, 2023

Description

This pull request generalizes and approves the stretch histogram's support for the new separate multiselect modes introduced in #2574 - the stretch curve and colorbar now works correctly regardless of whether the viewer and/or layer are in multiselect mode, supports multiple viewers selected (in which case vmin/vmax lines are currently shown based on the first entry - we could eventually somehow represent mixed state here somehow, but it isn't clear if that is necessary yet). Note that the entire histogram is hidden if the select layer is a subset OR if multiple layers are chosen.

Change log entry

  • Is a change log needed? If yes, is it added to 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, maintainer
    should 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.

  • Are two approvals required? Branch protection rule does not check for the second approval. If a second approval is not necessary, please apply the trivial label.
  • Do the proposed changes actually accomplish desired goals? Also manually run the affected example notebooks, if necessary.
  • Do the proposed changes follow the STScI Style Guides?
  • Are tests added/updated as required? If so, do they follow the STScI Style Guides?
  • Are docs added/updated as required? If so, do they follow the STScI Style Guides?
  • Did the CI pass? If not, are the failures related?
  • Is a milestone set? Set this to bugfix milestone if this is a bug fix and needs to be released ASAP; otherwise, set this to the next major release milestone.
  • After merge, any internal documentations need updating (e.g., JIRA, Innerspace)?

@kecnry kecnry force-pushed the fix-multi-viewer-stretch-hist branch from 4ca3d82 to 8123f0e Compare November 29, 2023 13:35
@kecnry kecnry added this to the 3.8 milestone Nov 29, 2023
@kecnry kecnry marked this pull request as ready for review November 29, 2023 13:39
Copy link

codecov bot commented Nov 29, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (2746b72) 91.47% compared to head (f672ea3) 91.48%.

Files Patch % Lines
...nfigs/default/plugins/plot_options/plot_options.py 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2582      +/-   ##
==========================================
+ Coverage   91.47%   91.48%   +0.01%     
==========================================
  Files         160      160              
  Lines       19514    19517       +3     
==========================================
+ Hits        17851    17856       +5     
+ Misses       1663     1661       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@javerbukh
Copy link
Contributor

If I change the color of a layer in Imviz while multiple layers are selected and then turn multiselect off, the histogram color is still the previous color.

Copy link
Contributor

@javerbukh javerbukh left a 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! Only question I had is what is the expected histogram behavior when a layer is selected in multiple viewers if it also has different colors? Currently the histogram just picks one of the colors and that's fine, just making sure that is on our radar.

@kecnry
Copy link
Member Author

kecnry commented Nov 29, 2023

Only question I had is what is the expected histogram behavior when a layer is selected in multiple viewers if it also has different colors? Currently the histogram just picks one of the colors and that's fine, just making sure that is on our radar.

Let's kick that down the road a bit (🐱), I think the colorbar still provides some helpful information. It would be nice if all aspects (the stretch curve, vmin/vmax, colorbar, etc) would have some way of representing when they're in mixed state. The alternative would be to not show the histogram at all (or at least disable the curve, vmin/vmax, colorbar) if any of them are mixed.

Copy link
Collaborator

@rosteen rosteen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to work as advertised. I do think it would be useful to enable the histogram for multiple layers, in case a user wants to compare two different images on the same scale. In that case we could do the auto-scaling based on the min across all images and the max across all images. That can be a future discussion/enhancement though.

@kecnry
Copy link
Member Author

kecnry commented Nov 29, 2023

Yep, but then we'd need multiple histograms/colorscales and need to figure out what to do with stretch inputs/representation 🤔

@kecnry kecnry merged commit c014ee9 into spacetelescope:main Nov 29, 2023
24 of 25 checks passed
@kecnry kecnry deleted the fix-multi-viewer-stretch-hist branch November 29, 2023 17:58
@rosteen
Copy link
Collaborator

rosteen commented Nov 29, 2023

I meant a single histogram, where the stretch parameters get applied to multiple layers. I guess there's an additional complication of which layer to use for the histogram bars themselves (or maybe combine all data to generate the histogram). Anyway, discussion for elsewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants