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

Method randomize

monai/transforms/intensity/array.py:807–812  ·  view source on GitHub ↗
(self, img_size: Sequence[int])

Source from the content-addressed store, hash-verified

805 raise NotImplementedError("only supports 2D or 3D fields")
806
807 def randomize(self, img_size: Sequence[int]) -> None:
808 super().randomize(None)
809 if not self._do_transform:
810 return None
811 n_coeff = int(np.prod([(self.degree + k) / k for k in range(1, len(img_size) + 1)]))
812 self._coeff = self.R.uniform(*self.coeff_range, n_coeff).tolist()
813
814 def __call__(self, img: NdarrayOrTensor, randomize: bool = True) -> NdarrayOrTensor:
815 """

Callers 15

__call__Method · 0.95
__call__Method · 0.45
__call__Method · 0.45
__call__Method · 0.45
__call__Method · 0.45
__call__Method · 0.45
__call__Method · 0.45
__call__Method · 0.45
__call__Method · 0.45
__call__Method · 0.45
__call__Method · 0.45
__call__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected