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

Method __init__

monai/transforms/compose.py:256–281  ·  view source on GitHub ↗
(
        self,
        transforms: Sequence[Callable] | Callable | None = None,
        map_items: bool | int = True,
        unpack_items: bool = False,
        log_stats: bool | str = False,
        lazy: bool | None = False,
        overrides: dict | None = None,
    )

Source from the content-addressed store, hash-verified

254 """
255
256 def __init__(
257 self,
258 transforms: Sequence[Callable] | Callable | None = None,
259 map_items: bool | int = True,
260 unpack_items: bool = False,
261 log_stats: bool | str = False,
262 lazy: bool | None = False,
263 overrides: dict | None = None,
264 ) -> None:
265 LazyTransform.__init__(self, lazy=lazy)
266
267 if transforms is None:
268 transforms = []
269
270 if not isinstance(map_items, (bool, int)):
271 raise ValueError(
272 f"Argument 'map_items' should be boolean or int. Got {type(map_items)}."
273 "Check brackets when passing a sequence of callables."
274 )
275
276 self.transforms = ensure_tuple(transforms)
277 self.map_items = map_items
278 self.unpack_items = unpack_items
279 self.log_stats = log_stats
280 self.set_random_state(seed=get_seed())
281 self.overrides = overrides
282
283 @LazyTransform.lazy.setter # type: ignore
284 def lazy(self, val: bool):

Callers

nothing calls this directly

Calls 4

set_random_stateMethod · 0.95
ensure_tupleFunction · 0.90
get_seedFunction · 0.90
__init__Method · 0.45

Tested by

no test coverage detected