Coverage for nilearn/interfaces/tests/test_fsl.py: 0%

13 statements  

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

1"""Tests for the nilearn.interfaces.fsl submodule.""" 

2 

3import numpy as np 

4 

5from nilearn.interfaces.fsl import get_design_from_fslmat 

6 

7 

8def test_get_design_from_fslmat(tmp_path): 

9 """Check that FSL design matrix can be read.""" 

10 fsl_mat_path = tmp_path / "fsl_mat.txt" 

11 matrix = np.ones((5, 5)) 

12 with fsl_mat_path.open("w") as fsl_mat: 

13 fsl_mat.write("/Matrix\n") 

14 for row in matrix: 

15 for val in row: 

16 fsl_mat.write(str(val) + "\t") 

17 fsl_mat.write("\n") 

18 

19 design_matrix = get_design_from_fslmat(fsl_mat_path) 

20 assert design_matrix.shape == matrix.shape