Draw principal axes

Hello,
I would like to draw Principal axes (segment statistic) using Python console. Is it possible please?

thank you!

You can create line or curve markups for the axes and have a control point at (0,0,0) and the other in the coordinate of the axis you got from Segment Statistics.

There is an example in the script repository that draws the principal axes using ROI markup. It should not be hard to modify it to use lines instead.

1 Like

Hi,
Thanks for the suggestion given above. I found the Python code and I believe I should change some string names. However, I am not sure with what name I can call the principal axes.
For example: what should I put instead of obb_direction_ras_x within "LabelmapSegmentStatisticsPlugin.obb_direction_ras_x" to obtain the principal x axes?

In the end I would like to obtain a figure as in this post, in the Principal axes and moments figure.

Thanks in advance!

The referenced script to generate the bounding boxes still works well. There is no need to change anything. The principal x axis is saved into the obb_direction_ras_x variable.