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

Method __call__

monai/transforms/spatial/array.py:1210–1221  ·  view source on GitHub ↗

Args: img: channel first array, must have shape: (num_channels, H[, W, ..., ]), lazy: a flag to indicate whether this transform should execute lazily or not during this call. Setting this to False or True overrides the ``lazy`` flag set

(self, img: torch.Tensor, lazy: bool | None = None)

Source from the content-addressed store, hash-verified

1208 self.spatial_axes = spatial_axes_
1209
1210 def __call__(self, img: torch.Tensor, lazy: bool | None = None) -> torch.Tensor:
1211 """
1212 Args:
1213 img: channel first array, must have shape: (num_channels, H[, W, ..., ]),
1214 lazy: a flag to indicate whether this transform should execute lazily or not
1215 during this call. Setting this to False or True overrides the ``lazy`` flag set
1216 during initialization for this call. Defaults to None.
1217 """
1218 img = convert_to_tensor(img, track_meta=get_track_meta())
1219 axes = map_spatial_axes(img.ndim, self.spatial_axes)
1220 lazy_ = self.lazy if lazy is None else lazy
1221 return rotate90(img, axes, self.k, lazy=lazy_, transform_info=self.get_transform_info()) # type: ignore
1222
1223 def inverse(self, data: torch.Tensor) -> torch.Tensor:
1224 transform = self.pop_transform(data)

Callers

nothing calls this directly

Calls 5

convert_to_tensorFunction · 0.90
get_track_metaFunction · 0.90
map_spatial_axesFunction · 0.90
rotate90Function · 0.90
get_transform_infoMethod · 0.80

Tested by

no test coverage detected