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

Method __call__

monai/transforms/intensity/array.py:1953–1966  ·  view source on GitHub ↗
(self, img: NdarrayOrTensor)

Source from the content-addressed store, hash-verified

1951 self.alpha = alpha
1952
1953 def __call__(self, img: NdarrayOrTensor) -> NdarrayOrTensor:
1954 img = convert_to_tensor(img, track_meta=get_track_meta())
1955 img_t = convert_to_tensor(img, track_meta=False)
1956 n_dims = len(img_t.shape[1:])
1957
1958 # FT
1959 k = self.shift_fourier(img_t, n_dims)
1960 # build and apply mask
1961 k = self._apply_mask(k)
1962 # map back
1963 out = self.inv_shift_fourier(k, n_dims)
1964 img, *_ = convert_to_dst_type(out, dst=img, dtype=out.dtype)
1965
1966 return img
1967
1968 def _apply_mask(self, k: NdarrayOrTensor) -> NdarrayOrTensor:
1969 """Builds and applies a mask on the spatial dimensions.

Callers

nothing calls this directly

Calls 6

_apply_maskMethod · 0.95
convert_to_tensorFunction · 0.90
get_track_metaFunction · 0.90
convert_to_dst_typeFunction · 0.90
shift_fourierMethod · 0.80
inv_shift_fourierMethod · 0.80

Tested by

no test coverage detected