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

Method __init__

monai/apps/detection/transforms/dictionary.py:652–666  ·  view source on GitHub ↗
(
        self,
        image_keys: KeysCollection,
        box_keys: KeysCollection,
        box_ref_image_keys: KeysCollection,
        spatial_axis: Sequence[int] | int | None = None,
        allow_missing_keys: bool = False,
    )

Source from the content-addressed store, hash-verified

650 backend = Flip.backend
651
652 def __init__(
653 self,
654 image_keys: KeysCollection,
655 box_keys: KeysCollection,
656 box_ref_image_keys: KeysCollection,
657 spatial_axis: Sequence[int] | int | None = None,
658 allow_missing_keys: bool = False,
659 ) -> None:
660 self.image_keys = ensure_tuple(image_keys)
661 self.box_keys = ensure_tuple(box_keys)
662 super().__init__(self.image_keys + self.box_keys, allow_missing_keys)
663 self.box_ref_image_keys = ensure_tuple_rep(box_ref_image_keys, len(self.box_keys))
664
665 self.flipper = Flip(spatial_axis=spatial_axis)
666 self.box_flipper = FlipBox(spatial_axis=self.flipper.spatial_axis)
667
668 def __call__(self, data: Mapping[Hashable, torch.Tensor]) -> dict[Hashable, torch.Tensor]:
669 d = dict(data)

Callers

nothing calls this directly

Calls 5

ensure_tupleFunction · 0.90
ensure_tuple_repFunction · 0.90
FlipClass · 0.90
FlipBoxClass · 0.90
__init__Method · 0.45

Tested by

no test coverage detected