# How to display the OBB of a nrrd file in 3d slicer?

**URL:** https://discourse.slicer.org/t/how-to-display-the-obb-of-a-nrrd-file-in-3d-slicer/37891
**Category:** Support
**Created:** [August 14, 2024, 4:08pm UTC](https://discourse.slicer.org/t/how-to-display-the-obb-of-a-nrrd-file-in-3d-slicer/37891 "2024-08-14T16:08:02Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![hk\_y](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hk_y/32/70063_2.png) [@hk\_y](https://discourse.slicer.org/u/hk_y)
#### Post date: [August 14, 2024, 4:08pm UTC](https://discourse.slicer.org/t/how-to-display-the-obb-of-a-nrrd-file-in-3d-slicer/37891/1 "2024-08-14T16:08:02Z")

</div>

Operating system: mac  
Slicer version: 5.2.1  
Expected behavior: I have an NRRD file and I can calculate its OBB and RAS diameter using Segment Statistics, but I want to display its bounding box. How can I do that?

 ![截屏2024-08-15 上午12.11.29](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/d/4/d450f57d1791e9dc47fdf604a1d6b0c8516a06ef.png)

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [August 15, 2024, 9:44am UTC](https://discourse.slicer.org/t/how-to-display-the-obb-of-a-nrrd-file-in-3d-slicer/37891/2 "2024-08-15T09:44:45Z")

</div>

See code snippet that you can copy-paste into the Slicer Python console in the [script repository](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#markups-roi).

---

<div class="post-metadata">

### Author: ![hk\_y](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hk_y/32/70063_2.png) [@hk\_y](https://discourse.slicer.org/u/hk_y)
#### Post date: [August 15, 2024, 1:07pm UTC](https://discourse.slicer.org/t/how-to-display-the-obb-of-a-nrrd-file-in-3d-slicer/37891/3 "2024-08-15T13:07:24Z")

</div>

Thank you so much！ Can you give me the code snippet that could display the AABB (axis-aligned bounding box) of the label. Thanks.

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [August 15, 2024, 1:27pm UTC](https://discourse.slicer.org/t/how-to-display-the-obb-of-a-nrrd-file-in-3d-slicer/37891/4 "2024-08-15T13:27:15Z")

</div>

The topic of getting axis-aligned bounding boxes is discussed here:

> [@Get axis-aligned bounding boxes for segments](https://discourse.slicer.org/t/get-axis-aligned-bounding-boxes-for-segments/27795):
>
> 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](https://discourse.slicer.org/t/python-script-to-get-axis-aligned-bounding-box/26227/5). But since i rotated the segments before, the segments do not match with the original scalar volume anymore. Do I need t…
