#include #include #include "Fourier.h" #include "SphericalGrid.h" #include "cmdLineParser.h" #include int main(int argc,char* argv[]){ // Read the parameters in from the command line cmdLineString In,Out; cmdLineReadable Ref,Axial; cmdLineInt Rot; char* paramNames[]={"in","out","ref","rot","axial"}; cmdLineReadable* params[]={&In,&Out,&Ref,&Rot,&Axial}; cmdLineParse(argc-1,&argv[1],paramNames,sizeof(paramNames)/sizeof(char*),params); if(!In.set){ fprintf(stderr,"You must specify an input file\n"); return EXIT_FAILURE; } if(!Out.set){ fprintf(stderr,"You must specify an output file\n"); return EXIT_FAILURE; } char fileName[512]; SphericalGrid<> in,sym; RotationGrid<> euler; FourierKeyS2<> keyS2; FourierKeySO3<> keySO3; HarmonicTransform<> hForm; WignerTransform<> wForm; float axis[3]; float matrix[3][3]; float x,y,z; // Read in the input spherical function if(!in.read(In.value)){ fprintf(stderr,"Failed to read in: %s\n",In.value); return EXIT_FAILURE; } // Kill off the 0th order frequency component and normalize so that // the function has unit norm. hForm.ForwardFourier(in,keyS2); keyS2(0,0)=0; hForm.InverseFourier(keyS2,in); float l=float(sqrt(in.squareNorm())); for(int i=0;i