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
)
| 746 | super().randomize(None) |
| 747 | |
| 748 | def __call__( |
| 749 | self, data: Mapping[Hashable, torch.Tensor], lazy: bool | None = None |
| 750 | ) -> Mapping[Hashable, torch.Tensor]: |
| 751 | """ |
| 752 | Args: |
| 753 | data: a dictionary containing the tensor-like data to be processed. The ``keys`` specified |
| 754 | in this dictionary must be tensor like arrays that are channel first and have at most |
| 755 | three spatial dimensions |
| 756 | lazy: a flag to indicate whether this transform should execute lazily or not |
| 757 | during this call. Setting this to False or True overrides the ``lazy`` flag set |
| 758 | during initialization for this call. Defaults to None. |
| 759 | |
| 760 | Returns: |
| 761 | a dictionary containing the transformed data, as well as any other data present in the dictionary |
| 762 | """ |
| 763 | self.randomize() |
| 764 | d = dict(data) |
| 765 | |
| 766 | # FIXME: here we didn't use array version `RandRotate90` transform as others, because we need |
| 767 | # to be compatible with the random status of some previous integration tests |
| 768 | lazy_ = self.lazy if lazy is None else lazy |
| 769 | rotator = Rotate90(self._rand_k, self.spatial_axes, lazy=lazy_) |
| 770 | for key in self.key_iterator(d): |
| 771 | d[key] = rotator(d[key]) if self._do_transform else convert_to_tensor(d[key], track_meta=get_track_meta()) |
| 772 | self.push_transform(d[key], replace=True, lazy=lazy_) |
| 773 | return d |
| 774 | |
| 775 | def inverse(self, data: Mapping[Hashable, torch.Tensor]) -> dict[Hashable, torch.Tensor]: |
| 776 | d = dict(data) |
nothing calls this directly
no test coverage detected