Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Add an "Out of brain" acronym for the ID 0 #157

Closed
GuillaumeLeGoc opened this issue Jul 11, 2023 · 1 comment · Fixed by #299
Closed

[Feature] Add an "Out of brain" acronym for the ID 0 #157

GuillaumeLeGoc opened this issue Jul 11, 2023 · 1 comment · Fixed by #299
Labels
enhancement New feature or request

Comments

@GuillaumeLeGoc
Copy link

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
@GuillaumeLeGoc GuillaumeLeGoc added the enhancement New feature or request label Jul 11, 2023
@adamltyson adamltyson self-assigned this Jul 11, 2023
@adamltyson
Copy link
Member

Thanks for raising this @GuillaumeLeGoc, this is an oversight on our part and should be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants