(self, data)
| 1020 | self._totensor = ToTensor() |
| 1021 | |
| 1022 | def __call__(self, data): |
| 1023 | if not isinstance(data, MetaTensor): |
| 1024 | return data |
| 1025 | |
| 1026 | if self.nearest_interp: |
| 1027 | data.applied_operations = convert_applied_interp_mode( |
| 1028 | trans_info=data.applied_operations, mode="nearest", align_corners=None |
| 1029 | ) |
| 1030 | |
| 1031 | data = data.detach() |
| 1032 | inverted = self.transform.inverse(data) |
| 1033 | if self.to_tensor and not isinstance(inverted, MetaTensor): |
| 1034 | inverted = self._totensor(inverted) |
| 1035 | if isinstance(inverted, torch.Tensor): |
| 1036 | inverted = inverted.to(device=self.device) |
| 1037 | if callable(self.post_func): |
| 1038 | inverted = self.post_func(inverted) |
| 1039 | return inverted |
| 1040 | |
| 1041 | |
| 1042 | class SobelGradients(Transform): |
nothing calls this directly
no test coverage detected