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

Method __init__

monai/apps/detection/transforms/dictionary.py:424–446  ·  view source on GitHub ↗
(
        self,
        image_keys: KeysCollection,
        box_keys: KeysCollection,
        box_ref_image_keys: KeysCollection,
        zoom: Sequence[float] | float,
        mode: SequenceStr = InterpolateMode.AREA,
        padding_mode: SequenceStr = NumpyPadMode.EDGE,
        align_corners: Sequence[bool | None] | bool | None = None,
        keep_size: bool = True,
        allow_missing_keys: bool = False,
        **kwargs: Any,
    )

Source from the content-addressed store, hash-verified

422 """
423
424 def __init__(
425 self,
426 image_keys: KeysCollection,
427 box_keys: KeysCollection,
428 box_ref_image_keys: KeysCollection,
429 zoom: Sequence[float] | float,
430 mode: SequenceStr = InterpolateMode.AREA,
431 padding_mode: SequenceStr = NumpyPadMode.EDGE,
432 align_corners: Sequence[bool | None] | bool | None = None,
433 keep_size: bool = True,
434 allow_missing_keys: bool = False,
435 **kwargs: Any,
436 ) -> None:
437 self.image_keys = ensure_tuple(image_keys)
438 self.box_keys = ensure_tuple(box_keys)
439 super().__init__(self.image_keys + self.box_keys, allow_missing_keys)
440 self.box_ref_image_keys = ensure_tuple_rep(box_ref_image_keys, len(self.box_keys))
441
442 self.mode = ensure_tuple_rep(mode, len(self.image_keys))
443 self.padding_mode = ensure_tuple_rep(padding_mode, len(self.image_keys))
444 self.align_corners = ensure_tuple_rep(align_corners, len(self.image_keys))
445 self.zoomer = Zoom(zoom=zoom, keep_size=keep_size, **kwargs)
446 self.keep_size = keep_size
447
448 def __call__(self, data: Mapping[Hashable, torch.Tensor]) -> dict[Hashable, torch.Tensor]:
449 d: dict[Hashable, torch.Tensor] = dict(data)

Callers 14

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls 3

ensure_tupleFunction · 0.90
ensure_tuple_repFunction · 0.90
ZoomClass · 0.90

Tested by

no test coverage detected