-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
ImageFilter's filter_size
arg
#8127
Comments
EloiNavet
added a commit
to EloiNavet/MONAI
that referenced
this issue
Nov 4, 2024
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.
EloiNavet
added a commit
to EloiNavet/MONAI
that referenced
this issue
Nov 6, 2024
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]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
The docs say that NotImplementedError will be raised "when filter is a string and not in self.supported_filters". When I try to initialize a Gaussian filter with no
filter_size
arg, I get "ValueError:filter_size
must be specified when specifying filters by string.". When I print out the support filters for ImageFilter, I get ['elliptical', 'gauss', 'laplace', 'mean', 'median', 'savitzky_golay', 'sharpen', 'sobel'].To Reproduce
Steps to reproduce the behavior:
Expected behavior
When initializing a Gaussian filter, I shouldn't need to pass the
filter_size
arg.Screenshots
n/a
Environment
Python 3.12.3
Ensuring you use the relevant python executable, please paste the output of:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: