Fix kernel to be symetric and properly spheroid#609
Open
matham wants to merge 1 commit intobrainglobe:mainfrom
Open
Fix kernel to be symetric and properly spheroid#609matham wants to merge 1 commit intobrainglobe:mainfrom
matham wants to merge 1 commit intobrainglobe:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
What is this PR
Why is this PR needed?
I noticed a bit of wonkiness in the kernel of the ball filter. I'm not sure how much of this intentional, so this PR edits it to how I would naively think the kernel should look so we can see if/what needs to change.
Primarily the issues I noticed is
odd, things look okay. But when it'sevenit's not symmetric and further it's a bit offset from where the center (centre 😉) should be between voxels. So the filtered data gets a bit shifted.xyradius. So if thezradius is larger, it's essentially clipped to the xy radius instead of being a spheroid.Following I printed out the kernel values so you can get a sense of what it's doing:
This gives for
main:You can see how skewed the kernel gets in either direction when
xyis significantly different thanz.What does this PR do?
I changed the sphere shape to be properly spheroid and to be centered between voxels when the kernel is even.
With this PR, the printout is instead:
References
Please reference any existing issues/PRs that relate to this PR.
How has this PR been tested?
I added a test that checks for symmetry.
Is this a breaking change?
In a way it's a break, because the kernel size parameter would behave a bit differently for
evenkernels and whenxyis different thanz.Does this PR require an update to the documentation?
No.
Checklist: