1
+ from typing import List
1
2
import unittest
2
3
import siibra
3
-
4
+ import pytest
5
+ from siibra .core import Parcellation , Atlas , Region
6
+ from siibra .features .feature import Feature
4
7
5
8
class TestEbrainsQuery (unittest .TestCase ):
6
9
@classmethod
@@ -17,5 +20,60 @@ def test_no_duplicates_returned(self):
17
20
assert len (self .feat ) == len (list (set (ids )))
18
21
19
22
23
+ parameter = [
24
+ ('rat' , 'v3' , 'neocortex' , {
25
+ 'exclude' : [
26
+ # buggy. hippocampus + difumo 512 is a big issue
27
+ 'DiFuMo atlas (512 dimensions)'
28
+ ],
29
+ 'include' : [
30
+ # some of these still clearly doesn't look right
31
+ # for e.g. some v1/v2 are in here
32
+ # but one step at a time...
33
+ 'Large scale multi-channel EEG in rats' ,
34
+ 'Wistar rat hippocampus CA1 pyramidal cell morphologies – Extension with additional reconstructions' ,
35
+ 'Auditory stimulation during the sleep-wake cycle in the freely moving rat' ,
36
+ '3D high resolution SRXTM image data of cortical vasculature of rat brain.' ,
37
+ 'Density measurements of different receptors for CA1 (Hippocampus) [rat, v2.0]' ,
38
+ 'Visualization of projections from insular cortex in rat with the use of anterograde tracers' ,
39
+ 'Density measurements of different receptors for CA, stratum moleculare (Hippocampus) [rat, v2.0]' ,
40
+ 'Density measurements of different receptors for CA2 (Hippocampus) [rat, v2.0]' ,
41
+ 'PCI-like measure in rodents' ,
42
+ 'Density measurements of different receptors for CA3 (Hippocampus) [rat, v2.0]' ,
43
+ 'Dose-dependent effects of ketamine on spontaneous and evoked EEG activity in rats' ,
44
+ 'Detailed dynamical laminar organisation in different cortical areas (in rats in vivo)' ,
45
+ 'Density measurements of different receptors for CA, stratum cellulare (Hippocampus) [rat, v2.0]' ,
46
+ '3D reconstructions of pyramidal cells in rat hippocampal CA1 region' ,
47
+ 'Electrophysiological data of cortical layer 6 neurons and synaptically coupled neuronal pairs' ,
48
+ 'Density measurements of different receptors for DG (Hippocampus) [rat, v1.0]' ,
49
+ 'Test of consciousness metrics in rodents' ,
50
+ 'Morphological data of cortical layer 6 neurons and synaptically coupled neuronal pairs' ,
51
+ 'Visualization of projections from posterior parietal cortex in rat with the use of anterograde tracers' ,
52
+ 'Immunofluorescence data of cortical layer 6 neurons' ,
53
+ 'Density measurements of different receptors for DG (Hippocampus) [rat, v2.0]' ,
54
+ 'Graphical representation of rat cortical vasculature reconstructed from high resolution 3D SRXTM data.' ,
55
+ 'Density measurements of different receptors for CA, stratum cellulare (Hippocampus) [rat, v1.0]' ,
56
+ 'Wistar rat hippocampus CA1 pyramidal cell morphologies' ,
57
+ 'Density measurements of different receptors for CA3 (Hippocampus) [rat, v1.0]' ,
58
+ 'Density measurements of different receptors for CA1 (Hippocampus) [rat, v1.0]' ,
59
+ 'Density measurements of different receptors for CA, stratum moleculare (Hippocampus) [rat, v1.0]' ,
60
+ 'Density measurements of different receptors for CA2 (Hippocampus) [rat, v1.0]' ,
61
+ 'Multi-area recordings from visual and somatosensory cortices, perirhinal cortex and hippocampal CA1' ]
62
+ })
63
+ ]
64
+
65
+ @pytest .mark .parametrize ('atlas_id,parc_id,region_id,inc_exc' , parameter )
66
+ def test_species (atlas_id ,parc_id ,region_id ,inc_exc ):
67
+ atlas :Atlas = siibra .atlases [atlas_id ]
68
+ parc :Parcellation = atlas .parcellations [parc_id ]
69
+ r :Region = parc .decode_region (region_id )
70
+ features : List [Feature ] = siibra .get_features (r , 'ebrains' )
71
+ feature_names = [f .name for f in features ]
72
+
73
+ excludes : List [str ] = inc_exc .get ('exclude' )
74
+ includes : List [str ] = inc_exc .get ('include' )
75
+ assert all (exc not in feature_names for exc in excludes )
76
+ assert all (inc in feature_names for inc in includes )
77
+
20
78
if __name__ == "__main__" :
21
79
unittest .main ()
0 commit comments