brainglobe-atlasapi icon indicating copy to clipboard operation
brainglobe-atlasapi copied to clipboard

Access atlas metadata without having to instantiate atlas?

Open alessandrofelder opened this issue 1 year ago • 5 comments

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 .

alessandrofelder avatar Jun 05 '23 10:06 alessandrofelder

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:

  • Lazily loading anything slow
  • Speeding up the slow bits

adamltyson avatar Jun 09 '23 14:06 adamltyson

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)?

alessandrofelder avatar Jun 12 '23 09:06 alessandrofelder

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.

adamltyson avatar Jun 12 '23 09:06 adamltyson

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

vigji avatar Jun 12 '23 20:06 vigji

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.

adamltyson avatar Nov 20 '23 10:11 adamltyson