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

Method __init__

monai/apps/detection/transforms/dictionary.py:159–178  ·  view source on GitHub ↗

Args: box_keys: Keys to pick data for transformation. src_mode: source box mode. If it is not given, this func will assume it is ``StandardMode()``. It follows the same format with ``src_mode`` in :class:`~monai.apps.detection.transforms.array.Convert

(
        self,
        box_keys: KeysCollection,
        src_mode: str | BoxMode | type[BoxMode] | None = None,
        dst_mode: str | BoxMode | type[BoxMode] | None = None,
        allow_missing_keys: bool = False,
    )

Source from the content-addressed store, hash-verified

157 """
158
159 def __init__(
160 self,
161 box_keys: KeysCollection,
162 src_mode: str | BoxMode | type[BoxMode] | None = None,
163 dst_mode: str | BoxMode | type[BoxMode] | None = None,
164 allow_missing_keys: bool = False,
165 ) -> None:
166 """
167 Args:
168 box_keys: Keys to pick data for transformation.
169 src_mode: source box mode. If it is not given, this func will assume it is ``StandardMode()``.
170 It follows the same format with ``src_mode`` in :class:`~monai.apps.detection.transforms.array.ConvertBoxMode` .
171 dst_mode: target box mode. If it is not given, this func will assume it is ``StandardMode()``.
172 It follows the same format with ``src_mode`` in :class:`~monai.apps.detection.transforms.array.ConvertBoxMode` .
173 allow_missing_keys: don't raise exception if key is missing.
174
175 See also :py:class:`monai.apps.detection,transforms.array.ConvertBoxMode`
176 """
177 super().__init__(box_keys, allow_missing_keys)
178 self.converter = ConvertBoxMode(src_mode=src_mode, dst_mode=dst_mode)
179
180 def __call__(self, data: Mapping[Hashable, NdarrayOrTensor]) -> dict[Hashable, NdarrayOrTensor]:
181 d = dict(data)

Callers

nothing calls this directly

Calls 2

ConvertBoxModeClass · 0.90
__init__Method · 0.45

Tested by

no test coverage detected