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
[ENH] Update binarize_img for negative value handling #4121
Conversation
Add `two_sided` argument with argument deprecation warning
👋 @smeisler Thanks for creating a PR! Until this PR is ready for review, you can include the [WIP] tag in its title, or leave it as a github draft. Please make sure it is compliant with our contributing guidelines. In particular, be sure it checks the boxes listed below.
For new features:
For bug fixes:
We will review it as quick as possible, feel free to ping us with questions if needed. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4121 +/- ##
=======================================
Coverage 91.81% 91.81%
=======================================
Files 144 144
Lines 16172 16173 +1
Branches 3360 3360
=======================================
+ Hits 14849 14850 +1
Misses 781 781
Partials 542 542
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ 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.
Thx ! LGTM overall.
Co-authored-by: bthirion <bertrand.thirion@inria.fr>
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, thx !
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.
Thanks @smeisler ! Minor things
Co-authored-by: Yasmin <63292494+ymzayek@users.noreply.github.com>
Co-authored-by: Yasmin <63292494+ymzayek@users.noreply.github.com>
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.
Thanks for the quick changes. LGTM. Last thing then I think it should be good to go
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.
Awesome thx! Once the CI finishes and is green, will merge
Addresses #3467.
This change introduces the
two_sided
argument forbinarize_img
which allows users to control whether thethreshold
is applied to the original value of the image (two_sided=False
) or absolute value of the image (two_sided=True
). The behavior does not change from what is was (two_sided
was alwaysTrue
), but I think it should change to default toFalse
as it is more intuitive when thresholding images with negative values.I am also interested in expanding the function to include multiple operators (less than, more than, etc), but figured this is a good place to start that addresses the linked issue.