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

Method __init__

monai/transforms/intensity/dictionary.py:559–584  ·  view source on GitHub ↗

Args: keys: keys of the corresponding items to be transformed. See also: :py:class:`monai.transforms.compose.MapTransform` minv: minimum value of output data. maxv: maximum value of output data. factor: factor scale by ``v = v

(
        self,
        keys: KeysCollection,
        minv: float | None = 0.0,
        maxv: float | None = 1.0,
        factor: float | None = None,
        channel_wise: bool = False,
        dtype: DtypeLike = np.float32,
        allow_missing_keys: bool = False,
    )

Source from the content-addressed store, hash-verified

557 backend = ScaleIntensity.backend
558
559 def __init__(
560 self,
561 keys: KeysCollection,
562 minv: float | None = 0.0,
563 maxv: float | None = 1.0,
564 factor: float | None = None,
565 channel_wise: bool = False,
566 dtype: DtypeLike = np.float32,
567 allow_missing_keys: bool = False,
568 ) -> None:
569 """
570 Args:
571 keys: keys of the corresponding items to be transformed.
572 See also: :py:class:`monai.transforms.compose.MapTransform`
573 minv: minimum value of output data.
574 maxv: maximum value of output data.
575 factor: factor scale by ``v = v * (1 + factor)``. In order to use
576 this parameter, please set both `minv` and `maxv` into None.
577 channel_wise: if True, scale on each channel separately. Please ensure
578 that the first dimension represents the channel of the image if True.
579 dtype: output data type, if None, same as input image. defaults to float32.
580 allow_missing_keys: don't raise exception if key is missing.
581
582 """
583 super().__init__(keys, allow_missing_keys)
584 self.scaler = ScaleIntensity(minv, maxv, factor, channel_wise, dtype)
585
586 def __call__(self, data: Mapping[Hashable, NdarrayOrTensor]) -> dict[Hashable, NdarrayOrTensor]:
587 d = dict(data)

Callers

nothing calls this directly

Calls 2

ScaleIntensityClass · 0.90
__init__Method · 0.45

Tested by

no test coverage detected