measure lesion size

Hello I have a lesion in the 3d boolean array - 1 is presence 0 is absence - I would like to get the size of it in 3 axes - main longest axis and the other 2.
Problem is that the long axis of the lesion generally do not agree with the axes of the image as a whole.
Brute force approach to get the long axis is to iterate over all indicies and calculate euclidean distance taking spacing into account - but it is very slow.
Is there some ready to use function to measure the lesion along its main axes
or to have a measure of how elongated it is (how much it deviates from a sphere)?

Hello @Jakub_Mitura1,

Yes there is. The relevant ITK filter is LabelGeometryImageFilter and the function is GetOrientedBoundingBoxSize. If you are using SimpleITK this functionality is found in the LabelShapeStatisticsImageFilter.

1 Like

Thank You!