MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / __init__

Method __init__

monai/transforms/post/dictionary.py:501–513  ·  view source on GitHub ↗

Args: keys: keys of the corresponding items to be stack and execute ensemble. if only 1 key provided, suppose it's a PyTorch Tensor with data stacked on dimension `E`. output_key: the key to store ensemble result in the dictionary. if

(self, keys: KeysCollection, output_key: str | None = None, num_classes: int | None = None)

Source from the content-addressed store, hash-verified

499 backend = VoteEnsemble.backend
500
501 def __init__(self, keys: KeysCollection, output_key: str | None = None, num_classes: int | None = None) -> None:
502 """
503 Args:
504 keys: keys of the corresponding items to be stack and execute ensemble.
505 if only 1 key provided, suppose it's a PyTorch Tensor with data stacked on dimension `E`.
506 output_key: the key to store ensemble result in the dictionary.
507 if only 1 key provided in `keys`, `output_key` can be None and use `keys` as default.
508 num_classes: if the input is single channel data instead of One-Hot, we can't get class number
509 from channel, need to explicitly specify the number of classes to vote.
510
511 """
512 ensemble = VoteEnsemble(num_classes=num_classes)
513 super().__init__(keys, ensemble, output_key)
514
515
516class GenerateHeatmapd(MapTransform):

Callers

nothing calls this directly

Calls 2

VoteEnsembleClass · 0.90
__init__Method · 0.45

Tested by

no test coverage detected