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

Merged
merged 5 commits into from
Nov 7, 2024

Conversation

EloiNavet
Copy link
Contributor

@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?

@KumoLiu KumoLiu requested review from ericspod and Nic-Ma November 6, 2024 03:18
@EloiNavet EloiNavet force-pushed the fix-imagefilter-gaussian branch from 97204c5 to 82715cb Compare November 6, 2024 10:38
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]>
@EloiNavet EloiNavet force-pushed the fix-imagefilter-gaussian branch from 1fecaac to fb5be1c Compare November 6, 2024 10:46
@KumoLiu
Copy link
Contributor

KumoLiu commented Nov 7, 2024

/build

@KumoLiu KumoLiu enabled auto-merge (squash) November 7, 2024 03:54
@KumoLiu
Copy link
Contributor

KumoLiu commented Nov 7, 2024

/build

@KumoLiu KumoLiu merged commit 530cc1f into Project-MONAI:dev Nov 7, 2024
28 checks passed
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