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

Class GaussianSmoothd

monai/transforms/intensity/dictionary.py:1196–1228  ·  view source on GitHub ↗

Dictionary-based wrapper of :py:class:`monai.transforms.GaussianSmooth`. Args: keys: keys of the corresponding items to be transformed. See also: :py:class:`monai.transforms.compose.MapTransform` sigma: if a list of values, must match the count of spatial dimens

Source from the content-addressed store, hash-verified

1194
1195
1196class GaussianSmoothd(MapTransform):
1197 """
1198 Dictionary-based wrapper of :py:class:`monai.transforms.GaussianSmooth`.
1199
1200 Args:
1201 keys: keys of the corresponding items to be transformed.
1202 See also: :py:class:`monai.transforms.compose.MapTransform`
1203 sigma: if a list of values, must match the count of spatial dimensions of input data,
1204 and apply every value in the list to 1 spatial dimension. if only 1 value provided,
1205 use it for all spatial dimensions.
1206 approx: discrete Gaussian kernel type, available options are "erf", "sampled", and "scalespace".
1207 see also :py:meth:`monai.networks.layers.GaussianFilter`.
1208 allow_missing_keys: don't raise exception if key is missing.
1209
1210 """
1211
1212 backend = GaussianSmooth.backend
1213
1214 def __init__(
1215 self,
1216 keys: KeysCollection,
1217 sigma: Sequence[float] | float,
1218 approx: str = "erf",
1219 allow_missing_keys: bool = False,
1220 ) -> None:
1221 super().__init__(keys, allow_missing_keys)
1222 self.converter = GaussianSmooth(sigma, approx=approx)
1223
1224 def __call__(self, data: Mapping[Hashable, NdarrayOrTensor]) -> dict[Hashable, NdarrayOrTensor]:
1225 d = dict(data)
1226 for key in self.key_iterator(d):
1227 d[key] = self.converter(d[key])
1228 return d
1229
1230
1231class RandGaussianSmoothd(RandomizableTransform, MapTransform):

Callers 2

test_valueMethod · 0.90

Calls

no outgoing calls

Tested by 1

test_valueMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…