Skip to content

Conversation

@bhashemian
Copy link
Member

@bhashemian bhashemian commented Aug 26, 2022

Fixes #4997

Description

Implements Sobel gradients operators for a given size of kernel.

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • New tests added to cover the changes.
  • Integration tests passed locally by running ./runtests.sh -f -u --net --coverage.
  • Quick tests passed locally by running ./runtests.sh --quick --unittests --disttests.
  • In-line docstrings updated.
  • Documentation updated, tested make html command in the docs/ folder.

Signed-off-by: Behrooz <3968947+drbeh@users.noreply.github.com>
Signed-off-by: Behrooz <3968947+drbeh@users.noreply.github.com>
Signed-off-by: Behrooz <3968947+drbeh@users.noreply.github.com>
Signed-off-by: Behrooz <3968947+drbeh@users.noreply.github.com>
Signed-off-by: Behrooz <3968947+drbeh@users.noreply.github.com>
Signed-off-by: Behrooz <3968947+drbeh@users.noreply.github.com>
Signed-off-by: Behrooz <3968947+drbeh@users.noreply.github.com>
@bhashemian bhashemian marked this pull request as ready for review August 29, 2022 19:03
Signed-off-by: Behrooz <3968947+drbeh@users.noreply.github.com>
@bhashemian bhashemian requested a review from KumoLiu August 31, 2022 16:09
Copy link
Contributor

@KumoLiu KumoLiu left a comment

Choose a reason for hiding this comment

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

It looks good to me, thanks!

Signed-off-by: Behrooz <3968947+drbeh@users.noreply.github.com>
@bhashemian bhashemian enabled auto-merge (squash) September 1, 2022 15:30
@bhashemian
Copy link
Member Author

@wyli @Nic-Ma please let me know if you have any comment here. Thanks

@wyli
Copy link
Contributor

wyli commented Sep 1, 2022

thanks, I thought sobel kernel is always 3x3, why is there a size parameter, and it's unclear to me what sobel gradient is...perhaps a reference here?

@bhashemian
Copy link
Member Author

thanks, I thought sobel kernel is always 3x3, why is there a size parameter, and it's unclear to me what sobel gradient is...perhaps a reference here?

You are right, Sobel kernels are 3x3 but they can be generalized to a larger kernel size with different approaches. You can find a nice writeup on how to derive larger size kernels following the same property of 3x3 Sobel kernels: https://stackoverflow.com/a/41065243

Following the original implementation of HoVerNet, we are going to use 5x5 Sobel kernels in HoVerNet pipeline, and they have implemented kernels similar to this PR. Here is their implementation:
https://github.com/vqdang/hover_net/blob/842964dc5d26ffe196d236d16fad16643a103850/models/hovernet/utils.py#L124-L145
https://github.com/vqdang/hover_net/blob/842964dc5d26ffe196d236d16fad16643a103850/models/hovernet/utils.py#L150

Signed-off-by: Behrooz <3968947+drbeh@users.noreply.github.com>
@wyli
Copy link
Contributor

wyli commented Sep 1, 2022

/build

@bhashemian bhashemian merged commit 8087dc5 into Project-MONAI:dev Sep 1, 2022
@bhashemian bhashemian deleted the sobel branch September 1, 2022 18:15
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.

Sobel gradient calculation transform

3 participants