brainglobe / brainrender-napari

A napari plugin to render BrainGlobe atlases and associated data as layers.
BSD 3-Clause "New" or "Revised" License
18 stars 1 forks source link

Context menu to add additional references #54

Closed alessandrofelder closed 11 months ago

alessandrofelder commented 11 months ago

Description

What is this PR

Why is this PR needed? The main components of atlases we'd like to add as layers include additional reference images.

What does this PR do? Adds functionality to add additional reference images to napari (if the atlas has them). This is achieved by a custom context menu which can be opened via a right-click on the atlas table view. In order to test this well, we now have the mpin_zfish_1um atlas as part of the downloaded test data (as it is the smallest atlas that has additional references, AFAIK).

(Some improving of testing docstrings and variable names are included in this PR)

References

Closes #6

How has this PR been tested?

Is this a breaking change?

Nope

Does this PR require an update to the documentation?

In the future, yes. No high-level documentation for this plugin exists yet.

Checklist:

adamltyson commented 11 months ago

FYI for me the tests don't complete locally (python 3.10, ubuntu). The atlas widget is produced and this seems to block the tests from completing (happens in test_napari_atlas_representation.py).

alessandrofelder commented 11 months ago

right clicking on an atlas without any additional references raises an error:

Good catch! Should be fixed with 7006970 (#54)

Is it a bug in the atlas data that some atlas metadata has an empty list under the "additional_references" key and other atlas metadata doesn't have that key at all, @adamltyson ?

adamltyson commented 11 months ago

Is it a bug in the atlas data that some atlas metadata has an empty list under the "additional_references" key and other atlas metadata doesn't have that key at all, @adamltyson ?

Yeah. I think it's because some atlases were generated before we added the additional_references key.

alessandrofelder commented 11 months ago

Merging as tests pass on CI and locally for me.