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

Method __init__

monai/apps/detection/transforms/dictionary.py:1236–1250  ·  view source on GitHub ↗
(
        self,
        image_keys: KeysCollection,
        box_keys: KeysCollection,
        box_ref_image_keys: KeysCollection,
        k: int = 1,
        spatial_axes: tuple[int, int] = (0, 1),
        allow_missing_keys: bool = False,
    )

Source from the content-addressed store, hash-verified

1234 backend = RotateBox90.backend
1235
1236 def __init__(
1237 self,
1238 image_keys: KeysCollection,
1239 box_keys: KeysCollection,
1240 box_ref_image_keys: KeysCollection,
1241 k: int = 1,
1242 spatial_axes: tuple[int, int] = (0, 1),
1243 allow_missing_keys: bool = False,
1244 ) -> None:
1245 self.image_keys = ensure_tuple(image_keys)
1246 self.box_keys = ensure_tuple(box_keys)
1247 super().__init__(self.image_keys + self.box_keys, allow_missing_keys)
1248 self.box_ref_image_keys = ensure_tuple_rep(box_ref_image_keys, len(self.box_keys))
1249 self.img_rotator = Rotate90(k, spatial_axes)
1250 self.box_rotator = RotateBox90(k, spatial_axes)
1251
1252 def __call__(self, data: Mapping[Hashable, torch.Tensor]) -> Mapping[Hashable, torch.Tensor]:
1253 d = dict(data)

Callers

nothing calls this directly

Calls 5

ensure_tupleFunction · 0.90
ensure_tuple_repFunction · 0.90
Rotate90Class · 0.90
RotateBox90Class · 0.90
__init__Method · 0.45

Tested by

no test coverage detected