-
Notifications
You must be signed in to change notification settings - Fork 4
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
Collect and unify color overlays #473
Conversation
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.
this looks great! This merges the functions as we discusses and tees us up to for the porting to iphub and easier generation of these visualizations.
rescale_intensity( | ||
retardance, | ||
in_range=( | ||
np.min(retardance), |
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 originally had set it up to do np.min(retardance), but maybe the right thing to have here is to clip with (0,max(retardance)). What do you think?
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 the current behavior is an okay start. I think iterating on good default will require testing across a wide range of datasets. I'd like to do this, but I'd vote to keep the scope of this PR tighter.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #473 +/- ##
========================================
+ Coverage 9.49% 9.54% +0.04%
========================================
Files 29 30 +1
Lines 4594 4591 -3
========================================
+ Hits 436 438 +2
+ Misses 4158 4153 -5 ☔ View full report in Codecov by Sentry. |
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.
LGTM! Thanks for unifying the implementations @talonchandler
Paired with
https://github.com/czbiohub-sf/shrimPy/pull/141
, which will close without merging.This PR merges @edyoshikun's color overlays from shrimpy into
recOrder
while making necessary changes to both sets of functions:czyx
-shaped arrays as a single input for compatibility with our parallelization strategy. This required a fairly significant change torecOrder
's handling of dask arrays.channel_order
parameter.The new function signatures are:
det ret_ori_overlay(czyx, ret_max: Union[float, Literal["auto"]] = 10, cmap: Literal["JCh", "HSV"] = "JCh"):
def ret_ori_phase_overlay(czyx, max_val_V: float = 1.0, max_val_S: float = 1.0):
I have tested the new
ret_ori_overlay
on the example datasets (to check the lazy-computed dask arrays), and I've tested both new functions in CI.Notes:
ret_ori_phase_overlay
withJCh
, but I now think that this case is covered byret_ori_overlay
with theJCh
option.recOrder.io.visualization
, and I anticipate this code will move toiphub
.