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

Method __call__

monai/transforms/intensity/array.py:248–258  ·  view source on GitHub ↗

Apply the transform to `img`.

(self, img: NdarrayOrTensor, offset: float | None = None)

Source from the content-addressed store, hash-verified

246 self.safe = safe
247
248 def __call__(self, img: NdarrayOrTensor, offset: float | None = None) -> NdarrayOrTensor:
249 """
250 Apply the transform to `img`.
251 """
252
253 img = convert_to_tensor(img, track_meta=get_track_meta())
254 offset = self.offset if offset is None else offset
255 out = img + offset
256 out, *_ = convert_data_type(data=out, dtype=img.dtype, safe=self.safe)
257
258 return out
259
260
261class RandShiftIntensity(RandomizableTransform):

Callers

nothing calls this directly

Calls 3

convert_to_tensorFunction · 0.90
get_track_metaFunction · 0.90
convert_data_typeFunction · 0.90

Tested by

no test coverage detected