Add 2D bit-identical test, prune_spurs/degenerate-object coverage - #34
Merged
Conversation
Fix a third crash, found while writing this coverage: a skeleton whose every connected component is a single isolated pixel (no edges anywhere - a legitimate Lee94 output for a tiny/noisy object) crashed skan's Skeleton() constructor with the same "index pointer size 0" error as the junction_cleanup case, but from build_vessel_graph itself, before junction_cleanup or prune_spurs ever run. Guarded the same way: degrade to an empty-features result instead of crashing. A mixed skeleton (a real branch plus a stray isolated pixel elsewhere) is unaffected - only an object whose entire skeleton is isolated points hits this. Test additions: - tests/test_thin_2d.py: TestSkeletonizeComparison, the 2D analogue of test_3d_skimage_comparison.py - "2D output is bit-identical to scikit-image" previously had no test backing it at all. - tests/test_pipeline.py: TestPruneSpursIntegration (single spur removed end-to-end, multi-iteration pruning exposing a second spur, pruning everything away) and TestDegenerateObjects (a bbox touching every array edge, a single-pixel object, a mixed component) - config.extraction. prune_spurs and these edge cases had no pipeline-level coverage before.
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.
Fix a third crash, found while writing this coverage: a skeleton whose every connected component is a single isolated pixel (no edges anywhere - a legitimate Lee94 output for a tiny/noisy object) crashed skan's Skeleton() constructor with the same "index pointer size 0" error as the junction_cleanup case, but from build_vessel_graph itself, before junction_cleanup or prune_spurs ever run. Guarded the same way: degrade to an empty-features result instead of crashing. A mixed skeleton (a real branch plus a stray isolated pixel elsewhere) is unaffected - only an object whose entire skeleton is isolated points hits this.
Test additions: