-
-
Notifications
You must be signed in to change notification settings - Fork 411
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
POC for 1D images (e.g. line plots) #2764
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2764 +/- ##
==========================================
- Coverage 82.04% 82.03% -0.01%
==========================================
Files 486 486
Lines 40483 40495 +12
==========================================
+ Hits 33213 33221 +8
- Misses 7270 7274 +4
Continue to review full report at Codecov.
|
This looks like a lot of fun. Can I select the axis of the slice? X vs Y ? (a custom axis eventually?) |
Yup, hitting the transpose / roll axis buttons now will change what get's sliced, though the sliced plot is always shown horizontally. |
I definitely like the concept of (if the motivation for this POC is fundamentally different than a linescan, let me know!) |
I was actually imaging this as being more generally useful, for example this movie of watching a 1D wave propagate through a medium of variable speed was the reason I made the branch. Note the data here is 2D I can understand if people feel like 1D wave simulation is a bit unique of an application, that isn't so directly tied to imaging, but I do like this functionality a lot for this purpose!! We can definitely let this sit for a while before deciding what to do next, I'm happy using my branch right now. Screen.Recording.2021-05-23.at.4.54.32.PM.mov |
We should probably turn this into an issue, link to the PR and close PR |
This was discussed with the group the other day and there was some support for the use case from @jni, but this PR still needs some work before it is ready to merge. In particular we need to think about other layer types. We might need to watch out for some corner cases too around passing 1D arrays. I have created #3562 to track this idea and will close this now. Please weigh in there if you are interested in this functionality |
Description
Following up on some of the discussion around 1D images from last weeks dev meeting, I put together this very rough and ready PR that does the bare minimum to support 1D plots for the image layer.
The idea is that we'd now allow
viewer.dims.ndisplay=1
and we'd then do 1D slicing on all our layers and 1D rendering. For now I just hacked it together so that the image layer works. It also ignores a lot of additional possible settings, but it is pretty cool.We can discuss whether we like this direction or not, but I'm already planning to make use of this branch with some 1D wave equations simulations I've been playing with where I have a time axis and a 1D plot (so a 2D dataset) but I want to look at 1D plots of it. I also want to use napari-animation to make movies of the wave propagation, so having this include in napari instead of something like matplotlib is very helpful.
Here's a movie of 1D slicing through a 2D image of a cell:
Screen.Recording.2021-05-22.at.5.44.36.PM.mov
Curious what others think cc @tlambert03 @jni @andy-sweet
Type of change
References
How has this been tested?
Final checklist:
trans.
to make them localizable.For more information see our translations guide.