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

Correctly render the default mesh colour in napari #51

Closed alessandrofelder closed 11 months ago

alessandrofelder commented 11 months ago

Description

What is this PR

Why is this PR needed? Most meshes are coloured white when you add them to napari

What does this PR do? Performs the right colourspace conversion from the structures's RGB to napari rgb, so the mesh default colours are displayed correctly.

References

Closes #50

How has this PR been tested?

Manually: image

Also, added a simple unit test.

Is this a breaking change?

Nope

Does this PR require an update to the documentation?

Docstring of _add_mesh has been updated.

Checklist:

codecov[bot] commented 11 months ago

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.41% :tada:

Comparison is base (78bf071) 93.10% compared to head (669d9c6) 93.52%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #51 +/- ## ========================================== + Coverage 93.10% 93.52% +0.41% ========================================== Files 9 9 Lines 377 386 +9 ========================================== + Hits 351 361 +10 + Misses 26 25 -1 ``` | [Files Changed](https://app.codecov.io/gh/brainglobe/brainglobe-napari/pull/51?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=brainglobe) | Coverage Δ | | |---|---|---| | [...c/brainglobe\_napari/napari\_atlas\_representation.py](https://app.codecov.io/gh/brainglobe/brainglobe-napari/pull/51?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=brainglobe#diff-c3JjL2JyYWluZ2xvYmVfbmFwYXJpL25hcGFyaV9hdGxhc19yZXByZXNlbnRhdGlvbi5weQ==) | `100.00% <ø> (ø)` | | | [...e\_napari/tests/test\_napari\_atlas\_representation.py](https://app.codecov.io/gh/brainglobe/brainglobe-napari/pull/51?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=brainglobe#diff-c3JjL2JyYWluZ2xvYmVfbmFwYXJpL3Rlc3RzL3Rlc3RfbmFwYXJpX2F0bGFzX3JlcHJlc2VudGF0aW9uLnB5) | `100.00% <100.00%> (ø)` | | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/brainglobe/brainglobe-napari/pull/51/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=brainglobe)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.