open-discussion > Where are the actual spherical harmonics coefficients?
Showing 1-2 of 2 posts
Display:
Results per page:
Feb 28, 2018  06:02 PM | Erin Walsh
Where are the actual spherical harmonics coefficients?
Could someone please confirm that the pp_surf_SPHARM.coef files are the actual spherical harmonic values?

For context, in a two-dimensional eFourier analysis, I'm used to working with harmonics expressed as pairs for x and y coordinates x(an,bn) y(cn,dn) and x/y intercepts ao and co, like this:
$an
-143.114291 5.292531 22.992294
$bn
-13.85011 -21.89941 11.42351
$cn
64.447531 -3.153757 -17.968226
$dn
-484.90299 -1.04774 42.07409
$ao
349.02
$co
1080.921
To extract the harmonic power of each harmonic, I would use the following formula
(an^2 + bn^2 + cn^2 +dn^2)/2
So in the above case, this would be given by
(-143.114291^2 +-13.85011^2 +-484.90299^2)/2

I would like to do something similar for SPHARM. I note the pp_surf_SPHARM.coef file length depends on the number of harmonics, (e.g. for 2 harmonics the file has 9 rows - sqrt(9) - 1 = 2; for 15 it has 256 rows, sqrt(256) - 1 = 15), which I take to be scaling to harmonics + intercepts. I take the triplet structure to be x(theta, phi),y(theta, phi), and z(theta, phi)

The question is, what do those rows correspond to? Here is the attached example, which was for three harmonics:
{ 16,{-0.030039, -1.897551, 17.881289},
{-2.675218, -38.326385, -8.426619},
{4.155504, 22.028603, -101.510078},
{55.927212, -4.206443, 1.376639},
{0.074859, 1.363188, 0.218308},
{-0.000961, -0.287714, -0.538673},
{-1.590899, 0.257970, -0.012629},
{0.103640, 0.116502, -0.077536},
{0.256680, -0.037865, 0.124865},
{-0.919288, -11.236778, -3.173442},
{0.346360, 3.042818, -16.304485},
{7.547513, -0.332813, 0.202911},
{1.391029, 21.819408, 5.849835},
{-1.469501, -0.198776, -0.156218},
{-0.483709, -2.230340, 21.404125},
{-25.935282, 1.976075, -0.746387}}
Here is the format I would require for my harmonic power analysis:
x                y                 z        harmonic
-0.030039        -1.897551        17.881289 origin
-2.675218        -38.326385       -8.426619 origin
4.155504         22.028603      -101.510078 origin
55.927212        -4.206443         1.376639 origin
0.074859          1.363188         0.218308 1
-0.000961        -0.287714        -0.538673 1
-1.590899         0.25797         -0.012629 1
0.10364           0.116502        -0.077536 1
0.25668          -0.037865         0.124865 2
-0.919288        -11.236778       -3.173442 2
0.34636            3.042818      -16.304485 2
7.547513          -0.332813        0.202911 2
1.391029          21.819408        5.849835 3
-1.469501         -0.198776       -0.156218 3
-0.483709         -2.23034        21.404125 3
-25.935282         1.976075       -0.746387 3
Is this correct, or am I misunderstanding things?


P.S. It's been great to see SPHARM PDM, particularly in concert with 3D slicer, continue to become more and more user-friendly :) 
Mar 1, 2018  08:03 PM | Nazanin M
RE: Where are the actual spherical harmonics coefficients?
I also have the same question, and would appreciate the response.

Thanks in advance!