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

Method __init__

monai/transforms/croppad/array.py:973–984  ·  view source on GitHub ↗
(
        self,
        spatial_size: Sequence[int] | int,
        num_samples: int = 1,
        weight_map: NdarrayOrTensor | None = None,
        lazy: bool = False,
    )

Source from the content-addressed store, hash-verified

971 backend = SpatialCrop.backend
972
973 def __init__(
974 self,
975 spatial_size: Sequence[int] | int,
976 num_samples: int = 1,
977 weight_map: NdarrayOrTensor | None = None,
978 lazy: bool = False,
979 ):
980 LazyTransform.__init__(self, lazy)
981 self.spatial_size = ensure_tuple(spatial_size)
982 self.num_samples = int(num_samples)
983 self.weight_map = weight_map
984 self.centers: list[np.ndarray] = []
985
986 def randomize(self, weight_map: NdarrayOrTensor) -> None:
987 self.centers = weighted_patch_samples(

Callers

nothing calls this directly

Calls 2

ensure_tupleFunction · 0.90
__init__Method · 0.45

Tested by

no test coverage detected