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

Fix ImageFilter to allow Gaussian filter without filter_size #8189

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

EloiNavet
Copy link

@EloiNavet EloiNavet commented Nov 4, 2024

Fixes #8127

Update ImageFilter to handle Gaussian filter without requiring filter_size.

  • Modify monai/transforms/utility/array.py to allow Gaussian filter without filter_size.
    • Adjust _check_filter_format method to skip filter_size check for Gaussian filter. Indeed Gauss filter is the only one in the list that doesn't require a filter_size.
  • Add unit test in tests/test_image_filter.py for Gaussian filter without filter_size.
    • Verify output shape matches input shape.

Note that this method is compliant with the dictionnary version since this one load the fixed version.

Signed-off-by: Eloi [email protected]

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.

Thanks for the PR, LGTM.
Could you please help sign off to solve the DCO error: https://github.com/Project-MONAI/MONAI/pull/8189/checks?check_run_id=32499106258?

EloiNavet and others added 5 commits November 6, 2024 10:46
Fixes Project-MONAI#8127

Update `ImageFilter` to handle Gaussian filter without requiring `filter_size`.

* Modify `monai/transforms/utility/array.py` to allow Gaussian filter without `filter_size`.
  - Adjust `_check_filter_format` method to skip `filter_size` check for Gaussian filter. Indeed Gauss filter is the only one in the list that doesn't require a filter_size.
* Add unit test in `tests/test_image_filter.py` for Gaussian filter without `filter_size`.
  - Verify output shape matches input shape.

Note that this method is compliant with the dictionnary version since this one load the fixed version.

Signed-off-by: Eloi Navet <[email protected]>
To satisfy the linter

Signed-off-by: Eloi <[email protected]>
Signed-off-by: Eloi Navet <[email protected]>
I, Eloi <[email protected]>, hereby add my Signed-off-by to this commit: 79e8aa0

Signed-off-by: Eloi <[email protected]>
Signed-off-by: Eloi Navet <[email protected]>
I, Eloi [email protected], hereby add my Signed-off-by to this commit: 79e8aa0

Signed-off-by: Eloi [email protected]
Signed-off-by: Eloi Navet <[email protected]>
I, Eloi Navet <[email protected]>, hereby add my Signed-off-by to this commit: 82715cb

Signed-off-by: Eloi Navet <[email protected]>
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.

ImageFilter's filter_size arg
3 participants