convolve with spherical harmonics
Spherical harmonics are loaded from user, or from a couple of example FODs (one single fibre FOD, one with crossing fibres).
function: convolve_sh
Inputs: FOD coeffs, bvecs, bvals, compartments
Output: diffusion signal along bvecs
- Determine order of spherical harmonics from number of coeffs.
- Define FRF: for each comp, predict signal along a set of directions
- (sum over compartments?)
- Fit spherical harmonics to FRF
- Convolve FRF and FOD (now both defined by SH coeffs) as described below
Notes:
require function that returns SH matrix for some given gradient directions.
must deal with different b-shells independently
Convolution using spherical harmonics (Tournier 2011)
"In the spherical harmonics (SH) framework, the convolution operation is performed as follows. For each harmonic order l, the SH coefficients of the signal profile S(θ,ϕ) and the FOD F(θ,ϕ) are written as vectors sl and fl of length 2l + 1, whereas the rotational harmonic coefficients of the convolution kernel R(θ,ϕ,φ) (the response function) are written as a matrix Rl of size (2l + 1) × (2l + 1). The convolution operation then simply consists of one matrix multiplication per harmonic order l:
Sl = Rl * fl
"
https://doi.org/10.1016/j.neuroimage.2007.02.016
Question: should the function output signal for many compartments (i.e. the compartments are summed before convolved) or a single compartment (to be more consistent with other code)?