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

Ideas for the integration of BrainGlobe atlases within napari #1

Open
adamltyson opened this issue Feb 27, 2023 · 8 comments
Open

Ideas for the integration of BrainGlobe atlases within napari #1

adamltyson opened this issue Feb 27, 2023 · 8 comments
Assignees
Labels
enhancement New feature or request

Comments

@adamltyson
Copy link
Member

Currently BrainGlobe atlases are used by napari plugins (e.g. brainreg, brainreg-segment), but these are not accessible by napari plugins directly (only by using bg-atlasapi in the plugin code). It would be useful to be able to load, visualise and manipulate these atlases for many reasons, e.g.:

  • To visualise atlas data
  • To use the atlases as a target for third party registration libraries
  • To define coordinate spaces for other analysis tools

As a first pass, my idea is to create a napari plugin that will include some of the functionality of the brainglobe atlas API and CLI, including:

  • Query available atlases
  • Inspect atlas metadata
  • Load (and visualise) atlases

bg-atlasapi represents atlases as an abstract object. It would also be useful to do the same within napari. i.e. represent all the information within an atlas object as a "thing". It won't be a new layer type, but as close to this as possible (layer group?).

A sketch of my idea:
brainglobe-napari-sketch

cc @alessandrofelder @dstansby

@adamltyson adamltyson added the enhancement New feature or request label Feb 27, 2023
@alessandrofelder
Copy link
Member

alessandrofelder commented Feb 27, 2023

What should this napari plugin be called? BrainGlobe-Atlas-Viewer? BrainGlobe-Atlas-Manager?

@adamltyson
Copy link
Member Author

I like BrainGlobe-Atlas-Viewer. It could live in this repo though, and pip install brainglobe-napari would install a number of related plugins.

@alessandrofelder
Copy link
Member

The Layer group PR to Napari has not been merged yet.
LayerList cannot fulfil the functionality we need (it's not a Layer, and therefore we can't have nested LayerLists).

A possible temporary approach would be to encapsulate the conversion from BG atlas api Atlases to our napari atlas type in just one place, so we can easily change how this is done later? For now, this would just add appropriate layers for each of the images and meshes to napari?

@adamltyson
Copy link
Member Author

A possible temporary approach would be to encapsulate the conversion from BG atlas api Atlases to our napari atlas type in just one place, so we can easily change how this is done later? For now, this would just add appropriate layers for each of the images and meshes to napari?

Yeah I think so, unless there's something we can do to help push the layer group PR forwards.

@adamltyson
Copy link
Member Author

FYI for loading meshes into napari - https://github.com/GenevieveBuckley/napari-meshio

This was referenced May 26, 2023
@alessandrofelder
Copy link
Member

@adamltyson what are your thoughts on when/how users can add meshes as napari surface layers?
Naive possibilities are:

  1. add all meshes as layers by default (but that can be slow and lots of layers can be unwieldy in napari (although having nested layers would help a bit)! Initial experiments suggest even slower if we want to colour the meshes by their level in the hierarchy)
  2. only add the root mesh, and have some widgets (a drop down? maybe a search field?) that allow you to add specific meshes you care about?
  3. have a slider with the level of granularity you want to add meshes for. I.e. if the slider is on 3, you add all meshes that are grandchildren of the root mesh (either via the add to viewer button or a separate add meshes button)?

@adamltyson
Copy link
Member Author

I'm leaning towards 2. It could be a tree like structure with checkboxes. I think this is what the brainrender GUI uses.

@adamltyson
Copy link
Member Author

I'm also not sure 3. would be much use to people. I can see instances when it might be helpful to visualise a sub-sub division of area A along with the whole of area B.

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: In Progress
Development

No branches or pull requests

2 participants