def __init__( self, keys: KeysCollection, sigma: Union[Sequence[float], float], approx: str = "erf", allow_missing_keys: bool = False, ) -> None: super().__init__(keys, allow_missing_keys) self.converter = GaussianSmooth(sigma, approx=approx)
def __call__(self, data: Mapping[Hashable, np.ndarray]) -> Dict[Hashable, np.ndarray]: d = dict(data) self.randomize() if not self._do_transform: return d for key in self.keys: sigma = ensure_tuple_size(tup=(self.x, self.y, self.z), dim=d[key].ndim - 1) d[key] = GaussianSmooth(sigma=sigma, approx=self.approx)(d[key]) return d
def __call__(self, data): d = dict(data) self.randomize() if not self._do_transform: return d for key in self.keys: sigma = ensure_tuple_size(tup=(self.x, self.y, self.z), dim=d[key].ndim - 1) d[key] = GaussianSmooth(sigma=sigma)(d[key]) return d
def __init__(self, keys: KeysCollection, sigma: Union[Sequence[float], float]): super().__init__(keys) self.converter = GaussianSmooth(sigma)