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

Method __init__

monai/transforms/intensity/dictionary.py:463–484  ·  view source on GitHub ↗

Args: keys: keys of the corresponding items to be transformed. See also: :py:class:`monai.transforms.compose.MapTransform` factor: factor shift by ``v = v + factor * std(v)``. nonzero: whether only count non-zero values. channe

(
        self,
        keys: KeysCollection,
        factor: float,
        nonzero: bool = False,
        channel_wise: bool = False,
        dtype: DtypeLike = np.float32,
        allow_missing_keys: bool = False,
    )

Source from the content-addressed store, hash-verified

461 backend = StdShiftIntensity.backend
462
463 def __init__(
464 self,
465 keys: KeysCollection,
466 factor: float,
467 nonzero: bool = False,
468 channel_wise: bool = False,
469 dtype: DtypeLike = np.float32,
470 allow_missing_keys: bool = False,
471 ) -> None:
472 """
473 Args:
474 keys: keys of the corresponding items to be transformed.
475 See also: :py:class:`monai.transforms.compose.MapTransform`
476 factor: factor shift by ``v = v + factor * std(v)``.
477 nonzero: whether only count non-zero values.
478 channel_wise: if True, calculate on each channel separately. Please ensure
479 that the first dimension represents the channel of the image if True.
480 dtype: output data type, if None, same as input image. defaults to float32.
481 allow_missing_keys: don't raise exception if key is missing.
482 """
483 super().__init__(keys, allow_missing_keys)
484 self.shifter = StdShiftIntensity(factor, nonzero, channel_wise, dtype)
485
486 def __call__(self, data: Mapping[Hashable, NdarrayOrTensor]) -> dict[Hashable, NdarrayOrTensor]:
487 d = dict(data)

Callers

nothing calls this directly

Calls 2

StdShiftIntensityClass · 0.90
__init__Method · 0.45

Tested by

no test coverage detected