File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ # -*- coding: utf-8 -*-
2+ """
3+ For testing netneurotools.civet functionality
4+ """
5+
6+ import numpy as np
7+ import pytest
8+
9+ from netneurotools import civet , datasets
10+
11+
12+ @pytest .fixture (scope = 'module' )
13+ def civet_surf (tmp_path_factory ):
14+ tmpdir = str (tmp_path_factory .getbasetemp ())
15+ return datasets .fetch_civet (data_dir = tmpdir , verbose = 0 )['mid' ]
16+
17+
18+ def test_read_civet (civet_surf ):
19+ vertices , triangles = civet .read_civet (civet_surf .lh )
20+ assert len (vertices ) == 40962
21+ assert len (triangles ) == 81920
22+ assert np .all (triangles .max (axis = 0 ) < vertices .shape [0 ])
23+
24+
25+ def test_civet_to_freesurfer ():
26+ brainmap = np .random .rand (81924 )
27+ out = civet .civet_to_freesurfer (brainmap )
28+ out2 = civet .civet_to_freesurfer (brainmap , method = 'linear' )
29+ assert out .shape [0 ] == out2 .shape [0 ] == 81924
30+
31+ with pytest .raises (ValueError ):
32+ civet .civet_to_freesurfer (np .random .rand (10 ))
You can’t perform that action at this time.
0 commit comments