Skip to content

init: starting implementation of ignore_index #8734#8740

Draft
Rusheel86 wants to merge 1 commit intoProject-MONAI:devfrom
Rusheel86:8734-support-ignore-index
Draft

init: starting implementation of ignore_index #8734#8740
Rusheel86 wants to merge 1 commit intoProject-MONAI:devfrom
Rusheel86:8734-support-ignore-index

Conversation

@Rusheel86
Copy link

Fixes #8734

Description

This PR introduces native support for ignore_index in core losses and metrics, as requested. The goal is to allow voxels with specific labels (e.g., padding or unlabeled regions) to be excluded from calculations, which is critical for medical imaging workflows.

Current focus: Implementing masking logic in DiceLoss. Subsequent updates will cover DiceMetric, MeanIoU, and other requested components.

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Breaking change (fix or new feature that would cause existing functionality to change).
  • New tests added to cover the changes.
  • Integration tests passed locally by running ./runtests.sh -f -u --net --coverage.
  • Quick tests passed locally by running ./runtests.sh --quick --unittests --disttests.
  • In-line docstrings updated.
  • Documentation updated, tested make html command in the docs/ folder.

Signed-off-by: Rusheel Sharma <rusheelhere@gmail.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 14, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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 and usage tips.

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.

Feature Request: Support ignore_index / ignore_class in Losses and Metrics

1 participant