Project-MONAI / tutorials

MONAI Tutorials
https://monai.io/started.html
Apache License 2.0
1.81k stars 675 forks source link

ConvertToMultiChannelBasedOnBratsClassesd might be wrong #1355

Open guopengf opened 1 year ago

guopengf commented 1 year ago

Describe the bug

This Class ConvertToMultiChannelBasedOnBratsClassesd is used in brats_training_ddp.py and brats_segmentation_3d.ipynb. It may map the label data to wrong classes. According to its docstring, it describes that label 2 is the GD-enhancing tumor, and label 3 is the non-enhancing tumor core.

image

However, the json file in this downloaded dataset describes that label 2 is the non-enhancing tumor and label 3 is the GD-enhancing tumor.

To Reproduce

Download the dataset by from the official website or call monai.apps.DecathlonDataset(task="Task01_BrainTumour"). Find the dataset.json. image

Expected behavior N/A

Screenshots I also visually verified labels. It seems like json file is right. label 2 should be the non-enhancing tumor and label 3 should be the GD-enhancing tumor. image

Environment (please complete the following information):

Additional context Add any other context about the problem here.

wyli commented 1 year ago

agreed, it seems this version of the transform is correct https://github.com/Project-MONAI/MONAI/blob/a1c437111a511d17dcd0e04d491747f6677f4def/monai/transforms/utility/array.py#L1078-L1086 which is not needed for the dataset used in the tutorials. however we can still use this as an example of customized transforms, with revised docstrings cc @Nic-Ma @myron

25benjaminli commented 8 months ago

If this is true, it seems like quite a significant problem.