Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
SimpleITK LabelShapeStatisticsFilter GetOrientedBoundingBox Coordinates Appear Incorrect #1128
@blowekamp asked me to submit this issue.
Vertices produced by sitk.LabelShapeStatisticsFilter()'s GetOrientedBoundingBoxVertices() are properly in real-world coordinates of the label image only after applying a rotation.
Here is a minimal example that reproduces and solves the issue: https://gist.github.com/kevinalexbrown/d2474bc8245f9aa36af64fcc7c52e8f1
Thanks for reporting the issue. I looked at the ITK code: https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Filtering/LabelMap/include/itkShapeLabelObject.h#L565-L598
The code clearly does not take into consideration the directions matrix for orientation when generating the vertices list.
I am not sure of the current method should be corrected so that the vertices are in physical space, or if a new method should be created with the corrected coordinates. It's not clear to me if or if not the current implementation would be useful and be producing the correct results.