Repository navigation
Add regression test for spherical barycentric resampling fallback - #91
Merged
jnolan14 merged 1 commit intoNov 12, 2026
Merged
Conversation
Covers the [0, 0, 0] "bullet hole" artefact fixed in bc523b6 (PR freesurfer#77): on a source sphere with strongly non-uniform triangle sizes (dense polar caps, coarse equatorial belt, as left by spherical registration), target points inside large triangles next to the dense caps are not found among the k nearest centroids. barycentric_spherical_map() must fall back to the nearest face rather than returning face -1 with zero weights. The neighborhood=3 case fails on the pre-fix code (every constructed target point is left unmapped and resamples to [0, 0, 0]) and passes on master. Also checks that barycentric resampling of a sphere onto itself stays on the sphere. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 0ed3280)
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.
Covers the [0, 0, 0] "bullet hole" artefact fixed in bc523b6 (PR #77): on a source sphere with strongly non-uniform triangle sizes (dense polar caps, coarse equatorial belt, as left by spherical registration), target points inside large triangles next to the dense caps are not found among the k nearest centroids. barycentric_spherical_map() must fall back to the nearest face rather than returning face -1 with zero weights.
The neighborhood=3 case fails on the pre-fix code (every constructed target point is left unmapped and resamples to [0, 0, 0]) and passes after the fix. Also checks that barycentric resampling of a sphere onto itself stays on the sphere.