-
-
Notifications
You must be signed in to change notification settings - Fork 473
[WIP] Histogram with 2-way LUT control #675
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
Conversation
|
This is phenomenal @tlambert03!! Very nice to see the histograms / line plots done with vispy, this makes me very excited about #516 and supporting more general 1D plotting in the main canvas. We're also getting more and more requests for supporting multiple vispy canvases simultaneously, either for linked ortho-views, or a linked grid mode, or link image + timeseries displays. If we go down that road does it sense then to consider this histogram view as a special case of some of that stuff and display it in a second canvas next to / under the main image, rather then say in some entirely separate window. I wouldn't want to hold this PR up unnecessarily though, and starting with it in a separate pop-up window might be the easiest, but curious about your thoughts around multi-canvas mode |
|
Just dropping by to say 😍 |
yeah, the canvas is pretty much a thin subclass on vispy's
possibly... One of the reasons I made it as a Qt widget instead of just a vispy canvas is to add some interactivity features (like the mouse cursor changing when you hover over the gamma or clim handles). I don't know how to do that in vispy alone (but it might be possible... or maybe the couple things requiring Qt aren't worth it and we can refactor). That said, the multi-canvas thing could potentially just be implemented as a QGridLayout, and it wouldn't really matter whether each item in the grid was a vispy canvas, or a QWidget (provided the widget had a black background and blended in seamlessly to the larger view)
I do think it's worth thinking about up front. If you guys feel like depending on Qt limits the flexibility of the 1D plotting "widget", let me know and I'll look into keeping it strictly as a vispy canvas. (at the possible cost of a bit of interactivity) |
I don't have a strong opinion about this, but imho having it be a Qt widget makes sense. I think @royerloic would prefer a drawer to a pop-up, but other than that it makes sense to have it be a Qt Widget right now. Let's just be careful to have a separate model with the required data, and the view/controller Qt stuff is fine. |
yeah I'd much prefer a drawer as well. I think napari should generally avoid pop-up glut. |
It's one of our founding principles. =D |
you have all the best founding principles 😉 |
|
I've got no problem with using the I think we will also want to make sure that we keep some sense of model / view separation though, and maybe having some model of the histogram that has no Using the |
|
Great work @tlambert03 ! second @jni that we want to avoid popups and/or extra windows, A few comments and ideas: |
|
Thanks @royerloic for your helpful input! I added a vertical layout flag to the histogram... and will definitely add a LUT bar soon. I tried to tighten up the margins as much as possible; the layouts are pretty flexible and resize well to whatever space we put them in (the vertical orientation still feels a bit weird but that can change). I also added some logic to link the histogram model to the I also started to abstract some of the ideas into a more general
|
Codecov Report
@@ Coverage Diff @@
## master #675 +/- ##
==========================================
- Coverage 82.87% 80.32% -2.56%
==========================================
Files 152 159 +7
Lines 15295 15785 +490
==========================================
+ Hits 12676 12679 +3
- Misses 2619 3106 +487
Continue to review full report at Codecov.
|
|
This pull request has been mentioned on Image.sc Forum. There might be relevant details there: |
|
Hi @tlambert03, I am wondering if there are plans to further some of the good works you did here. Plotting infrastructure, including live plotting, would be very useful for the dock_widget plugins. |
|
hi @dongyaoli10x, |
One option that we have available to us as of If we love the direction its going then maybe we fold the repo into master or maybe just make it a required dependency.
I love this idea too!!! Could be done in this new repo also. |
|
Yep, I love love love the idea of a napari-plots plugin. |

Description
Still a lot that needs to be done, but I wanted to show a quick example of a working histogram widget. The widget is implemented using only vispy and Qt, and has 2-way data-binding with the
contrast_limitsandgammasliders of a given layer. I know there's been discussion about how/where this sort of thing would go (drawer? dockable? etc...), and this widget is agnostic to those implementations.Type of change
How has this been tested?
Final checklist: