brainglobe-atlasapi
brainglobe-atlasapi copied to clipboard
[Feature] Add an "Out of brain" acronym for the ID 0
Is your feature request related to a problem? Please describe. When querying for structures as ID from coordinates, out of bounds coordinates return 0, but when asking for an acronym, it raises a KeyError value.
Describe the solution you'd like Add an acronym to the id 0, named for example "OutOfBrain" or whatever.
Describe alternatives you've considered This can be managed when using the API with a try/catch but I guess it would be nicer if it is handled directly in the bg-atlasapi.
Additional context Code to reproduce the error :
from bg_atlasapi import BrainGlobeAtlas
atlas = BrainGlobeAtlas("kim_mouse_10um", check_latest=False) # does the same thing with allen_mouse_10um
atlas.structure_from_coords((9386.32578694152, 6137.89857535182, 8869.46676429553), microns=True) # returns 0
atlas.structure_from_coords((9386.32578694152, 6137.89857535182, 8869.46676429553), microns=True, as_acronym=True) # raises KeyError: 0
Thanks for raising this @GuillaumeLeGoc, this is an oversight on our part and should be fixed.