From 9a5f23046691ebe56682b92396fc69d0fc9f294c Mon Sep 17 00:00:00 2001 From: Philip Cook Date: Tue, 7 May 2024 16:23:18 -0400 Subject: [PATCH] ENH: Make eccentricity more similar to elongation --- Examples/LabelGeometryMeasures.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Examples/LabelGeometryMeasures.cxx b/Examples/LabelGeometryMeasures.cxx index 9525b878c..710efa8f1 100644 --- a/Examples/LabelGeometryMeasures.cxx +++ b/Examples/LabelGeometryMeasures.cxx @@ -199,7 +199,13 @@ LabelGeometryMeasures(int argc, char * argv[]) // Get principal moments and use them to calculate eccentricity and axes lengths auto principalMoments = labelObject->GetPrincipalMoments(); - double lambda1 = principalMoments[0]; + // define in 3D such that it describes the ellipse with axes propotional to the + // two largest principal moments. This is useful eg for cortex, where the thickness + // is much smaller than the other two dimensions. + // + // Roundness gives a more general measure of deviation from a sphere, including all three dimensions. + // + double lambda1 = principalMoments[ImageDimension - 2]; double lambdaN = principalMoments[ImageDimension - 1]; double eccentricity = 0.0;