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

Support sampling kwarg for distance_transform_edt (take pixel/voxel sizes into account) #407

Merged
merged 11 commits into from
Nov 28, 2022

Conversation

grlee77
Copy link
Contributor

@grlee77 grlee77 commented Sep 6, 2022

Please review/merge #406 before this one as those changes are also present here.

This PR adds support for anisotropic pixel/voxel shape to distance_transform_edt via the sampling kwarg. The changes involve just making variants of the kernels involving distance computations that do floating-point instead of integer-valued computations so that scaling by the sample spacings can be taken into account.

@grlee77 grlee77 added improvement Improves an existing functionality non-breaking Introduces a non-breaking change labels Sep 6, 2022
@grlee77 grlee77 added this to the v22.10.00 milestone Sep 6, 2022
@grlee77 grlee77 requested a review from a team as a code owner September 6, 2022 15:30
@jakirkham jakirkham removed this from the v22.10.00 milestone Oct 4, 2022
@gigony gigony added this to the v22.12.00 milestone Oct 4, 2022
@grlee77 grlee77 changed the base branch from branch-22.10 to branch-22.12 October 23, 2022 11:36
Copy link
Contributor

@gigony gigony left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @grlee77 ! Looks good to me.

support user-provided output arrays for distances and indices arrays
avoid duplicate shape/dtype checking code
@grlee77
Copy link
Contributor Author

grlee77 commented Nov 18, 2022

@gigony, I added two commits here after your prior review. These were to support the remaining two keyword arguments allowing the user to specify a pre-allocated output array for distances and/or indices. With that change we now fully match the SciPy API

@grlee77
Copy link
Contributor Author

grlee77 commented Nov 28, 2022

@gpucibot merge

@rapids-bot rapids-bot bot merged commit f355506 into rapidsai:branch-22.12 Nov 28, 2022
rapids-bot bot pushed a commit that referenced this pull request Nov 29, 2022
related to #419

These are based on the distance transform and are a faster way of computing binary morphological operations for large diameter disk or ball footprints. Unlike the sequence footprint decomposition methods, the footprint is exactly circular (spherical).

One test case `test_isotropic_erosion_spacing` will require #407 to be merged first. 

#406 will also improve the performance of this implementation

Authors:
  - Gregory Lee (https://github.com/grlee77)

Approvers:
  - Gigon Bae (https://github.com/gigony)

URL: #421
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improves an existing functionality non-breaking Introduces a non-breaking change
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants