(self, img: MetaTensor)
| 425 | return crop_func(img_t, tuple(slices_), lazy_, self.get_transform_info()) |
| 426 | |
| 427 | def inverse(self, img: MetaTensor) -> MetaTensor: |
| 428 | transform = self.pop_transform(img) |
| 429 | cropped = transform[TraceKeys.EXTRA_INFO]["cropped"] |
| 430 | # the amount we pad is equal to the amount we cropped in each direction |
| 431 | inverse_transform = BorderPad(cropped) |
| 432 | # Apply inverse transform |
| 433 | with inverse_transform.trace_transform(False): |
| 434 | return inverse_transform(img) # type: ignore |
| 435 | |
| 436 | |
| 437 | class SpatialCrop(Crop): |
nothing calls this directly
no test coverage detected