See also: :py:class:`monai.transforms.utils.generate_spatial_bounding_box`.
(self, data: Mapping[Hashable, NdarrayOrTensor])
| 1365 | self.bbox_key_postfix = bbox_key_postfix |
| 1366 | |
| 1367 | def __call__(self, data: Mapping[Hashable, NdarrayOrTensor]) -> dict[Hashable, NdarrayOrTensor]: |
| 1368 | """ |
| 1369 | See also: :py:class:`monai.transforms.utils.generate_spatial_bounding_box`. |
| 1370 | """ |
| 1371 | d = dict(data) |
| 1372 | for key in self.key_iterator(d): |
| 1373 | bbox = self.bbox(d[key]) |
| 1374 | key_to_add = f"{key}_{self.bbox_key_postfix}" |
| 1375 | if key_to_add in d: |
| 1376 | raise KeyError(f"Bounding box data with key {key_to_add} already exists.") |
| 1377 | d[key_to_add] = bbox |
| 1378 | return d |
| 1379 | |
| 1380 | |
| 1381 | PadD = PadDict = Padd |
nothing calls this directly
no test coverage detected