# OBB Corner Coordinates and/or Dimensions

**URL:** <https://discourse.slicer.org/t/obb-corner-coordinates-and-or-dimensions/44176>\
**Category:** Support\
**Tags:** segmentation, segment-statistics\
**Created:** [August 23, 2025, 2:58am UTC](https://discourse.slicer.org/t/obb-corner-coordinates-and-or-dimensions/44176 "2025-08-23T02:58:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![liam26](https://avatars.discourse-cdn.com/v4/letter/l/858c86/32.png) [@liam26](https://discourse.slicer.org/u/liam26)\
**Post date:** [August 23, 2025, 2:58am UTC](https://discourse.slicer.org/t/obb-corner-coordinates-and-or-dimensions/44176/1 "2025-08-23T02:58:14Z")

</div>

I’m trying to find the dimensions of my OBB box (width, length, height) to get the height of spinal discs. Even getting the corner coordinates would be helpful so I could calculate it manually. I can’t find an existing script or get my own to work. Thank you in advance!

---

<div class="post-metadata">

**Author:** ![mikebind](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@mikebind](https://discourse.slicer.org/u/mikebind)\
**Post date:** [August 23, 2025, 4:03am UTC](https://discourse.slicer.org/t/obb-corner-coordinates-and-or-dimensions/44176/2 "2025-08-23T04:03:20Z")

</div>

This script from the script repository shows how to do this using tools from the SegmentStatistics module: [Get oriented bounding box and display them using markups ROI node](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#markups-roi)

---

<div class="post-metadata">

**Author:** ![liam26](https://avatars.discourse-cdn.com/v4/letter/l/858c86/32.png) [@liam26](https://discourse.slicer.org/u/liam26)\
**Post date:** [August 23, 2025, 10:31pm UTC](https://discourse.slicer.org/t/obb-corner-coordinates-and-or-dimensions/44176/3 "2025-08-23T22:31:43Z")

</div>

I’ve been able to display the boxes using this script but not get their dimensions. I thought they might appear as a segment when running SegmentStatistics but only the original segments appeared in the table.

---

<div class="post-metadata">

**Author:** ![mikebind](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@mikebind](https://discourse.slicer.org/u/mikebind)\
**Post date:** [August 23, 2025, 11:19pm UTC](https://discourse.slicer.org/t/obb-corner-coordinates-and-or-dimensions/44176/4 "2025-08-23T23:19:11Z")

</div>

The OBB dimensions are in the `obb_diameter_mm` array after running the script. The `obb_diameter_mm[0]` will be the length of the OBB in the x direction (i.e. the bounding box dimension along the vector `obb_direction_ras_x`. Likewise, `obb_diameter_mm[1]` will be the length of the OBB in the y direction (along `obb_direction_ras_y`), and `obb_diameter_mm[2]`will be the remaining OBB dimension (along `obb_direction_ras_z`).
