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

Truncate circular filter in edge case #1227

Merged
merged 1 commit into from
Oct 31, 2023

Conversation

tylerflex
Copy link
Collaborator

If the filter radius was larger than the input array (in pixels) along any dimension, scipy raised an error.

Now, we log a warning and truncate the kernel along that dimension to match the input shape (note that the kernel is odd, so it might be 1 smaller if the input shape is even)

I also added a switch if we want to instead raise, maybe this is unnecessary.

@tylerflex tylerflex changed the base branch from develop to pre/2.5 October 31, 2023 15:39
@tylerflex tylerflex force-pushed the tyler/fix/adjoint/filter/shapes branch from 2653525 to b83cf65 Compare October 31, 2023 15:39
@tylerflex tylerflex added the 2.5 label Oct 31, 2023
@tylerflex tylerflex changed the title Tyler/fix/adjoint/filter/shapes Truncate circular filter in edge case Oct 31, 2023
@tylerflex tylerflex force-pushed the tyler/fix/adjoint/filter/shapes branch 3 times, most recently from 9d714d9 to 277e4aa Compare October 31, 2023 16:01
@tylerflex tylerflex force-pushed the tyler/fix/adjoint/filter/shapes branch from 277e4aa to b6ce8cb Compare October 31, 2023 16:07
Copy link
Collaborator

@e-g-melo e-g-melo left a comment

Choose a reason for hiding this comment

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

Thanks Tyler!

The warning message is pretty clear and will let the user decide to go ahead or change the parameters.

@tylerflex tylerflex merged commit 07a27f2 into pre/2.5 Oct 31, 2023
12 checks passed
@tylerflex tylerflex deleted the tyler/fix/adjoint/filter/shapes branch October 31, 2023 18:33
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.

None yet

2 participants