14
14
# limitations under the License.
15
15
"""Representation of a brain region."""
16
16
17
- from . import concept , structure , space as _space , parcellation as _parcellation
18
- from .assignment import Qualification , AnatomicalAssignment
19
-
17
+ from . import concept , structure , space as _space , parcellation as _parcellation , assignment
20
18
from ..retrieval .cache import cache_user_fn
21
19
from ..locations import location , pointcloud , boundingbox as _boundingbox
22
20
from ..volumes import parcellationmap , volume
@@ -128,7 +126,7 @@ def get_related_regions(self) -> Iterable["RegionRelationAssessments"]:
128
126
129
127
Yields
130
128
------
131
- Qualification
129
+ assignment. Qualification
132
130
133
131
Example
134
132
-------
@@ -595,7 +593,7 @@ def __contains__(self, other: Union[location.Location, 'Region']) -> bool:
595
593
except NoMapAvailableError :
596
594
return False
597
595
598
- def assign (self , other : structure .BrainStructure ) -> AnatomicalAssignment :
596
+ def assign (self , other : structure .BrainStructure ) -> assignment . AnatomicalAssignment :
599
597
"""
600
598
Compute assignment of a location to this region.
601
599
@@ -609,8 +607,8 @@ def assign(self, other: structure.BrainStructure) -> AnatomicalAssignment:
609
607
610
608
Returns
611
609
-------
612
- AnatomicalAssignment or None
613
- None if there is no Qualification found.
610
+ assignment. AnatomicalAssignment or None
611
+ None if there is no assignment. Qualification found.
614
612
"""
615
613
if (self , other ) in self ._ASSIGNMENT_CACHE :
616
614
return self ._ASSIGNMENT_CACHE [self , other ]
@@ -659,17 +657,17 @@ def assign(self, other: structure.BrainStructure) -> AnatomicalAssignment:
659
657
else : # other is a Region
660
658
assert isinstance (other , Region )
661
659
if self == other :
662
- qualification = Qualification .EXACT
660
+ qualification = assignment . Qualification .EXACT
663
661
elif self .__contains__ (other ):
664
- qualification = Qualification .CONTAINS
662
+ qualification = assignment . Qualification .CONTAINS
665
663
elif other .__contains__ (self ):
666
- qualification = Qualification .CONTAINED
664
+ qualification = assignment . Qualification .CONTAINED
667
665
else :
668
666
qualification = None
669
667
if qualification is None :
670
668
self ._ASSIGNMENT_CACHE [self , other ] = None
671
669
else :
672
- self ._ASSIGNMENT_CACHE [self , other ] = AnatomicalAssignment (self , other , qualification )
670
+ self ._ASSIGNMENT_CACHE [self , other ] = assignment . AnatomicalAssignment (self , other , qualification )
673
671
return self ._ASSIGNMENT_CACHE [self , other ]
674
672
675
673
def tree2str (self ):
@@ -926,7 +924,7 @@ def get_related_regions(region: Region) -> Iterable["RegionRelationAssessments"]
926
924
927
925
Yields
928
926
------
929
- Qualification
927
+ assignment. Qualification
930
928
931
929
Example
932
930
-------
@@ -968,7 +966,7 @@ def inner(*args, **kwargs):
968
966
return outer
969
967
970
968
971
- class RegionRelationAssessments (AnatomicalAssignment [Region ]):
969
+ class RegionRelationAssessments (assignment . AnatomicalAssignment [Region ]):
972
970
"""
973
971
A collection of methods on finding related regions and the quantification
974
972
of the relationship.
@@ -1110,7 +1108,7 @@ def parse_relationship_assessment(cls, src: "Region", assessment):
1110
1108
yield cls (
1111
1109
query_structure = src ,
1112
1110
assigned_structure = found_target ,
1113
- qualification = Qualification .parse_relation_assessment (overlap )
1111
+ qualification = assignment . Qualification .parse_relation_assessment (overlap )
1114
1112
)
1115
1113
1116
1114
if "https://openminds.ebrains.eu/sands/ParcellationEntity" in target .get ("type" ):
@@ -1124,7 +1122,7 @@ def parse_relationship_assessment(cls, src: "Region", assessment):
1124
1122
yield cls (
1125
1123
query_structure = src ,
1126
1124
assigned_structure = reg ,
1127
- qualification = Qualification .parse_relation_assessment (overlap )
1125
+ qualification = assignment . Qualification .parse_relation_assessment (overlap )
1128
1126
)
1129
1127
1130
1128
@classmethod
@@ -1178,7 +1176,7 @@ def translate_pes(cls, src: "Region", _id: Union[str, List[str]]):
1178
1176
yield cls (
1179
1177
query_structure = src ,
1180
1178
assigned_structure = region ,
1181
- qualification = Qualification .OTHER_VERSION
1179
+ qualification = assignment . Qualification .OTHER_VERSION
1182
1180
)
1183
1181
1184
1182
# homologuous
0 commit comments