You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
clip_boxes_to_image can drop valid boxes for large coordinates #9045
Describe the bug spatial_crop_boxes converts roi_start and roi_end to torch.int16 before clamping boxes. For coordinates >= 32768, the ROI bounds overflow/wrap, so boxes that are fully inside the requested crop can be clamped to zero width and dropped when remove_empty=True.
This is also reachable through the public clip_boxes_to_image API for large images.
Additional context
The overflow appears to come from the .to(torch.int16) casts on the converted ROI bounds in monai/data/box_utils.py. Whole-slide pathology and detection workflows can use image coordinates larger than 32767, so this can silently remove valid detections instead of raising an error.
Activity
Fix clipping boxes with large coordinates (Project-MONAI#9047)