FZJ-INM1-BDA / siibra-python

Software interfaces for interacting with brain atlases - Python client
Apache License 2.0
46 stars 8 forks source link

`get_region("6ma")` returns "posterior medial superior frontal gyrus" instead #564

Open xgui3783 opened 4 months ago

xgui3783 commented 4 months ago

as first reported by @SBludau , as of version 1.0a06

import siibra
p = siibra.parcellations['2.9']
r = p.get_region('6ma')
assert r.name == "Area 6ma (preSMA, mesial SFG)" # AssertionError "posterior medial superior frontal gyrus" != "Area 6ma (preSMA, mesial SFG)"

This is the result of find_topmost=True (default get_region parameter). This automatically returns the parent region if all of the child regions returns true. As Area 6ma (preSMA, mesial SFG) is the only child of posterior medial superior frontal gyrus, the node posterior medial superior frontal gyrus is returned instead.

posterior medial superior frontal gyrus
╰── Area 6ma (preSMA, mesial SFG)
    ├── Area 6ma (preSMA, mesial SFG) left
    ╰── Area 6ma (preSMA, mesial SFG) right

I would argue the find_topmost=True behavior should be remedied, so that, the parent should only be selected if all of its children are selected and itself also matched the criteria

AhmetNSimsek commented 4 months ago

This is the intended behavior by design (also after our revisit of get_region) so I am removing the bug label. We should talk with @dickscheid to discuss it.

SBludau commented 4 months ago

This behavior is also visible for

Ursprünglicher Eintrag: Supplementarymotor_sma Gefundene Region: mesial precentral gyrus Identifikator: minds/core/parcellationatlas/v1.0.0/94c1125b-b87e-45e4-901c-00daee7f2579-300_MESIAL_PRECENTRAL_GYRUS

and

Ursprünglicher Eintrag: Supplementarymotor_presma Gefundene Region: posterior medial superior frontal gyrus Identifikator: minds/core/parcellationatlas/v1.0.0/94c1125b-b87e-45e4-901c-00daee7f2579-300_POSTERIOR_MEDIAL_SUPERIOR_FRONTAL_GYRUS