FZJ-INM1-BDA / siibra-python

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

[Bug] Error on getting RegionProps when an experimental parcellation version is forced #68

Closed marcenko closed 3 years ago

marcenko commented 3 years ago

A short example to reproduce the error:

` import siibra as bs from siibra import parcellations

atlas_id = 'juelich/iav/atlas/v1.0.0/1' atlas = bs.atlases[atlas_id]

parcelaltion_id = 'minds/core/parcellationatlas/v1.0.0/94c1125b-b87e-45e4-901c-00daee7f2579-273' atlas.select_parcellation(parcelaltion_id, force=True)

reg_name = 'cerebellar nuclei' selected_region = atlas.find_regions(reg_name)[0] atlas.select_region(selected_region)

space_id = 'minds/core/referencespace/v1.0.0/dafcffc5-4826-4bf1-8ff6-46b8a31ff8e2'

r_props = selected_region.spatialprops(bs.spaces[space_id], force=True) `

This results in IndexError: list index out of range

Changing: atlas.select_parcellation(parcelaltion_id, force=True) To: atlas.select_parcellation(parcelaltion_id, force=False)

Returns a valid result without an error. So using an experimental parcellation version prevents the creation of RegionProps.

marcenko commented 3 years ago

The problem seems to be in this part:

https://github.com/FZJ-INM1-BDA/siibra-python/blob/361999dc20ba4442845c1da062beac2c6309a488/siibra/parcellationmap.py#L312

Running without force=True results in source.volume_type and self.space.type being both nii But with force=True source.volume_type is neuroglancer/precomputed and self.space.type is nii

see also in configuration file: https://jugit.fz-juelich.de/t.dickscheid/brainscapes-configurations/-/blob/develop/spaces/bigbrain_2015.json

@xgui3783 @dickscheid Do you know wether we need to change the data or extend the code to also check for neuroglancer/precomputed as a new case?

xgui3783 commented 3 years ago

I would argue that the code need to accommodate for neuroglancer/precomputed.

Not only because the neuroglancer/precomputed volume source is required for siibra-explorer, but also since neuroglancer/precomputed is in PREFERRED_VOLUMETYPES list, it should be digestable.

edit: a third option would be take neuroglancer/precomputed out of PREFERRED_VOLUMETYPES, (indefinitely, or until the map loader has been implemented.

xgui3783 commented 3 years ago

required dependency CloudVolume should already be capable of parsing neuroglancer/precomputed

marcenko commented 3 years ago

After more testing and debuggin, the solution is: It was actually a configuration error. It was configured different in many places. I did a first fix in siibra-api to have always the dev version for the moment and will create an issue to implement a cleaner solution.