MCPcopy Index your code
hub / github.com/Project-MONAI/MONAI / label_union

Function label_union

monai/utils/misc.py:696–705  ·  view source on GitHub ↗

Compute the union of class IDs in label and generate a list to include all class IDs Args: x: a list of numbers (for example, class_IDs) Returns a list showing the union (the union the class IDs)

(x: list | np.ndarray)

Source from the content-addressed store, hash-verified

694
695
696def label_union(x: list | np.ndarray) -> list:
697 """
698 Compute the union of class IDs in label and generate a list to include all class IDs
699 Args:
700 x: a list of numbers (for example, class_IDs)
701
702 Returns
703 a list showing the union (the union the class IDs)
704 """
705 return list(set.union(set(np.array(x).tolist())))
706
707
708def prob2class(x: torch.Tensor, sigmoid: bool = False, threshold: float = 0.5, **kwargs: Any) -> torch.Tensor:

Callers 1

__call__Method · 0.90

Calls 1

arrayMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…