Skip to content
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

Improved birefringence overlays #426

Merged
merged 14 commits into from
Aug 24, 2023
Merged

Improved birefringence overlays #426

merged 14 commits into from
Aug 24, 2023

Conversation

talonchandler
Copy link
Collaborator

This PR makes the following improvements to the birefringence overlays:

  • overlays are correctly scaled, and a warning appears if the input data's scale is different from the reconstruction scale. This fixes [BUG] GUI-generated layers are incorrectly scaled #418 and replaces Do not convert scale metadata from micromanager #419.
  • overlays are calculated lazily from the most recently added "Retardance*" and "Orientation*" layers via dask arrays. This is enabling for datasets with many timepoints (e.g. recent mantis datasets) where calculating the complete birefringence overlay would crash napari with OOM.
  • an "overlay retardance maximum" slider is now on the visualization tab. Lazy computation enables live updating of the overlay.

The demo gif below demonstrates the main features. Even though I'm only showing a small region, the overlay is being computed for a 2048 x 2048 FOV---the largest we typically use. I estimate the lag time to be 0.1-0.2 seconds, which is noticeable but worth it IMO. You can also "hide" the layer to stop the lazy computation. @ziw-liu and I have discussed plans for 1.0.0 that will allow these computations to happen on a separate thread.
recOrder-demo-overlays2

Thanks @ziw-liu for your help with this.

@codecov
Copy link

codecov bot commented Aug 24, 2023

Codecov Report

Merging #426 (7bd38b7) into main (bbf3502) will decrease coverage by 0.08%.
The diff coverage is 0.00%.

❗ Current head 7bd38b7 differs from pull request most recent head e96576f. Consider uploading reports for the commit e96576f to get more accurate results

@@           Coverage Diff            @@
##            main    #426      +/-   ##
========================================
- Coverage   8.66%   8.58%   -0.08%     
========================================
  Files         26      26              
  Lines       4443    4484      +41     
========================================
  Hits         385     385              
- Misses      4058    4099      +41     
Files Changed Coverage Δ
recOrder/acq/acquisition_workers.py 0.00% <0.00%> (ø)
recOrder/calib/calibration_workers.py 0.00% <0.00%> (ø)
recOrder/io/utils.py 0.00% <0.00%> (ø)
recOrder/plugin/gui.py 0.00% <0.00%> (ø)
recOrder/plugin/main_widget.py 0.00% <0.00%> (ø)

@deprecated-napari-hub-preview-bot
Copy link

deprecated-napari-hub-preview-bot bot commented Aug 24, 2023

Preview page for your plugin is ready here:
https://preview.napari-hub.org/mehta-lab/recOrder/426
Updated: 2023-08-24T18:46:05.919001

@talonchandler talonchandler mentioned this pull request Aug 24, 2023
2 tasks
@talonchandler
Copy link
Collaborator Author

Thanks for your help here @ziw-liu!

@talonchandler talonchandler added this pull request to the merge queue Aug 24, 2023
Merged via the queue into main with commit 8cf7037 Aug 24, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] GUI-generated layers are incorrectly scaled
2 participants