Skip to content

Commit 4bae557

Browse files
committed
feature.id reflects anchor. coritcal profiles named with location or receptor. Update relevant tests
1 parent 9c12adc commit 4bae557

File tree

5 files changed

+23
-17
lines changed

5 files changed

+23
-17
lines changed

e2e/features/test_get.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ def test_get_instances(Cls: siibra.features.Feature):
1313

1414
selected_ids = [
1515
"lq0::EbrainsDataFeature::p:minds/core/parcellationatlas/v1.0.0/94c1125b-b87e-45e4-901c-00daee7f2579-290::r:Area hOc1 (V1, 17, CalcS) left::https://nexus.humanbrainproject.org/v0/data/minds/core/dataset/v1.0.0/3ff328fa-f48f-474b-bd81-b5ee7ca230b6",
16-
"cf0::BigBrainIntensityProfile::p:minds/core/parcellationatlas/v1.0.0/94c1125b-b87e-45e4-901c-00daee7f2579-290::r:Area hOc1 (V1, 17, CalcS) left::nodsid::6ba1f5c180a63705d84c25db9ff7efa7", # CompoundFeature of 1579 BigBrainIntensityProfile features grouped by (Modified silver staining modality) anchored at Area hOc1 (V1, 17, CalcS) left with Set of 1579 points in the Bounding box from (-63.69,-59.94,-29.09) mm to (0.91,77.90,54.03)mm in BigBrain microscopic template (histology) space
17-
"lq0::BigBrainIntensityProfile::p:minds/core/parcellationatlas/v1.0.0/94c1125b-b87e-45e4-901c-00daee7f2579-290::r:Area hOc1 (V1, 17, CalcS) left::a48879314d93d15c74e6512e9af9c91d", # BigBrainIntensityProfile (Modified silver staining) anchored at Area hOc1 (V1, 17, CalcS) left with Point in BigBrain microscopic template (histology) [0.4248340129852295,50.589298248291016,-14.839699745178223]
18-
"cf0::CellDensityProfile::p:minds/core/parcellationatlas/v1.0.0/94c1125b-b87e-45e4-901c-00daee7f2579-290::r:Area hOc1 (V1, 17, CalcS) left::f2cd6b97-e42d-41af-a01b-5caf2d692e28::43d02182a9133fb030e4071eea539990", # CompoundFeature of 10 CellDensityProfile features grouped by (Segmented cell body density modality) anchored at Area hOc1 (V1, 17, CalcS) with Set of 10 points in the Bounding box from (-3.95,-65.80,-0.44) mm to (20.20,-42.70,9.71)mm in BigBrain microscopic template (histology) space
19-
"f2cd6b97-e42d-41af-a01b-5caf2d692e28--ccc56085205beadcd4e911049e726c43", # CellDensityProfile (Segmented cell body density) anchored at Area hOc1 (V1, 17, CalcS) with Point in BigBrain microscopic template (histology) [20.199174880981445,-64.5999984741211,-0.44111010432243347]
20-
"cf0::ReceptorDensityProfile::p:minds/core/parcellationatlas/v1.0.0/94c1125b-b87e-45e4-901c-00daee7f2579-290::r:Area hOc1 (V1, 17, CalcS) left::e715e1f7-2079-45c4-a67f-f76b102acfce::1291b163f73216f756ea258f6ab2efb1", # CompoundFeature of 16 ReceptorDensityProfile features grouped by (Receptor density modality) anchored at Area hOc1 (V1, 17, CalcS)
21-
"e715e1f7-2079-45c4-a67f-f76b102acfce--02200d55e4d91084e3d0014bfb9052f4", # ReceptorDensityProfile (Receptor density) anchored at Area hOc1 (V1, 17, CalcS) for alpha4beta2
22-
"cf0::StreamlineCounts::p:minds/core/parcellationatlas/v1.0.0/94c1125b-b87e-45e4-901c-00daee7f2579-290::f16e449d-86e1-408b-9487-aa9d72e39901::f09a0f43742ce628203a81029644a2c0", # CompoundFeature of 200 StreamlineCounts features grouped by (StreamlineCounts modality, HCP cohort) anchored at Julich-Brain Cytoarchitectonic Atlas (v2.9)
23-
"f16e449d-86e1-408b-9487-aa9d72e39901--283aaf98c0a6bfd2a272a6ef7ac81dd8", # StreamlineCounts (StreamlineCounts) anchored at Julich-Brain Cytoarchitectonic Atlas (v2.9) with cohort HCP - 025
24-
"3f179784-194d-4795-9d8d-301b524ca00a--713b6b5ddc0136acb757863a8138f85e--9c08356ec0454773885ded630e49b5d3", # FunctionalConnectivity (FunctionalConnectivity) anchored at Julich-Brain Cytoarchitectonic Atlas (v2.9) with cohort 1000BRAINS - 0108_1, Resting state (RestEmpCorrFC) paradigm
25-
"cf0::FunctionalConnectivity::p:minds/core/parcellationatlas/v1.0.0/94c1125b-b87e-45e4-901c-00daee7f2579-290::3f179784-194d-4795-9d8d-301b524ca00a::0cc40894189c89488637f35554f88da5", # CompoundFeature of 349 FunctionalConnectivity features grouped by (FunctionalConnectivity modality, 1000BRAINS cohort, Resting state (RestEmpCorrFC) paradigm) anchored at Julich-Brain Cytoarchitectonic Atlas (v2.9)
16+
"cf0::BigBrainIntensityProfile::p:minds/core/parcellationatlas/v1.0.0/94c1125b-b87e-45e4-901c-00daee7f2579-290::r:Area hOc1 (V1, 17, CalcS)::nodsid::94768ccf7d23b640453fb56b4562c2d2", # 2279 BigBrain Intensity Profile features
17+
"lq0::BigBrainIntensityProfile::p:minds/core/parcellationatlas/v1.0.0/94c1125b-b87e-45e4-901c-00daee7f2579-290::r:Area hOc1 (V1, 17, CalcS)::fe933acdb8dea6803c76251e004b9b1f", # BigBrain Intensity Profile: (-3.0491600036621094, -64.58589935302734, 1.1756900548934937)
18+
"cf0::CellDensityProfile::p:minds/core/parcellationatlas/v1.0.0/94c1125b-b87e-45e4-901c-00daee7f2579-290::r:Area hOc1 (V1, 17, CalcS)::f2cd6b97-e42d-41af-a01b-5caf2d692e28::599f219267d5bdc3c5c04ddf31f36748", # 10 Cell Density Profile features
19+
"f2cd6b97-e42d-41af-a01b-5caf2d692e28--5fc6ebfcbdf43c1c9fb36263eda160d2", # Cell Density Profile: (19.09100914001465, -64.9000015258789, -0.36307409405708313)
20+
"cf0::ReceptorDensityProfile::p:minds/core/parcellationatlas/v1.0.0/94c1125b-b87e-45e4-901c-00daee7f2579-290::r:Area hOc1 (V1, 17, CalcS)::e715e1f7-2079-45c4-a67f-f76b102acfce::48ce018be081dafb160287031fbe08c3", # 16 Receptor Density Profile features
21+
"e715e1f7-2079-45c4-a67f-f76b102acfce--e7b46dcf4fea599385b5653ab78e9784", # Receptor Density Profile: alpha4beta2
22+
"cf0::StreamlineCounts::p:minds/core/parcellationatlas/v1.0.0/94c1125b-b87e-45e4-901c-00daee7f2579-290::f16e449d-86e1-408b-9487-aa9d72e39901::295693e37131fd55fbcbcac3b35b3f8b", # 200 Streamline Counts features cohort: HCP
23+
"f16e449d-86e1-408b-9487-aa9d72e39901--a45c0c5f53325ac32b59833e7605b18a", # 015 - Streamline Counts cohort: HCP
24+
"3f179784-194d-4795-9d8d-301b524ca00a--e27e3ad4f467fb5c445a504557f340a4--9c08356ec0454773885ded630e49b5d3", # 0108_1 - Functional Connectivity cohort: 1000BRAINS, paradigm: Resting state (RestEmpCorrFC)
25+
"cf0::FunctionalConnectivity::p:minds/core/parcellationatlas/v1.0.0/94c1125b-b87e-45e4-901c-00daee7f2579-290::f16e449d-86e1-408b-9487-aa9d72e39901::4da1dae86a1fd717e5a3618ab041fd3f", # 200 Functional Connectivity features cohort: HCP, paradigm: Resting state (EmpCorrFC concatenated)
2626
"b08a7dbc-7c75-4ce7-905b-690b2b1e8957--8ff1e1d8bcb26296027b475ec744b83c", # Fiber structures of a human hippocampus based on joint DMRI, 3D-PLI, and TPFM acquisitions (T2 weighted MRI)
2727
]
2828

siibra/features/feature.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,9 @@ def id(self):
272272
if hasattr(ds, "id"):
273273
prefix = ds.id + '--'
274274
break
275-
return prefix + md5(self.name.encode("utf-8")).hexdigest()
275+
return prefix + md5(
276+
f"{self.name} - {self.anchor}".encode("utf-8")
277+
).hexdigest()
276278

277279
def _to_zip(self, fh: ZipFile):
278280
"""

siibra/features/tabular/cortical_profile.py

+8
Original file line numberDiff line numberDiff line change
@@ -276,3 +276,11 @@ def _values(self):
276276
f"'_values' not available for {self.__class__.__name__}."
277277
)
278278
return self._values_cached
279+
280+
@property
281+
def name(self):
282+
if hasattr(self, "receptor"):
283+
return super().name + f": {self.receptor}"
284+
if hasattr(self, "location"):
285+
return super().name + f": {self.location.coordinate}"
286+
return super().name

siibra/features/tabular/receptor_density_profile.py

-4
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,6 @@ def key(self):
7474
def receptor_fullname(self):
7575
return vocabularies.RECEPTOR_SYMBOLS[self.receptor]['receptor']['name']
7676

77-
@property
78-
def name(self):
79-
return super().name + f": {self.receptor}"
80-
8177
@property
8278
def neurotransmitter(self):
8379
return "{} ({})".format(

test/features/test_receptors.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ def test_get_hoc1_left_density():
3131
assert (
3232
len(features) == 1
3333
), "expect only 1 result from getting hoc1 left receptor, but got {len(features)}"
34-
expected_substrings = ["receptor density", "Area hOc1"]
34+
expected_substrings = ["receptor density"]
3535
assert all(
36-
s in features[0].name for s in expected_substrings
36+
s in features[0].name.lower() for s in expected_substrings
3737
), f"name of fetched receptor unexpected. '{features[0].name}' was expected to contain {', '.join(expected_substrings)}"
3838

3939

0 commit comments

Comments
 (0)