Skip to content
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

No semantic type for probability maps #295

Open
qin-yu opened this issue Aug 20, 2024 · 0 comments
Open

No semantic type for probability maps #295

qin-yu opened this issue Aug 20, 2024 · 0 comments

Comments

@qin-yu
Copy link
Collaborator

qin-yu commented Aug 20, 2024

Now we have

class SemanticType(Enum):
    """
    Enum class for image types.

    Attributes:
        RAW (str): Reserved for raw images (e.g. microscopy images)
        SEGMENTATION (str): Reserved for segmentation masks
        PREDICTION (str): Reserved for model predictions
        LABEL (str): Reserved for ground truth labels
    """

    RAW = "raw"
    SEGMENTATION = "segmentation"
    PREDICTION = "prediction"
    LABEL = "label"


class ImageType(Enum):
    """
    Enum class for image types.

    Attributes:
        IMAGE (str): Image data
        LABEL (str): Label data
    """

    IMAGE = "image"
    LABEL = "label"

But a prediction from a neural network may not be a probability map, while some functions needs probability maps. The checking now is using:

    if image.semantic_type != SemanticType.PREDICTION:
        gui_logger.warning(
            "The input image is not a boundary probability map. The task will still attempt to run, but the results may not be as expected."
        )

which doesn't guarantee each pixel in image is between 0 and 1. A normalize_01() is usually called somewhere in the code.

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

No branches or pull requests

1 participant