docs(frangi_math): correct frangi() polarity docstring — bright vessels on dark#255
Merged
Merged
Conversation
…ls on dark, λ₂/λ₃ ≤ 0 The ``frangi()`` docstring had the eigenvalue polarity reversed on both halves: - Said "Bright structures (positive λ₂, and positive λ₃ in 3D) are zeroed" — but bright structures have NEGATIVE λ₂/λ₃ (the image curves downward outward from a bright center, so the second derivative perpendicular to a bright tubular structure is negative). The code zeros where λ₂/λ₃ are POSITIVE, which is the dark-on-bright case. - Said "Frangi assumes vessels are darker than background" — but this implementation is tuned for bright vessels on dark background, matching nellie's typical use case (fluorescence microscopy of bright mitochondria on dark cytoplasm). Code is correct; only the docstring was misleading. Updated attribution: dark structures (positive λ₂/λ₃) are zeroed; bright structures (λ₂ ≤ 0, and λ₃ ≤ 0 in 3D) are kept. Added a one-line explanation of the second-derivative reasoning so a future reader doesn't have to re-derive it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Docstring-only fix. The
frangi()function innellie/segmentation/frangi_math.pyhad the eigenvalue polarity reversed on both halves of its returns block:Code is correct. Only the docstring text changed; one-line reasoning added so a future reader doesn't have to re-derive the second-derivative convention.
Test plan
🤖 Generated with Claude Code