Apply the transform to `img`.
(self, img: NdarrayOrTensor, randomize: bool = True)
| 426 | self.factor = self.R.uniform(low=self.factors[0], high=self.factors[1]) |
| 427 | |
| 428 | def __call__(self, img: NdarrayOrTensor, randomize: bool = True) -> NdarrayOrTensor: |
| 429 | """ |
| 430 | Apply the transform to `img`. |
| 431 | """ |
| 432 | img = convert_to_tensor(img, track_meta=get_track_meta(), dtype=self.dtype) |
| 433 | if randomize: |
| 434 | self.randomize() |
| 435 | |
| 436 | if not self._do_transform: |
| 437 | return img |
| 438 | |
| 439 | shifter = StdShiftIntensity( |
| 440 | factor=self.factor, nonzero=self.nonzero, channel_wise=self.channel_wise, dtype=self.dtype |
| 441 | ) |
| 442 | return shifter(img=img) |
| 443 | |
| 444 | |
| 445 | class ScaleIntensity(Transform): |
nothing calls this directly
no test coverage detected