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

Method randomize

monai/transforms/spatial/array.py:3137–3144  ·  view source on GitHub ↗
(self, spatial_shape: Sequence[int])

Source from the content-addressed store, hash-verified

3135 )
3136
3137 def randomize(self, spatial_shape: Sequence[int]) -> None:
3138 super().randomize(None)
3139 if not self._do_transform:
3140 return
3141 self.distort_steps = tuple(
3142 tuple(1.0 + self.R.uniform(low=self.distort_limit[0], high=self.distort_limit[1], size=n_cells + 1))
3143 for n_cells in ensure_tuple_rep(self.num_cells, len(spatial_shape))
3144 )
3145
3146 def __call__(
3147 self, img: torch.Tensor, mode: str | None = None, padding_mode: str | None = None, randomize: bool = True

Callers 1

__call__Method · 0.95

Calls 2

ensure_tuple_repFunction · 0.90
randomizeMethod · 0.45

Tested by

no test coverage detected