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

Method __init__

monai/transforms/utility/dictionary.py:241–250  ·  view source on GitHub ↗

Args: keys: keys of the corresponding items to be transformed. See also: :py:class:`monai.transforms.compose.MapTransform` channel_dim: which dimension of input image is the channel, default is the first dimension. allow_missing_keys: don'

(self, keys: KeysCollection, channel_dim: int = 0, allow_missing_keys: bool = False)

Source from the content-addressed store, hash-verified

239 backend = AsChannelLast.backend
240
241 def __init__(self, keys: KeysCollection, channel_dim: int = 0, allow_missing_keys: bool = False) -> None:
242 """
243 Args:
244 keys: keys of the corresponding items to be transformed.
245 See also: :py:class:`monai.transforms.compose.MapTransform`
246 channel_dim: which dimension of input image is the channel, default is the first dimension.
247 allow_missing_keys: don't raise exception if key is missing.
248 """
249 super().__init__(keys, allow_missing_keys)
250 self.converter = AsChannelLast(channel_dim=channel_dim)
251
252 def __call__(self, data: Mapping[Hashable, NdarrayOrTensor]) -> dict[Hashable, NdarrayOrTensor]:
253 d = dict(data)

Callers

nothing calls this directly

Calls 2

AsChannelLastClass · 0.90
__init__Method · 0.45

Tested by

no test coverage detected