-
Notifications
You must be signed in to change notification settings - Fork 74
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
Imviz: Add simple blink tool #611
Conversation
RTD warning seems unrelated: |
Note that with glue-jupyter 0.5 (#614) you can now give a full path to an icon (before you had to use one of the glue.icons icons). See #613 for an example.
This is because the datasets need to be linked - see #613 for a discussion of this in the description. I think in imviz we should probably link datasets by default. |
It is not intuitive to me that datasets need to be linked to be blinked. I thought linking is only when they have shared data that I want to explore simultaneously. Blinking is just... blinking. Also linking everything might have performance impact if we ended up "loading everything" as requested in #600 . It simply does not make sense to try to link all 14 extensions in a drizzled HST product. |
Blinking requires the images to be registered though, which requires linking. Without this you won't be able to blink images with different WCS. Note that for 14 extensions on the same WCS we can use pixel-wise linking instead of WCS which would be very fast and wouldn't have a performance impact. What DS9 does is assume the WCS is always correct and is effectively doing what I am calling WCS linking between all loaded datasets. |
The thing is... I am not sure if they are. Maybe the first 3. |
I guess my main point is, regardless of what happens during data loading, once Data objects exist with valid WCSes, we can auto-link them and I think we can do it in a way that does not cause performance issues. |
Re: link -- OK, fine. I guess that will be implemented over at #613 anyway, so I think this is ready if no one has a better idea for the icon. |
To be clear #613 only links the data once the pan/zoom icon is clicked. However if a user blinks before hitting that tool then it won't work correctly, so we really should set up the links when data are added to the viewer instead (I can do a separate PR for that). |
Please do, thanks! |
Codecov Report
@@ Coverage Diff @@
## main #611 +/- ##
==========================================
+ Coverage 59.25% 59.36% +0.10%
==========================================
Files 65 65
Lines 3888 3910 +22
==========================================
+ Hits 2304 2321 +17
- Misses 1584 1589 +5
Continue to review full report at Codecov.
|
This doesn't seem to play well with subsets at the moment. With no subsets defined I can blink between the two images. But if I choose a circular region to define a subset, the blinking then switches between the two images and a blank white image with the subset overlayed (actually two blank white images with the subset, I assume one for each original image). It also starts throwing this error:
Another small note, it took me a minute to realize I needed to select both images in the data dropdown to be able to blink between them. Maybe we could display a snackbar message if the user is trying to blink only one image? I think that's an enhancement, not strictly needed here. |
Ops... maybe the code needs to be smart enough to ignore subsets. Also, will it be less confusing if I have the example notebook show both images? It's my bad to set the second one to not show earlier in the development work. |
I just tried deleting |
I think that's to do with no auto-linking. Did you run the cell that says you need to run this to link them first? |
I did run the linking cell, and it doesn't just show up as black when blinking it shows up as black no matter how I display it. It almost seems like the color scaling of the second image loaded is getting locked somehow, such that I can't change it with the |
Confirmed that the solution to this is to deselect and reselect the images from the |
n_visible = len(visible) | ||
|
||
if n_visible == 0: | ||
msg = SnackbarMessage('No visible layer to blink', |
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.
I actually don't know under what condition we will fall into this block but doesn't hurt?
I think I have addressed the issues reported by @rosteen here:
|
Scooby snackbar Co-authored-by: Ricky O'Steen <[email protected]>
The coverage reduction is unavoidable, as this only adds interactive stuff... The rest of CI passed. Is this good enough for approval? |
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.
Glad I caught the branch name before I merged 😂 Looks great!
Fix #520
Out of scope: Nice UI/UX stuff.
TODO