FZJ-INM1-BDA / siibra-python

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

[0.4] BigBrain is not listed in `supported_spaces` of julich 2.9 and 2.5 parcellations #239

Open AhmetNSimsek opened 1 year ago

AhmetNSimsek commented 1 year ago

When supported spaces of parcellations julich 2.9 and 2.5 are asked, siibra (refactor_v0.4a25) does not list BigBrain.

import siibra
[s.name for s in siibra.parcellations["2.9"].supported_spaces]

current output:

['MNI 152 ICBM 2009c Nonlinear Asymmetric',
 'hcp32k',
 'MNI Colin 27',
 'fsaverage',
 'fsaverage6']
xgui3783 commented 1 year ago

Issue is likely due to https://github.com/FZJ-INM1-BDA/siibra-python/blob/abbecac/siibra/core/region.py#L422

A parcellation is considered supported in a space if and only if all of the children are mapped in that space.

It should be any IMO

edit: as a result, since some region in jba2.9 is not mapped in big brain, it is not returned as one of the supported regions

cc @dickscheid

dickscheid commented 1 year ago

It is not clear to me wether this is the right solution. I would say that the parcellation does not support BigBrain space, since only some regions are available there. There is no access to a complete parcellation map in BigBrain. Is this a concrete problem in some application?

dickscheid commented 1 year ago

Of course we could easily change the line, but then big brain will be considered to produce a representative parcellationmap, which it can't for the complete parcellation.

AhmetNSimsek commented 1 year ago

I was considering from the user perspective and was checking which maps are available through the the tools we have equipped users with the tutorials. While these maps are available, they are not accessible if one does not know about them.

xgui3783 commented 1 year ago

There is no access to a complete parcellation map in BigBrain. Is this a concrete problem in some application?

not so much a problem at the moment, but semantically looks strange, since it seems julich brain 2.9 is not supported in big brain (which we know is not the case)

I wonder if https://github.com/FZJ-INM1-BDA/siibra-python/blob/abbecac/siibra/core/region.py#L435 , instead of returning a boolean, should return an enum, MAP_COVERAGE, which can be FULL, PARTIAL, NONE.

we can then also overwrite the __bool__ method to map FULL to truthy , and rest to falsey to preserve current behaviour. User could iterate and find all partial matches, if they are interested.

AhmetNSimsek commented 1 year ago

What do you think of the following?

@property
def supported_spaces(self) -> Set[_space.Space]:
    """
    The set of spaces for which a mask could be extracted.
    Overwrites the corresponding method of AtlasConcept.
    """
    if self._supported_spaces is None:
        if isinstance(self, _parcellation.Parcellation):
            mapdf = parcellationmap.Map.registry().dataframe
            self._supported_spaces = set(
                mapdf[mapdf.parcellation == self.name].space.values
            )
        else:
            self._supported_spaces = {s for s in _space.Space.registry() if self.mapped_in_space(s)}
    return self._supported_spaces
xgui3783 commented 1 year ago

This is an interesting point.

With the recent decision that JBA parc is to be revised with the full ontology, the supported_spaces needs to be revisited.

@dickscheid is it still the case that

It is not clear to me wether this is the right solution. I would say that the parcellation does not support BigBrain space, since only some regions are available there. There is no access to a complete parcellation map in BigBrain. Is this a concrete problem in some application?

? if this is the case, then jba2.9 is not defined in any of the spaces, because there are always some regions that are not mapped