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

Method __call__

monai/transforms/spatial/dictionary.py:1000–1017  ·  view source on GitHub ↗

Args: data: a dictionary containing the tensor-like data to be processed. The ``keys`` specified in this dictionary must be tensor like arrays that are channel first and have at most three spatial dimensions lazy: a flag to indicate wh

(self, data: Mapping[Hashable, torch.Tensor], lazy: bool | None = None)

Source from the content-addressed store, hash-verified

998 self.affine.lazy = val
999
1000 def __call__(self, data: Mapping[Hashable, torch.Tensor], lazy: bool | None = None) -> dict[Hashable, torch.Tensor]:
1001 """
1002 Args:
1003 data: a dictionary containing the tensor-like data to be processed. The ``keys`` specified
1004 in this dictionary must be tensor like arrays that are channel first and have at most
1005 three spatial dimensions
1006 lazy: a flag to indicate whether this transform should execute lazily or not
1007 during this call. Setting this to False or True overrides the ``lazy`` flag set
1008 during initialization for this call. Defaults to None.
1009
1010 Returns:
1011 a dictionary containing the transformed data, as well as any other data present in the dictionary
1012 """
1013 lazy_ = self.lazy if lazy is None else lazy
1014 d = dict(data)
1015 for key, mode, padding_mode in self.key_iterator(d, self.mode, self.padding_mode):
1016 d[key], _ = self.affine(d[key], mode=mode, padding_mode=padding_mode, lazy=lazy_)
1017 return d
1018
1019 def inverse(self, data: Mapping[Hashable, torch.Tensor]) -> dict[Hashable, torch.Tensor]:
1020 d = dict(data)

Callers

nothing calls this directly

Calls 2

key_iteratorMethod · 0.80
affineMethod · 0.80

Tested by

no test coverage detected