DeepLearningExamples icon indicating copy to clipboard operation
DeepLearningExamples copied to clipboard

fix(nnUNet): Correct background mask in BraTS preprocessor

Open Flink-ddd opened this issue 8 months ago • 1 comments

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

Flink-ddd avatar Jun 10 '25 08:06 Flink-ddd