Args: prob: probability of rotating. (Default 0.1, with 10% probability it returns a rotated array) max_k: number of rotations will be sampled from `np.random.randint(max_k) + 1`, (Default 3). spatial_axes: 2 int numbers, defines the plane
(
self, prob: float = 0.1, max_k: int = 3, spatial_axes: tuple[int, int] = (0, 1), lazy: bool = False
)
| 1245 | backend = Rotate90.backend |
| 1246 | |
| 1247 | def __init__( |
| 1248 | self, prob: float = 0.1, max_k: int = 3, spatial_axes: tuple[int, int] = (0, 1), lazy: bool = False |
| 1249 | ) -> None: |
| 1250 | """ |
| 1251 | Args: |
| 1252 | prob: probability of rotating. |
| 1253 | (Default 0.1, with 10% probability it returns a rotated array) |
| 1254 | max_k: number of rotations will be sampled from `np.random.randint(max_k) + 1`, (Default 3). |
| 1255 | spatial_axes: 2 int numbers, defines the plane to rotate with 2 spatial axes. |
| 1256 | Default: (0, 1), this is the first two axis in spatial dimensions. |
| 1257 | lazy: a flag to indicate whether this transform should execute lazily or not. |
| 1258 | Defaults to False |
| 1259 | """ |
| 1260 | RandomizableTransform.__init__(self, prob) |
| 1261 | LazyTransform.__init__(self, lazy=lazy) |
| 1262 | self.max_k = max_k |
| 1263 | self.spatial_axes = spatial_axes |
| 1264 | |
| 1265 | self._rand_k = 0 |
| 1266 | |
| 1267 | def randomize(self, data: Any | None = None) -> None: |
| 1268 | super().randomize(None) |