Repository navigation
Conversation
DiceHelper/DiceMetric's per_component=True path (per-connected- component Dice via compute_cc_dice) never received the spatial mask that create_ignore_mask builds from ignore_index, while the regular per-channel path already applies it. compute_cc_dice has no mask parameter at all, so combining per_component=True with ignore_index silently computed TP/FP/FN over the "ignored" voxels as if nothing were ignored, with no validation or warning. Threads the mask into compute_cc_dice: ignored voxels are forced to agree as background in both y and y_pred before the connected- component assignment and histogram, so they never contribute to a component's score, consistent with how masking works in the non-per_component path. Reachable via the public API: DiceMetric(per_component=True, ignore_index=N)(y_pred, y). No existing test exercised this combination. Signed-off-by: Siddhardha Nanda <99672439+SID-6921@users.noreply.github.com>
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to
|
for more information, see https://pre-commit.ci
This branch has not been deployed
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
DiceHelper/DiceMetric'sper_component=Truepath never received the spatial maskcreate_ignore_maskbuilds fromignore_index—compute_cc_dicehas no mask parameter at all, so combiningper_component=Truewithignore_indexsilently computed TP/FP/FN over the "ignored" voxels as if nothing were ignored. The regular per-channel path already applies this mask correctly; only the per-component path was missing it.Fix threads the mask into
compute_cc_dice: ignored voxels are forced to agree as background in bothyandy_predbefore the connected-component assignment and histogram, so they never contribute to any component's score — consistent with how the non-per_component path already handles masking.Reachable via the public API:
DiceMetric(per_component=True, ignore_index=N)(y_pred, y). No existing test exercised this combination (checkedtests/metrics/test_compute_meandice.py— separateper_componentandignore_indexcases, never together).Types of changes
./runtests.sh -f -u --net --coverage./runtests.sh --quick --unittests --disttests(ran the targeted test file directly via pytest instead:pytest tests/metrics/test_compute_meandice.py, 22/22 passed; did not run the full repo test runner)