Get axis-aligned bounding boxes for segments

I created a segmentation with some segments and want to get an axis-aligned bounding box for each segment. As far as i know, with the segment statistics module we can compute oriented bounding boxes, but i couldn’t find an option to get axis-aligned bounding boxes. I tried to get the segments as numpy arrays and use numpy functions to find the required values as suggested here. But since i rotated the segments before, the segments do not match with the original scalar volume anymore. Do I need to rotate and resample the volume as well? Or is there another way to get axis-aligned bounding boxes for segments?

There is the SegmentAxisAlignment module in this extension:

The extension is not yet added to the Extension Manager so for now you can clone this repository and point to the module in Edit / Application Settings / Additional module directories.