# Lie Analysis Common Functions

Package Properties and Options | Sampling of the Sphere |

Derivatives | Spherical Harmonics |

Transformations | Helper Functions |

Input Preprocessor's | External Functions and Files |

Functions that are used across several functions in the LieAnalysis package are stored in the LieAnalysis`Common context. These functions can be useful if you are using the package

In[1]:= |

## Package Properties and Options

## Derivatives

GaussianDerivative[data, sigmas, derivatives] | wrapper function to simplify using GaussianFilter |

GroupDifferences[data, direction] | left invariant finite differences on 2d arrays |

GroupDifferences3D[data, {orientations, topology}, direction] | left invariant finite differences on 3d arrays |

Function to compute derivatives.

## Transformations

WaveletTransform | returns a ObjWaveletTransform or an array depending on your input |

WaveletTransform3D | returns a ObjWaveletTransform or an array depending on your input |

CenteredFourier | compute the Fourier transform with the zero-frequency in the center |

CenteredInverseFourier | computes the inverse Fourier transform with the zero-frequency in the center |

### Wavelet Transform of 2-dimensional Image

Internally the function WaveletTransform is used in the OrientationScoreTransform.

### Centered Fourier Transformed

## Input Preprocessor's

ToImage[input] | tries to create a grayscale image (Real32) from the input |

ToImage3D[input] | tries to create a 3D image (Real32) from the input |

InputProcessor[input] | tries to convert the input to a 2D packed-array |

InputProcessor3D[input] | tries to convert the input to a 3D packed-array |

Functions to pre-process the input.

### Convert to Image

### Convert to Packed-array

## Sampling of the Sphere

SphereSamplpes[samples] | returns a ObjSphereSampling according to your samples specification |

ResampleOrientations | resamples an Obj3DPositionOrientationData on the angular axis |

ExpandSymmetry | expands the symmetry in the ObjSphereSampling and Obj3DPositionOrientationData which has been used to minimize storage |

Functions used for sampling on the sphere.

### Sample the Sphere

### Angular Resampling Position Orientation Data

### Expand Symmetry of the Orientation Axis

To minimize storage of Obj3DPositionOrientationData and ObjSphereSampling (and computation time) the symmetry in the orientation axis is used. However sometimes this is just not what you want. In these cases you can remove all symmetry by using the common function ExpandSymmetry.

## Spherical Harmonics

Internally spherical harmonics are used to do computation at the orientation axes in the SE(3) space. This is an involved process therefore a lot of wrapper functions are stored in the Common context to do some work for us.

RealSphericalHarmonicFit[pts, data, lMax] | fits spherical harmonic coefficients on 3-dimensional position orientation data |

RealSphericalHarmonicOrderList[lMax] | returns a list corresponding to the expression orders up to a certain SH order lMax |

RealSphericalHarmonicParameterList[lMax] | returns a list containing L and M pairs for up to a certain SH order lMax |

RealSphericalHarmonicValues[angles, lMax] | get the spherical harmonic values up to order lMax for a set of angles |

RealSphericalHarmonicY[l,m,θ,ϕ] | real Spherical Harmonic Basis function for a specific parameter pair l and m |

A4RealSphericalHarmonicY | left-invariant (A4) spherical harmonic derivative basis function |

A5RealSphericalHarmonicY | left-invariant (A5) spherical harmonic derivative basis function |

A4A4RealSphericalHarmonicY | left-invariant (A4A4) spherical harmonic derivative basis function |

A5A5RealSphericalHarmonicY | left-invariant (A5A5) spherical harmonic derivative basis function |

A5A4RealSphericalHarmonicY | left-invariant (A5A4) spherical harmonic derivative basis function |

SphericalHarmonicsIndexToL[]index | from linear index to degree of legendre polynomial |

SphericalHarmonicsIndexToM | from linear index to order of legendre polynomial |

SphericalHarmonicsLMax | compute SH from the number of samples on the sphere |

SphericalHarmonicsLMToIndex | from degree and order (L and M) to linear indexing |

SphericalHarmonicsTable | expression table for certain SH order, coefficients and basis functions (optimized for speed) |

SphericalHarmonicsAngularBlur | Angular Smoothing of position orientation data via SH |

Fundamental function for working with Spherical Harmonics.

### Spherical Harmonic Expressions

The function SphericalHarmonicsTable is an optimized function wrapper to go from Spherical Harmonics expressions back to (discrete) orientation data.

The function is also available for the left-invariant derivative basis functions (4,5,44,54, and 55).

### From Orientation Data to Spherical Harmonic Coefficients

The first step would be to compute Spherical Harmonic (SH) coefficients from the position and orientation data. Before we can do this we need to know which order SH are used. In this section we make use of the Lie Analysis object Obj3DPositionOrientationData, if you are not familiar with it check it out first.

### Spherical Harmonic Expression Indexing

Spherical Harmonic expressions are indexed using L and M (for more details see https://en.wikipedia.org/wiki/Spherical_harmonics). Although you can also use linear indexing instead. The following functions are used to convert between these indexes.

### Smoothing of Orientation Axis

## Helper Functions

Tiny functions to make our lives easier.

BlockMatrix | construct a block matrix from two matrices |

BooleanToBinary | converts a boolean to 1 in case of True and 0 in case of False |

CartesianToSphericalCoordinates | converts cartesian to spherical coordinates, not having the β =0 issue that is present in ToSphericalCoordinates |

ComplexQ | returns a boolean-value whenever a value is complex or not |

Reorder | wrapper for Transpose |

RnWithAlphaIs0 | rotation in SE(3) in which α is set to 0 |

## External Functions and Files

DownloadFile[url, local, timeout] | function to download any url from the internet to the local folder |

LoadCppFunction[name] | loads the name Lie Analysis C++ function (Windows only) |

LoadCUDAFunction[name] | Loads the name Lia Analysis CUDA function (Windows only) |

Functions to load external files and functions.