Apply the transform to `img`, assuming `img` is channel-first and slicing doesn't change the channel dim.
( # type: ignore[override]
self, img: torch.Tensor, mode: str | None = None, lazy: bool | None = None, **pad_kwargs
)
| 926 | return ret |
| 927 | |
| 928 | def __call__( # type: ignore[override] |
| 929 | self, img: torch.Tensor, mode: str | None = None, lazy: bool | None = None, **pad_kwargs |
| 930 | ) -> torch.Tensor: |
| 931 | """ |
| 932 | Apply the transform to `img`, assuming `img` is channel-first and |
| 933 | slicing doesn't change the channel dim. |
| 934 | """ |
| 935 | box_start, box_end = self.compute_bounding_box(img) |
| 936 | lazy_ = self.lazy if lazy is None else lazy |
| 937 | cropped = self.crop_pad(img, box_start, box_end, mode, lazy=lazy_, **pad_kwargs) |
| 938 | |
| 939 | if self.return_coords: |
| 940 | return cropped, box_start, box_end # type: ignore[return-value] |
| 941 | return cropped |
| 942 | |
| 943 | def inverse(self, img: MetaTensor) -> MetaTensor: |
| 944 | transform = self.get_most_recent_transform(img) |
nothing calls this directly
no test coverage detected