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!
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
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.
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
).