Coverage for nilearn/plotting/tests/test_edge_detect.py: 0%
14 statements
« prev ^ index » next coverage.py v7.8.0, created at 2025-04-03 10:21 +0200
« prev ^ index » next coverage.py v7.8.0, created at 2025-04-03 10:21 +0200
1import numpy as np
3from nilearn.plotting.edge_detect import _edge_detect
6def test_edge_detect():
7 img = np.zeros((10, 10))
8 img[:5] = 1
9 _, _ = _edge_detect(img)
10 np.testing.assert_almost_equal(img[4], 1)
13def test_edge_nan():
14 img = np.zeros((10, 10))
15 img[:5] = 1
16 img[0] = np.nan
17 grad_mag, _ = _edge_detect(img)
18 np.testing.assert_almost_equal(img[4], 1)
19 assert (grad_mag[0] > 2).all()