Coverage for nilearn/plotting/tests/test_img_plotting/test_plot_prob_atlas.py: 0%

11 statements  

« prev     ^ index     » next       coverage.py v7.9.1, created at 2025-06-16 12:32 +0200

1"""Tests for :func:`nilearn.plotting.plot_prob_atlas`.""" 

2 

3# ruff: noqa: ARG001 

4 

5import pytest 

6from nibabel import Nifti1Image 

7 

8from nilearn.plotting import plot_prob_atlas 

9 

10 

11@pytest.mark.timeout(0) 

12@pytest.mark.parametrize( 

13 "params", 

14 [ 

15 {"view_type": "contours"}, 

16 {"view_type": "filled_contours", "threshold": 0.2}, 

17 {"view_type": "continuous"}, 

18 {"view_type": "filled_contours", "colorbar": True}, 

19 {"threshold": None}, 

20 ], 

21) 

22def test_plot_prob_atlas(matplotlib_pyplot, params, affine_eye, rng): 

23 """Smoke tests for plot_prob_atlas. 

24 

25 Tests different combinations of parameters `view_type`, `threshold`, 

26 and `colorbar`. 

27 """ 

28 data_rng = rng.normal(size=(6, 8, 10, 5)) 

29 plot_prob_atlas(Nifti1Image(data_rng, affine_eye), **params) 

30 

31 

32def test_plot_prob_atlas_radiological_view(matplotlib_pyplot, img_4d_rand_eye): 

33 """Smoke test for radiological view.""" 

34 result = plot_prob_atlas(img_4d_rand_eye, radiological=True) 

35 assert result.axes.get("y").radiological is True