Project-MONAI / MONAI

AI Toolkit for Healthcare Imaging
https://monai.io/
Apache License 2.0
5.8k stars 1.07k forks source link

Issue: Similar Transform Names with Different Functionalities #7800

Open chezhia opened 5 months ago

chezhia commented 5 months ago

Description The NormalizeLabelsInDatasetd transform defined here and the NormalizeLabeld transform defined here have very similar names but perform entirely different functions. This can cause confusion, especially when both are likely to be used in a MONAI Label workflow.

NormalizeLabelsInDatasetd:

Creates a label matrix according to what is defined in the label dictionary. Sets undefined labels in the mask to zero (background). NormalizeLabeld:

By default, changes the mask file so that all labels greater than zero become 1. Impact Having such similarly named transforms with entirely different functionalities can lead to significant confusion and potential errors in workflows. The MONAI documentation currently lacks clear definitions for these transforms, making the situation particularly challenging for users.

Suggestion To improve clarity and prevent potential misuse, I propose the following:

Rename NormalizeLabeld to a more descriptive name that reflects its functionality of converting all non-zero labels to one. This would distinguish it clearly from NormalizeLabelsInDatasetd.

Update the MONAI documentation to include clear definitions and examples for both transforms, ensuring that users can easily understand the differences and appropriate use cases for each.

By implementing these changes, we can enhance the usability and clarity of the MONAI Label workflows, reducing the risk of errors and improving user experience.

KumoLiu commented 5 months ago

Hi @chezhia, thanks for your interesting and suggestion here.

Agree that we should always be careful and precise with naming. The transforms under apps are typically designed for specific applications and have not yet been perfectly categorized under core transforms. We need to revise these transforms later.

Thanks.