Compound features
Some features such as connectivity matrices have attributes siibra can use to
combine them into one feature object, called CompoundFeature. Compound features
contain all the features making them up as elements and allow easy access to each
element.
Compound features naturally result from a feature query for certain feature types.
For example, connectivity matrices usually provided for each subject, however,
having them as separate features make it difficult to work with them. But as a
compound feature, they inherit the joint attributes from their elements. But
siibra will not compound different cohorts for example. Let us demonstrate:
import siibra
features = siibra.features.get(siibra.parcellations["julich 2.9"], "StreamlineLengths")
for f in features:
print("Compounded feature type:", f.feature_type)
print(f.name)
# let us select the 1000 Brains cohort
if f.cohort == "1000BRAINS":
cf = f
print(f"Selected: {cf.name}")
Compounded feature type: <class 'siibra.features.connectivity.streamline_lengths.StreamlineLengths'>
200 Streamline Lengths features cohort: HCP
Compounded feature type: <class 'siibra.features.connectivity.streamline_lengths.StreamlineLengths'>
349 Streamline Lengths features cohort: 1000BRAINS
Selected: 349 Streamline Lengths features cohort: 1000BRAINS
Each of these features consist of streamline lengths features corresponding to
different subjects. An element can be selected via an integer index or by
their index to a CompoundFeature using get_element:
print(cf[5].name)
print(cf.get_element('0031_2').name)
0031_2 - Streamline Lengths cohort: 1000BRAINS
0031_2 - Streamline Lengths cohort: 1000BRAINS
The indices of this compound feature corresponds to the the subject ids:
for i, f in enumerate(cf[:10]): # we can iterate over elements of a CompoundFeature
print(f"Element index: {cf.indices[i]}, Subject: {f.subject}")
Element index: 0056_1, Subject: 0056_1
Element index: 0152_1, Subject: 0152_1
Element index: 0162_1, Subject: 0162_1
Element index: 0027_1, Subject: 0027_1
Element index: 0142_1, Subject: 0142_1
Element index: 0031_2, Subject: 0031_2
Element index: 0080_1, Subject: 0080_1
Element index: 0089_2, Subject: 0089_2
Element index: 0200_2, Subject: 0200_2
Element index: 0117_1, Subject: 0117_1
We can also obtain the averaged data (depends on the underlying feature type) by
as you would normally access the data of a feature
|
Area 45 (IFG) left |
Area 44 (IFG) left |
Area Fo1 (OFC) left |
Area Fo2 (OFC) left |
Area Fo3 (OFC) left |
Area hOc5 (LOC) left |
Area hOc2 (V2, 18) left |
Area hOc1 (V1, 17, CalcS) left |
Area hOc4v (LingG) left |
Area hOc3v (LingG) left |
Area TE 1.0 (HESCHL) left |
Area TE 2.1 (STG) left |
Area TPJ (STG/SMG) left |
Area TE 1.2 (HESCHL) left |
Area TE 3 (STG) left |
Area TE 1.1 (HESCHL) left |
Area TE 2.2 (STG) left |
Area 33 (ACC) left |
Area s32 (sACC) left |
Area p32 (pACC) left |
Area Id2 (Insula) left |
Area Id3 (Insula) left |
CA2 (Hippocampus) left |
CA3 (Hippocampus) left |
Entorhinal Cortex left |
DG (Hippocampus) left |
HC-Parasubiculum (Hippocampus) left |
HC-Presubiculum (Hippocampus) left |
HC-Prosubiculum (Hippocampus) left |
CA1 (Hippocampus) left |
HC-Subiculum (Hippocampus) left |
HATA (Hippocampus) left |
Area OP4 (POperc) left |
Area OP1 (POperc) left |
Area OP2 (POperc) left |
Area OP3 (POperc) left |
Area FG2 (FusG) left |
Area FG1 (FusG) left |
Area PGp (IPL) left |
Area PFt (IPL) left |
... |
Area hIP5 (IPS) right |
Area hIP7 (IPS) right |
Area hPO1 (POS) right |
Area 6mp (SMA, mesial SFG) right |
Area 6ma (preSMA, mesial SFG) right |
HC-Transsubiculum (Hippocampus) right |
Area Fo4 (OFC) right |
Area Fo5 (OFC) right |
Area Fo6 (OFC) right |
Area Fo7 (OFC) right |
Area 8d1 (SFG) right |
Area 8d2 (SFG) right |
Area 8v2 (MFG) right |
Area 8v1 (MFG) right |
Area Ig3 (Insula) right |
Area Id4 (Insula) right |
Area Id5 (Insula) right |
Area Ia1 (Insula) right |
Area Id6 (Insula) right |
Area Op5 (Frontal Operculum) right |
Area Op6 (Frontal Operculum) right |
Area Op7 (Frontal Operculum) right |
Area Ph1 (PhG) right |
Area Ph2 (PhG) right |
Area Ph3 (PhG) right |
Area CoS1 (CoS) right |
CGL (Metathalamus) right |
CGM (Metathalamus) right |
Area Id9 (Insula) right |
Area Ia3 (Insula) right |
Area Ia2 (Insula) right |
Area Id8 (Insula) right |
Area Id10 (Insula) right |
BST (Bed Nucleus) right |
Frontal-I (GapMap) right |
Frontal-II (GapMap) right |
Temporal-to-Parietal (GapMap) right |
Frontal-to-Occipital (GapMap) right |
Frontal-to-Temporal-I (GapMap) right |
Frontal-to-Temporal-II (GapMap) right |
Area 45 (IFG) left |
9.443545 |
18.452280 |
81.996862 |
76.311984 |
60.447846 |
87.293875 |
126.267999 |
110.810314 |
59.519272 |
117.959463 |
43.864128 |
104.475239 |
103.332152 |
95.618012 |
114.592295 |
101.629988 |
109.534864 |
61.266227 |
64.287529 |
70.211859 |
81.144263 |
97.573903 |
47.293355 |
13.473518 |
13.047154 |
61.164387 |
5.154558 |
59.170315 |
29.894852 |
86.506849 |
36.532338 |
28.033458 |
79.511281 |
87.745590 |
81.601769 |
70.757205 |
115.036780 |
85.898482 |
129.935802 |
89.277470 |
... |
9.250994 |
17.066265 |
26.540446 |
95.769876 |
109.712714 |
0.000000 |
54.575392 |
99.844241 |
108.891804 |
63.043891 |
113.496146 |
101.654701 |
101.916760 |
109.726970 |
0.000000 |
42.797586 |
105.145701 |
53.529893 |
115.311305 |
97.371290 |
80.455995 |
65.200497 |
6.385613 |
2.890188 |
1.221271 |
1.072693 |
2.055503 |
8.600813 |
86.633010 |
6.367201 |
4.207198 |
78.902619 |
59.208545 |
40.983498 |
108.951595 |
120.180233 |
177.613246 |
113.265633 |
80.185138 |
110.639884 |
Area 44 (IFG) left |
18.452280 |
10.193551 |
95.279208 |
82.099026 |
87.691843 |
104.415531 |
135.063233 |
132.587356 |
68.737128 |
129.356451 |
49.101415 |
95.076827 |
88.070363 |
92.001393 |
103.790454 |
87.549913 |
92.033707 |
60.338550 |
56.799040 |
93.143421 |
63.485539 |
91.920502 |
46.932255 |
13.473399 |
10.404964 |
64.605532 |
4.315020 |
54.631695 |
32.228472 |
83.307590 |
41.361901 |
52.002353 |
20.890460 |
50.005247 |
54.764933 |
33.926110 |
118.041065 |
97.715565 |
119.568481 |
56.402003 |
... |
35.738913 |
36.212682 |
58.347864 |
100.843712 |
99.964064 |
0.694957 |
25.094095 |
68.510799 |
71.829330 |
29.538574 |
110.622211 |
101.437911 |
98.093604 |
106.941591 |
3.809837 |
80.229325 |
112.081991 |
57.080317 |
115.882325 |
115.157733 |
110.393254 |
59.648450 |
9.265393 |
15.973592 |
1.121680 |
2.380337 |
5.059613 |
25.375421 |
85.761333 |
2.251721 |
2.307121 |
58.291413 |
30.901453 |
28.651966 |
114.902715 |
111.998102 |
174.787987 |
94.451678 |
50.734833 |
123.819241 |
Area Fo1 (OFC) left |
81.996862 |
95.279208 |
6.573588 |
13.315082 |
15.161988 |
52.781688 |
97.332853 |
88.399936 |
42.775696 |
100.165759 |
1.937948 |
25.136870 |
49.815274 |
16.561457 |
58.376877 |
38.272319 |
76.158440 |
46.195127 |
7.111685 |
28.222514 |
19.527405 |
70.593877 |
10.484189 |
1.683432 |
11.029073 |
26.881343 |
1.001270 |
29.520357 |
11.729373 |
43.154833 |
25.190636 |
6.725284 |
44.168908 |
86.845769 |
22.216414 |
20.309064 |
86.646161 |
63.486314 |
116.796087 |
79.631998 |
... |
1.306488 |
2.572960 |
6.475068 |
11.194722 |
47.709378 |
0.000000 |
53.932626 |
75.977601 |
80.136023 |
54.764544 |
86.582492 |
36.050784 |
31.282637 |
45.360134 |
0.000000 |
4.029522 |
19.534574 |
13.941052 |
57.603818 |
12.285935 |
7.462849 |
7.251268 |
1.973000 |
0.000000 |
0.679340 |
0.000000 |
0.000000 |
0.283786 |
33.780274 |
0.749393 |
3.500705 |
27.763440 |
46.599415 |
16.766337 |
113.842688 |
71.664900 |
73.118141 |
116.177581 |
59.525457 |
63.936724 |
Area Fo2 (OFC) left |
76.311984 |
82.099026 |
13.315082 |
5.163227 |
9.402081 |
32.923000 |
87.850165 |
75.683076 |
28.594416 |
84.311910 |
1.867314 |
18.969785 |
28.632879 |
10.376333 |
34.255601 |
30.420648 |
64.056058 |
35.300322 |
14.560506 |
35.923490 |
12.759643 |
51.922049 |
7.986528 |
2.041240 |
12.054656 |
46.601901 |
3.808379 |
52.670236 |
24.943566 |
51.034131 |
35.568153 |
6.000724 |
33.712360 |
70.256818 |
14.248885 |
15.271519 |
60.069095 |
50.251655 |
89.946770 |
65.082334 |
... |
0.000000 |
1.904668 |
6.133801 |
5.465744 |
29.549854 |
0.509941 |
36.944027 |
57.811941 |
58.865254 |
37.346322 |
62.475760 |
24.656885 |
17.367664 |
28.286947 |
0.000000 |
2.650183 |
12.823830 |
10.099496 |
42.224776 |
6.726060 |
0.955899 |
2.347928 |
3.541349 |
0.661482 |
0.000000 |
0.000000 |
0.191268 |
0.000000 |
19.494678 |
0.450683 |
1.873560 |
21.208102 |
29.389941 |
15.930398 |
106.987976 |
49.719605 |
76.182733 |
115.687549 |
45.999289 |
53.404001 |
Area Fo3 (OFC) left |
60.447846 |
87.691843 |
15.161988 |
9.402081 |
11.426877 |
93.047458 |
118.740601 |
115.030564 |
84.259005 |
119.985080 |
18.341870 |
69.132717 |
89.779897 |
43.986190 |
96.013878 |
85.026077 |
115.020310 |
47.697824 |
21.749120 |
41.021447 |
51.516410 |
52.492010 |
31.703761 |
9.866354 |
28.625944 |
49.808432 |
6.534963 |
41.725237 |
29.331926 |
63.918521 |
36.815298 |
16.018930 |
93.496016 |
107.399532 |
62.181334 |
68.333518 |
102.153033 |
92.842655 |
131.446139 |
117.585959 |
... |
3.013355 |
4.421043 |
13.249391 |
21.865384 |
81.433870 |
0.000000 |
58.091573 |
82.987299 |
88.766349 |
56.622828 |
115.553219 |
61.603716 |
55.835275 |
79.990256 |
0.396569 |
4.012744 |
33.709967 |
24.334302 |
87.623173 |
18.008178 |
8.335010 |
8.343077 |
2.548851 |
4.414194 |
1.692416 |
0.000000 |
0.000000 |
6.272387 |
44.423086 |
0.510184 |
5.291306 |
40.495518 |
43.096685 |
24.210959 |
114.177430 |
113.491221 |
128.354351 |
138.394680 |
68.374310 |
71.629294 |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
Frontal-II (GapMap) right |
120.180233 |
111.998102 |
71.664900 |
49.719605 |
113.491221 |
69.161450 |
93.629900 |
68.368218 |
22.172435 |
63.510193 |
15.463097 |
79.958527 |
99.768745 |
54.404075 |
113.158781 |
107.491513 |
138.670529 |
81.060058 |
39.713885 |
126.514173 |
93.242599 |
133.268543 |
14.178619 |
3.354716 |
2.333880 |
30.574149 |
0.548584 |
18.124478 |
9.415484 |
30.162562 |
19.128755 |
65.164121 |
120.113030 |
122.979954 |
87.816658 |
98.146899 |
107.025458 |
52.583518 |
147.890872 |
123.407881 |
... |
96.986014 |
105.715379 |
112.517488 |
58.459284 |
60.330565 |
8.719896 |
86.518106 |
82.679976 |
92.914889 |
96.089769 |
59.464410 |
47.141240 |
30.536686 |
23.709946 |
26.555708 |
50.344622 |
65.194007 |
78.556952 |
62.035106 |
32.187983 |
30.193863 |
58.752412 |
121.075978 |
121.819020 |
57.012847 |
81.494151 |
69.135988 |
56.357961 |
75.792077 |
69.267287 |
111.369583 |
84.573323 |
102.295146 |
85.458389 |
36.544035 |
15.811089 |
103.159107 |
54.434014 |
99.283334 |
84.955945 |
Temporal-to-Parietal (GapMap) right |
177.613246 |
174.787987 |
73.118141 |
76.182733 |
128.354351 |
139.018347 |
149.585542 |
143.029777 |
134.220102 |
148.947169 |
57.787421 |
129.753650 |
121.288116 |
119.764933 |
139.967514 |
142.685745 |
146.528758 |
146.053738 |
82.643560 |
162.283491 |
69.449546 |
168.722200 |
76.607171 |
22.572160 |
6.742641 |
73.130102 |
2.520978 |
60.099548 |
25.782890 |
108.877859 |
39.460465 |
21.664566 |
136.060624 |
140.253353 |
81.107405 |
69.358359 |
145.914964 |
141.512574 |
144.647469 |
142.486404 |
... |
36.283743 |
41.538788 |
65.937263 |
119.205266 |
125.532572 |
7.344103 |
114.312228 |
133.052304 |
126.371151 |
101.668375 |
135.552733 |
128.137945 |
121.052663 |
119.196735 |
34.705066 |
80.272380 |
61.043666 |
45.001147 |
85.221160 |
90.953843 |
98.720607 |
102.494515 |
21.934454 |
19.927550 |
8.503376 |
8.613251 |
19.946810 |
43.898312 |
47.493077 |
23.789323 |
18.618149 |
73.705423 |
53.089187 |
76.598514 |
132.639966 |
103.159107 |
12.469611 |
57.758488 |
97.831213 |
20.525305 |
Frontal-to-Occipital (GapMap) right |
113.265633 |
94.451678 |
116.177581 |
115.687549 |
138.394680 |
111.902342 |
100.288792 |
85.209588 |
115.895490 |
119.336990 |
66.343201 |
106.887981 |
96.717232 |
101.478153 |
114.491047 |
103.862070 |
107.124599 |
53.312718 |
106.999209 |
107.762136 |
85.329408 |
130.199063 |
87.841199 |
28.815451 |
16.779563 |
78.471138 |
12.852664 |
74.128842 |
47.992021 |
98.807792 |
64.741618 |
45.448040 |
95.324980 |
88.401110 |
79.778410 |
80.705518 |
118.526755 |
115.886750 |
108.478286 |
88.728469 |
... |
43.849946 |
32.045053 |
20.489395 |
23.040465 |
25.407866 |
30.713926 |
104.366169 |
101.410808 |
105.430995 |
107.367113 |
64.017206 |
68.960491 |
65.897315 |
67.378956 |
34.337562 |
67.543051 |
77.796433 |
91.901288 |
74.275043 |
71.356737 |
79.179407 |
70.167465 |
50.891800 |
64.598167 |
39.508571 |
82.639136 |
65.416921 |
54.518555 |
91.775380 |
80.616338 |
108.438496 |
92.673303 |
109.404822 |
90.855829 |
40.968707 |
54.434014 |
57.758488 |
13.387146 |
107.192846 |
23.677089 |
Frontal-to-Temporal-I (GapMap) right |
80.185138 |
50.734833 |
59.525457 |
45.999289 |
68.374310 |
1.323446 |
4.631489 |
4.026650 |
1.332584 |
3.091001 |
0.636671 |
1.193912 |
2.505177 |
0.000000 |
3.795215 |
1.730882 |
11.394524 |
68.790532 |
56.220000 |
89.367908 |
1.964321 |
45.990336 |
0.000000 |
0.000000 |
0.000000 |
0.000000 |
0.000000 |
0.585500 |
0.000000 |
0.000000 |
0.000000 |
0.000000 |
5.516093 |
17.950211 |
1.076863 |
1.946881 |
3.284836 |
1.331392 |
14.942431 |
22.580277 |
... |
34.537502 |
44.184719 |
59.082599 |
52.218170 |
90.581596 |
0.584056 |
39.371623 |
43.467015 |
16.143016 |
12.487032 |
95.959566 |
79.168083 |
69.088943 |
83.050112 |
14.788159 |
60.969832 |
55.429578 |
52.574421 |
42.131501 |
70.180930 |
74.414928 |
43.866334 |
34.518865 |
34.968941 |
12.893551 |
4.577576 |
13.541532 |
17.754161 |
45.376787 |
42.863435 |
53.931351 |
25.257516 |
12.570454 |
57.239898 |
39.376059 |
99.283334 |
97.831213 |
107.192846 |
7.253007 |
43.793481 |
Frontal-to-Temporal-II (GapMap) right |
110.639884 |
123.819241 |
63.936724 |
53.404001 |
71.629294 |
74.890102 |
103.766506 |
97.831283 |
64.947170 |
101.974410 |
8.485952 |
54.077958 |
44.082153 |
33.820223 |
72.406029 |
64.770205 |
95.329845 |
78.236132 |
63.944428 |
103.555187 |
15.188902 |
126.164398 |
11.898262 |
5.595951 |
1.262686 |
43.671416 |
3.230479 |
33.144117 |
12.871807 |
45.325023 |
19.323303 |
13.151807 |
47.832195 |
108.042240 |
18.918683 |
14.112290 |
96.725644 |
79.402037 |
113.623223 |
108.132246 |
... |
77.163234 |
73.358795 |
71.838440 |
84.332417 |
93.034153 |
6.545921 |
56.000758 |
65.903681 |
64.079234 |
48.629447 |
101.661291 |
93.332964 |
97.877576 |
103.746235 |
12.640151 |
49.576662 |
20.587723 |
17.213345 |
22.736131 |
70.106942 |
81.460334 |
53.925081 |
19.920375 |
22.436673 |
9.001643 |
35.474827 |
21.116633 |
17.980365 |
10.948433 |
9.751459 |
16.333590 |
17.929941 |
12.932872 |
16.362522 |
85.201375 |
84.955945 |
20.525305 |
23.677089 |
43.793481 |
8.443016 |
294 rows × 294 columns
Meanwhile, receptor density profiles employ receptor names as indices.
cf = siibra.features.get(siibra.get_region('julich', 'hoc1'), 'receptor density profile')[0]
for i, f in enumerate(cf):
print(f"Element index: {cf.indices[i]}, receptor: {f.receptor}")
Element index: 5-HT1A, receptor: 5-HT1A
Element index: 5-HT2, receptor: 5-HT2
Element index: alpha1, receptor: alpha1
Element index: alpha2, receptor: alpha2
Element index: alpha4beta2, receptor: alpha4beta2
Element index: AMPA, receptor: AMPA
Element index: BZ, receptor: BZ
Element index: D1, receptor: D1
Element index: GABAA, receptor: GABAA
Element index: GABAB, receptor: GABAB
Element index: kainate, receptor: kainate
Element index: M1, receptor: M1
Element index: M2, receptor: M2
Element index: M3, receptor: M3
Element index: mGluR2_3, receptor: mGluR2_3
Element index: NMDA, receptor: NMDA
So to get the receptor profile on HOC1 for GABAB we can do
cf.get_element("GABAB").data
|
Receptor density (fmol/mg) |
0.00 |
1950 |
0.01 |
2101 |
0.02 |
2204 |
0.03 |
2293 |
0.04 |
2375 |
... |
... |
0.96 |
1466 |
0.97 |
1429 |
0.98 |
1390 |
0.99 |
1350 |
1.00 |
1319 |
101 rows × 1 columns
Similarly, to plot
cf.get_element("GABAB").plot()

<Axes: title={'center': 'Receptor Density Profile: GABAB'}, xlabel='Cortical depth', ylabel='fmol/mg'>
Total running time of the script: (0 minutes 38.538 seconds)
Estimated memory usage: 776 MB
Gallery generated by Sphinx-Gallery