# Calculating the axes of the ellipsoid part of the shape from l=1 coefficients

**URL:** <https://discourse.slicer.org/t/calculating-the-axes-of-the-ellipsoid-part-of-the-shape-from-l-1-coefficients/20920>\
**Category:** SlicerSALT\
**Created:** [December 5, 2021, 10:04pm UTC](https://discourse.slicer.org/t/calculating-the-axes-of-the-ellipsoid-part-of-the-shape-from-l-1-coefficients/20920 "2021-12-05T22:04:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hcc](https://avatars.discourse-cdn.com/v4/letter/h/8e7dd6/32.png) [@hcc](https://discourse.slicer.org/u/hcc)\
**Post date:** [December 5, 2021, 10:04pm UTC](https://discourse.slicer.org/t/calculating-the-axes-of-the-ellipsoid-part-of-the-shape-from-l-1-coefficients/20920/1 "2021-12-05T22:04:37Z")

</div>

Hi there, really enjoying using the great tools of SPHARM-PDM.

I just wanted to know how I could go about finding the 3 axes of the ellipsoid part of my shape in object space (not for alignment purposes, rather for some other downstream analysis). I have computed all of the coefficients using SPHARM-PDM (positive ‘m’ only, as I believe is the case for this package), but can’t find anywhere how I would then compute the ellipsoid axes from the l=1 coefficients. I’m thinking it must be possible, since each set of l=1 coefficients uniquely map to an ellipsoid shape. The eigenvectors of a matrix containing these coefficients seems intuitive, but I can’t find a formula in any of the papers I’ve searched through.

Thank you very much in advance.

---

<div class="post-metadata">

**Author:** ![styner](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/styner/32/1024_2.png) [@styner](https://discourse.slicer.org/u/styner)\
**Post date:** [December 5, 2021, 10:41pm UTC](https://discourse.slicer.org/t/calculating-the-axes-of-the-ellipsoid-part-of-the-shape-from-l-1-coefficients/20920/2 "2021-12-05T22:41:16Z")

</div>

Took me down memory lane a bit:  
The corresponding code related to this is located in ParametricMeshToSPHARMSpatialObjectFilter.cxx - RotateParametricMesh (here on GitHub [SPHARM-PDM/ParametricMeshToSPHARMSpatialObjectFilter.cxx at master · NIRALUser/SPHARM-PDM · GitHub](https://github.com/NIRALUser/SPHARM-PDM/blob/master/Libraries/Shape/Algorithms/ParametricMeshToSPHARMSpatialObjectFilter.cxx) ). That function shows you how to set up the matrix from the l=1 coefficients. The eigenvectors & eigenvalues of that matrix are the axes of the ellipsoid.  
see also:  
Brechbühler, Ch., Gerig, G. & Kübler, O. Parametrization of Closed Surfaces for 3-D Shape Description. Comput Vis Image Und 61, 154–170 (1995).  
Look at page 162

Hope this helps  
Martin

---

<div class="post-metadata">

**Author:** ![hcc](https://avatars.discourse-cdn.com/v4/letter/h/8e7dd6/32.png) [@hcc](https://discourse.slicer.org/u/hcc)\
**Post date:** [December 7, 2021, 11:54am UTC](https://discourse.slicer.org/t/calculating-the-axes-of-the-ellipsoid-part-of-the-shape-from-l-1-coefficients/20920/3 "2021-12-07T11:54:43Z")

</div>

Dear Dr Styner,

Good memories only I hope! Ah fantastic, that works perfectly. Thank you very much.
