MCPcopy
hub / github.com/mne-tools/mne-python / test_surface_source_morph_shortcut

Function test_surface_source_morph_shortcut

mne/tests/test_morph.py:266–281  ·  view source on GitHub ↗

Test that our shortcut for smooth=0 works.

()

Source from the content-addressed store, hash-verified

264
265@testing.requires_testing_data
266def test_surface_source_morph_shortcut():
267 """Test that our shortcut for smooth=0 works."""
268 stc = mne.read_source_estimate(fname_smorph)
269 morph_identity = compute_source_morph(
270 stc,
271 "sample",
272 "sample",
273 spacing=stc.vertices,
274 smooth=0,
275 subjects_dir=subjects_dir,
276 )
277 stc_back = morph_identity.apply(stc)
278 assert_allclose(stc_back.data, stc.data, rtol=1e-4)
279 abs_sum = morph_identity.morph_mat - speye(len(stc.data), format="csc")
280 abs_sum = np.abs(abs_sum.data).sum()
281 assert abs_sum < 1e-4
282
283
284def assert_power_preserved(orig, new, limits=(1.0, 1.05)):

Callers

nothing calls this directly

Calls 3

compute_source_morphFunction · 0.90
applyMethod · 0.45
sumMethod · 0.45

Tested by

no test coverage detected