-
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
Imviz: Allow Subset recentering via centroiding #1823
Conversation
Codecov ReportBase: 88.15% // Head: 88.23% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1823 +/- ##
==========================================
+ Coverage 88.15% 88.23% +0.08%
==========================================
Files 95 95
Lines 10279 10343 +64
==========================================
+ Hits 9061 9126 +65
+ Misses 1218 1217 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Love the functionality! I tried with multiple layers and everything worked as expected. |
I thought it would be too confusing to have "Recenter" do update and "Update" also do update. Only having one button that actually updates feel more consistent to me, but I'll defer to UI/UX experts.
I would but I just don't know how to do that. Maybe Kyle knows? 😆 |
Pushed a commit that'll do this (feel free to rename anything)
I think I agree with this, but also see how it might be useful to have feedback of what will happen before making the edit (currently irreversibly). Another option might be to have non-editable text in the plugin for the "proposed" changes to the subset information that updates in real time as the data selection or subset position is moved... but then we'd have that information in 3 different places in the plugin which might cause some confusion. I think it would also be useful to have the data dropdown default to the top layer... but that might be a more general improvement to the data dropdown component itself and out-of-scope here? |
in the app-level toolbar. It might not show some static regions loaded | ||
via the API unless an interactive region is drawn after. |
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.
is there an issue filed for fixing this?
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 don't remember, maybe @rosteen does. It only happens if you load things like Space Invader (which turns into masked subset), so 99% of users will never even encounter this.
reg = _get_region_from_spatial_subset(self, self.subset_selected) | ||
aperture = regions2aperture(reg) |
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.
would it be useful to move this into the component itself for re-use - so self.subset_select.aperture
or self.subset_select.to_aperture()
? Or would it have a place upstream in glue-astronomy?
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 think this will eventually move upstream. At least Larry or I added a few of these in that table.
Having the tab open is very useful thank you! |
@@ -22,6 +22,29 @@ | |||
</v-col> | |||
</v-row> | |||
|
|||
<!-- Sub-plugin for recentering of spatial subset (Imviz only) --> | |||
<v-row v-if="config=='imviz' && is_editable"> | |||
<v-expansion-panels accordion v-model="subplugins_opened"> |
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.
Magical. Thanks, Kyle!
I wanted that a long time ago but never got it to work. See #743 |
I don't see how that is useful without visual feedback. You see the numbers keep changing but the subset is not moving. How do you know it is moving in the right direction? |
@kecnry and @camipacifici , have I sufficiently addressed/answered your comments/questions? |
I would Guess that if the user sees it moving once in the right direction they will know it is going in the right direction when seeing the numbers change. And they could still update at any time. |
If I understood correctly, now I can keep pressing recenter, but nothing happens and there is no instructions that I have to update before I can recenter again (or maybe I missed it?). User might think that centroiding has converged, while it has not. |
One option around this might be to have the recenter button immediately update the subset but to cache the old version and have a "revert/undo" button that can undo the latest step in case the user doesn't like the changes? |
I like the solution, if you think it will not be confusing for the user to have an "undo" button only here (and in the zoom tool right?), but not everywhere. |
Then what do we do with the Update button? I am getting a little worried. |
No harm would be done if the user clicks "update" again, right? But maybe @Jenneh would have some ideas to make the different use-cases intuitive. Or maybe we're overthinking and recentering will almost never do anything "wrong" and so we can just immediately update the subset without having to worry about the user wanting to reject the proposed changes? |
for Imviz only. Fix GUI update and dithered use case.
Increase test coverage.
It's Friday and it appears I am outvoted 2-to-1, so I went ahead and changed the Recenter button to also Update. |
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.
Recentering itself seems to work as expected! But I guess subplugins_opened
needs to be Any
in order to accept None
when closed 🤷 (sorry I missed that earlier).
There is some UI flashing when updating the subset, but that appears even with the manual entry so can probably be considered out of scope. Also out of scope - this is another case where making the layer/data dropdowns intelligent about the top layer (either by having a "top layer" option in the dropdown, having them default, or show a warning when selecting something that is not the top layer) would be quite useful!
Co-authored-by: Kyle Conroy <[email protected]>
Thanks! I applied your suggested fix. |
I agree! |
Works well! Thank you! |
But top layer in which viewer? 😉 Pondering for another day. I'll count Cami's comment as second approval and merge. Thanks, all! |
I was too slow in testing this, but for what it's worth I also approve 😆. I like the immediate update on hitting the recenter button. |
Description
Implements centroiding of Subset in Imviz.
This pull request also shows a proof-of-concept notebook on how we might be able to edit Subset objects programmatically in a fun way.
If you know of a better way to do this, please let me know.Click here to watch it in action. (YouTube video)
Address part of #1442
Example workflow
At the beginning, an imperfectly centered Subset was drawn. Clicking on Recenter button will take you to the second screenshot.
Subset is moved. Editable fields (desired) agree with static fields (actual).
After about 10 iterations of this (recenter, recenter, ...), it finally converged; i.e., clicking "Recenter" will not change anything. Note that for some sources (e.g., crowded or noisy fields), it may never converge.
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.