Skip to content

fix(nnUNet): Correct background mask in BraTS preprocessor #1457

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Flink-ddd
Copy link

Hi, Maintainer.

This PR fixes the issue described in #1438.

Problem:
The preprocessing code for the BraTS nnU-Net example was using np.where(image[i] <= 0) to create a background mask. This incorrectly masked out foreground voxels that had negative values after z-score normalization.

Solution:
This fix changes the condition to np.where(image[i] == 0), which correctly identifies only the true background voxels. This ensures the 5th channel mask is generated as intended.

Fixes #1438

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.

[Segmentation/nnUNet/BraTS] wrong preprocessing for the one hot encoding
1 participant