MCPcopy Index your code
hub / github.com/mne-tools/mne-python / _get_solids

Function _get_solids

mne/surface.py:1896–1918  ·  view source on GitHub ↗

Compute _sum_solids_div total angle in chunks.

(tri_rrs, fros)

Source from the content-addressed store, hash-verified

1894
1895@jit()
1896def _get_solids(tri_rrs, fros):
1897 """Compute _sum_solids_div total angle in chunks."""
1898 # NOTE: This incorporates the division by 4PI that used to be separate
1899 tot_angle = np.zeros(len(fros))
1900 for ti in range(len(tri_rrs)):
1901 tri_rr = tri_rrs[ti]
1902 v1 = fros - tri_rr[0]
1903 v2 = fros - tri_rr[1]
1904 v3 = fros - tri_rr[2]
1905 v4 = np.empty((v1.shape[0], 3))
1906 _jit_cross(v4, v1, v2)
1907 triple = np.sum(v4 * v3, axis=1)
1908 l1 = np.sqrt(np.sum(v1 * v1, axis=1))
1909 l2 = np.sqrt(np.sum(v2 * v2, axis=1))
1910 l3 = np.sqrt(np.sum(v3 * v3, axis=1))
1911 s = (
1912 l1 * l2 * l3
1913 + np.sum(v1 * v2, axis=1) * l3
1914 + np.sum(v1 * v3, axis=1) * l2
1915 + np.sum(v2 * v3, axis=1) * l1
1916 )
1917 tot_angle -= np.arctan2(triple, s)
1918 return tot_angle
1919
1920
1921def _complete_sphere_surf(sphere, idx, level, complete=True):

Callers 2

_assert_complete_surfaceFunction · 0.85
_assert_insideFunction · 0.85

Calls 3

_jit_crossFunction · 0.85
sqrtMethod · 0.80
sumMethod · 0.45

Tested by

no test coverage detected