(self, data: Mapping[Hashable, torch.Tensor], lazy: bool | None = None)
| 918 | return True |
| 919 | |
| 920 | def __call__(self, data: Mapping[Hashable, torch.Tensor], lazy: bool | None = None) -> dict[Hashable, torch.Tensor]: |
| 921 | d = dict(data) |
| 922 | self.cropper: CropForeground |
| 923 | box_start, box_end = self.cropper.compute_bounding_box(img=d[self.source_key]) |
| 924 | if self.start_coord_key is not None: |
| 925 | d[self.start_coord_key] = box_start # type: ignore |
| 926 | if self.end_coord_key is not None: |
| 927 | d[self.end_coord_key] = box_end # type: ignore |
| 928 | |
| 929 | lazy_ = self.lazy if lazy is None else lazy |
| 930 | for key, m in self.key_iterator(d, self.mode): |
| 931 | d[key] = self.cropper.crop_pad(img=d[key], box_start=box_start, box_end=box_end, mode=m, lazy=lazy_) |
| 932 | return d |
| 933 | |
| 934 | |
| 935 | class RandWeightedCropd(Randomizable, MapTransform, LazyTransform, MultiSampleTrait): |
nothing calls this directly
no test coverage detected