Get Centroid from Script

I tried to get the centroid from

obb_centroid = np.array(stats[segmentId,“LabelmapSegmentStatisticsPlugin.centroid_ras”])

but it gives KeyError.

Can someone help me how to do that properly ?

thanks

You need to enable the LabelmapSegmentStatisticsPlugin plugin and the computation of the centroid_ras value.

Thanks you Prof Lasso. Thi