Args: keys: keys of the corresponding items to be transformed. See also: :py:class:`monai.transforms.compose.MapTransform` factors: factor range to randomly scale by ``v = v * (1 + factor)``. if single number, factor value is picked fr
(
self,
keys: KeysCollection,
factors: tuple[float, float] | float,
prob: float = 0.1,
channel_wise: bool = False,
dtype: DtypeLike = np.float32,
allow_missing_keys: bool = False,
)
| 598 | backend = RandScaleIntensity.backend |
| 599 | |
| 600 | def __init__( |
| 601 | self, |
| 602 | keys: KeysCollection, |
| 603 | factors: tuple[float, float] | float, |
| 604 | prob: float = 0.1, |
| 605 | channel_wise: bool = False, |
| 606 | dtype: DtypeLike = np.float32, |
| 607 | allow_missing_keys: bool = False, |
| 608 | ) -> None: |
| 609 | """ |
| 610 | Args: |
| 611 | keys: keys of the corresponding items to be transformed. |
| 612 | See also: :py:class:`monai.transforms.compose.MapTransform` |
| 613 | factors: factor range to randomly scale by ``v = v * (1 + factor)``. |
| 614 | if single number, factor value is picked from (-factors, factors). |
| 615 | prob: probability of scale. |
| 616 | (Default 0.1, with 10% probability it returns a scaled array.) |
| 617 | channel_wise: if True, scale on each channel separately. Please ensure |
| 618 | that the first dimension represents the channel of the image if True. |
| 619 | dtype: output data type, if None, same as input image. defaults to float32. |
| 620 | allow_missing_keys: don't raise exception if key is missing. |
| 621 | |
| 622 | """ |
| 623 | MapTransform.__init__(self, keys, allow_missing_keys) |
| 624 | RandomizableTransform.__init__(self, prob) |
| 625 | self.scaler = RandScaleIntensity(factors=factors, dtype=dtype, prob=1.0, channel_wise=channel_wise) |
| 626 | |
| 627 | def set_random_state( |
| 628 | self, seed: int | None = None, state: np.random.RandomState | None = None |
nothing calls this directly
no test coverage detected