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
RFC: Add Napari viewer to overlay detected spots on images #822
Conversation
@kevinyamauchi Nick says the recent pypi release should be a stable version for us to release against. Does this require any additional updates?
For this, I think show_napari() probably makes sense, and should optionally take an ImageStack, that way we can display the results of filters or spot calls.
Not to my knowledge, but there will be when we get around to our data provenance work in #820
@ttung do you know the answer to this? |
Currently it does take an
It should be good to go, but let me verify. |
I checked and the napari-gui 0.0.5.1 works, but I was just using it and I discovered a bug for certain ImageStack shapes. I'll fix and update in the next day or two. |
@ambrosejcarr I fixed the bug and added support for projected spots along z if the image is also projected along z. Let me know what you think! |
13e9e39
to
fd18a0f
Compare
This looks great. I made some changes so that all tests except those that touch the
I think we could combine this into I also:
I think the parameters for spot calling in the Allen notebook must be way off, because the results look random, but I verified that it works on the ISS notebook. Really nice! Beyond the question around merging some of the logic into the |
Thanks for all the updates and for rebasing. I think all of your changes make sense.
This sounds good to me. I'll implement that tomorrow.
Great! As I mentioned above, I'll move the spot display into the |
Sounds perfect. :-) |
Hey @ambrosejcarr . I just made the changes we discussed. One note about the display of the spots: in the As implemented, one would have to do the following to display spots on a multi round/channel image stack: mp = primary_image.max_proj(Indices.CH, Indices.ROUND)
mp.show_stack_napari(indices={}, spots=decoded) I think this is fairly reasonable, but if we wanted to make it a one liner, I think we would have to do one of the following. Thoughts?
|
Codecov Report
@@ Coverage Diff @@
## master #822 +/- ##
==========================================
- Coverage 87.93% 87.77% -0.17%
==========================================
Files 149 149
Lines 4891 4900 +9
==========================================
Hits 4301 4301
- Misses 590 599 +9
Continue to review full report at Codecov.
|
I think I'd find it most helpful for the stack to not be projected, but to explicitly visualize spots across each round/slice. That would have the benefit of being flexible across multiplex and single-molecule approaches. What are your thoughts on this? I think it's a slightly different use case, but could be easier to implement. I'm happy to help with this if you think it's a good idea. |
I think it's a good idea to display spots on detected round/channels, @ambrosejcarr . I had initially intended to implement it this way, but I wasn't how to extract round and channel for a given feature from the IntensityTable, so some guidance there would be useful! I think there are a few cases we need to consider (see below). What do you think?
|
I can definitely help mock something up here, which would support (1) below. Use cases:
Unsupported use cases:
|
I think your summary captures the use cases, @ambrosejcarr . Looking forward to the mockup of extracting full RCZXY coordinates for features in an |
Great. I'll probably get to this over the weekend. |
I'm going to close this since the referenced functionality was implemented in #928 |
What does this PR do?
This PR is a prototype of using the Napari GUI for viewing detected spots overlayed on an ImageStack. The Napari GUI is still an early prototype, so it does have some bugs/brittle parts, but the performance for viewing spots on 3D volumes is way better than current notebook-based solutions.
There are some more usability updates coming to the Napari GUI (e.g, constrast sliders) that will definitely improve UX. However, the API should remain the same in the near term, so
show_spots_napari()
will still work.Demo
To try the viewer, first
pip install --upgrade napari-gui
and then opentest_napari.ipynb
in the notebooks directory. This demos the Allen Institute smFISH notebook using the Napari viewer. The notebook loads a saved version of the 3D spot detection (allen_decoded) from the notebook directory for convenience (spot detection takes a while). We will nuke this after initial testing.Open questions
show_spots()
method in IntensityTable. Maybe it should go there?