-
Notifications
You must be signed in to change notification settings - Fork 68
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
Fix bugs in per-round-max-decoder #1602
Conversation
c4c6060
to
a29ddc6
Compare
Codecov Report
@@ Coverage Diff @@
## master #1602 +/- ##
==========================================
+ Coverage 87.47% 87.48% +0.01%
==========================================
Files 145 145
Lines 5053 5058 +5
==========================================
+ Hits 4420 4425 +5
Misses 633 633
Continue to review full report at Codecov.
|
a29ddc6
to
b7ba31c
Compare
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 is good, Tony. Can you check the correlation between our results and the ones provided by Mats in the ISS notebook? Interested to know if we do any better, or if this edge case doesn't operate there.
starfish/core/codebook/codebook.py
Outdated
intensities_without_nans = intensities.fillna(0) | ||
max_channels = intensities_without_nans.argmax(Axes.CH.value) | ||
# this snippet of code finds all the (feature, round) spots that have uniform illumination, | ||
# and assigns them to a ch number that's one larger than max possible. |
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.
# and assigns them to a ch number that's one larger than max possible. | |
# and assigns them to a ch number that's one larger than max possible to ensure that. | |
# such spots decode to `nan`. |
b7ba31c
to
735eac9
Compare
1. When the entire row is nan, the decoder chokes. This is remedied by decoding on an array where the nan values are replaced with 0s. 2. When the entire row is of equal intensity, the `np.argmax` arbitrarily picks the first column as the winner. That erroneously decodes as ch=0 having the max intensity. This code detects that scenario, and rewrites the ch to an impossible value in that situation. Test plan: Wrote tests that failed with the existing code, applied fixes and verified that they now work. Fixes #1485
735eac9
to
fd8c098
Compare
np.argmax
arbitrarily picks the first column as the winner. That erroneously decodes as ch=0 having the max intensity. This code detects that scenario, and rewrites the ch to an impossible value in that situation.Test plan: Wrote tests that failed with the existing code, applied fixes and verified that they now work.
Depends on #1600
Fixes #1485