Skip to content

Use connectivity for foreground components - #60

Draft
Mirochill wants to merge 2 commits into
Project-MONAI:mainfrom
Mirochill:fix-56-foreground-connectivity
Draft

Mirochill wants to merge 2 commits into
Project-MONAI:mainfrom
Mirochill:fix-56-foreground-connectivity

Conversation

@Mirochill

Copy link
Copy Markdown

Summary

  • build a SciPy labeling structure from MorphologyOps.connectivity before calling ndimage.label()
  • add a regression showing diagonal foreground pixels stay separate with connectivity 1 and merge with connectivity 2

Fixes #56

Validation

  • git diff --check HEAD~1..HEAD
  • rg -n "generate_binary_structure|test_foreground_component_uses_connectivity|ndimage\\.label\\(self\\.binary_map" MetricsReloaded/utility/utils.py test/test_utility/test_utils.py
  • Not run locally: test suite

@coderabbitai

coderabbitai Bot commented May 25, 2026 •

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Mirochill

Copy link
Copy Markdown
Author

Merged current upstream and preserved the expanded documentation and renamed test imports while reapplying connectivity-aware labeling. All 24 utility tests pass, including the diagonal-connectivity regression. Existing unrelated SyntaxWarnings remain in upstream metric docstrings.

Updated in b5078e0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MorphologyOps.foreground_component() ignores connectivity parameter, always uses 1-connectivity

1 participant