brainglobe / brainglobe-atlasapi

A lightweight python module to interact with atlases for systems neuroscience
https://brainglobe.info/documentation/brainglobe-atlasapi/index.html
BSD 3-Clause "New" or "Revised" License
127 stars 33 forks source link

Access atlas metadata without having to instantiate atlas? #149

Open alessandrofelder opened 1 year ago

alessandrofelder commented 1 year ago

Being able to access the metadata of each atlas though the atlas name, something like:

metadata = bg_atlasapi.get_metadata("example_mouse_100um")

might make the UX of the napari atlas viewer widget smoother and faster, because we could avoid instantiating BrainGlobeAtlas classes just to display the metadata in the info box.

This could provide an alternative solution for the use case described in brainglobe/bg-atlasapi#148

Maybe related to brainglobe/bg-atlasapi#107 and brainglobe/new-website#15 .

adamltyson commented 1 year ago

Insantiting an atlas takes a non-trivial amount of time. Not sure why, I would guess it's: https://github.com/brainglobe/bg-atlasapi/blob/b6e955df1b88b6a998cb4653cc2d76ab57911126/bg_atlasapi/core.py#L48

Rather than a specific function to get atlas metadata, can we just make instantiating the atlas quicker, either by:

alessandrofelder commented 1 year ago

While I agree that making instantiation quicker would be great, I can still see the value of a specific function to get atlas metadata :thinking: for the use case where one might want to know about the atlas without downloading it (and I don't think we can make downloading sufficiently faster)?

adamltyson commented 1 year ago

for the use case where one might want to know about the atlas without downloading it

Yes, good point! I forgot about this. The metadata should be hosted outside of the packaged atlas, so it can be downloaded quickly.

vigji commented 1 year ago

But I'd add that lazy computing stuff like that one is a very good idea!

adamltyson commented 11 months ago

The metadata should be hosted outside of the packaged atlas, so it can be downloaded quickly.

Just bumping this, I had a request for this at SfN.