Project-MONAI / MONAI

AI Toolkit for Healthcare Imaging

Home Page:https://monai.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue: Similar Transform Names with Different Functionalities

chezhia opened this issue · comments

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.

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.