// Subdividing a hemi_icosahedron twice produces 81 unique points, which
// is more than enough to fit a order 8 (45 coefficients) spherical harmonic
hemisphere = hemi_icosahedron.subdivide(2)
mevals = np.array([[0.0015, 0.0003, 0.0003], [0.0015, 0.0003, 0.0003]])
angles = [(0, 0), (60, 0)]
odf = multi_tensor_odf(hemisphere.vertices, mevals, angles, [50, 50])
// 1D case with the 2 symmetric bases functions
odf_sh = sf_to_sh(odf, hemisphere, 8, "tournier07")
odf_reconst = sh_to_sf(odf_sh, hemisphere, 8, "tournier07")
assert_array_almost_equal(odf, odf_reconst, 2)
odf_sh = sf_to_sh(odf, hemisphere, 8, "descoteaux07")
odf_reconst = sh_to_sf(odf_sh, hemisphere, 8, "descoteaux07")
assert_array_almost_equal(odf, odf_reconst, 2)
// We now create an asymmetric signal
// to try out our full SH basis
mevals = np.array([[0.0015, 0.0003, 0.0003]])
angles = [(0, 0)]odf2 = multi_tensor_odf(hemisphere.vertices, mevals, angles, [100])
// We simulate our asymmetric signal by using a different ODF
// per hemisphere. The sphere used is a concatenation of the
// vertices of our hemisphere, for a total of 162 vertices.
sphere = Sphere(xyz=np.vstack((hemisphere.vertices, -hemisphere.vertices)))
asym_odf = np.append(odf, odf2)
// Try out full bases with order 10 (121 coefficients)
odf_sh = sf_to_sh(asym_odf, sphere, 10, "tournier07_full")
odf_reconst = sh_to_sf(odf_sh, sphere, 10, "tournier07_full")