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

Method __call__

monai/transforms/intensity/array.py:2395–2406  ·  view source on GitHub ↗
(self, img: NdarrayOrTensor, randomize: bool = True)

Source from the content-addressed store, hash-verified

2393 raise NotImplementedError(f"Subclass {self.__class__.__name__} must implement this method.")
2394
2395 def __call__(self, img: NdarrayOrTensor, randomize: bool = True) -> NdarrayOrTensor:
2396 img = convert_to_tensor(img, track_meta=get_track_meta())
2397 if randomize:
2398 self.randomize(img.shape[1:])
2399
2400 if not self._do_transform:
2401 return img
2402
2403 img_np, *_ = convert_data_type(img, np.ndarray)
2404 out = self._transform_holes(img=img_np)
2405 ret, *_ = convert_to_dst_type(src=out, dst=img)
2406 return ret
2407
2408
2409class RandCoarseDropout(RandCoarseTransform):

Callers

nothing calls this directly

Calls 6

randomizeMethod · 0.95
_transform_holesMethod · 0.95
convert_to_tensorFunction · 0.90
get_track_metaFunction · 0.90
convert_data_typeFunction · 0.90
convert_to_dst_typeFunction · 0.90

Tested by

no test coverage detected