959bb1a6cd3e02463c06fb04ca1195bc6b3bc7b6,dipy/reconst/tests/test_shm.py,,test_sf_to_sh,#,433

Before Change


    // 1D case with the 3 bases functions
    odf_sh = sf_to_sh(odf, sphere, 8, "tournier07")
    odf2 = sh_to_sf(odf_sh, sphere, 8, "tournier07")
    assert_array_almost_equal(odf, odf2, 2)

    odf_sh = sf_to_sh(odf, sphere, 8, "descoteaux07")
    odf2 = sh_to_sf(odf_sh, sphere, 8, "descoteaux07")
    assert_array_almost_equal(odf, odf2, 2)

After Change


    // 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")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 15

Instances


Project Name: nipy/dipy
Commit Name: 959bb1a6cd3e02463c06fb04ca1195bc6b3bc7b6
Time: 2020-07-20
Author: charles.poirier@usherbrooke.ca
File Name: dipy/reconst/tests/test_shm.py
Class Name:
Method Name: test_sf_to_sh


Project Name: nipy/dipy
Commit Name: 959bb1a6cd3e02463c06fb04ca1195bc6b3bc7b6
Time: 2020-07-20
Author: charles.poirier@usherbrooke.ca
File Name: dipy/reconst/tests/test_shm.py
Class Name:
Method Name: test_real_full_sh_mrtrix


Project Name: nipy/dipy
Commit Name: 959bb1a6cd3e02463c06fb04ca1195bc6b3bc7b6
Time: 2020-07-20
Author: charles.poirier@usherbrooke.ca
File Name: dipy/reconst/tests/test_shm.py
Class Name:
Method Name: test_real_full_sh_basis


Project Name: nipy/dipy
Commit Name: 959bb1a6cd3e02463c06fb04ca1195bc6b3bc7b6
Time: 2020-07-20
Author: charles.poirier@usherbrooke.ca
File Name: dipy/reconst/tests/test_shm.py
Class Name:
Method Name: test_sf_to_sh