brainrender-napari icon indicating copy to clipboard operation
brainrender-napari copied to clipboard

[Feature] Investigate leveraging `napari-vedo-bridge`

Open adamltyson opened this issue 1 year ago • 4 comments

This issue is to track how we could make use of napari-vedo-bridge, and to give some more context to this conversation on X.

To state the current situation:

  • We provide napari plugins for a variety of computational neuroanatomy tasks (e.g. registration, segmentation, cell detection)
  • We provide a vedo-based tool for visualisation of mesh data in atlas space - brainrender
  • We would like to: a) Provide a GUI for this atlas-based visualisation b) Allow users to carry out the entire loading/preprocessing/analysis/visualisation workflow within a single environment (napari)

This repo aims to port brainrender to napari. However, there are some outstanding issues:

  • napari doesn't have as many tools to visualise/manipulate meshes
  • Visualisation of meshes unfortunately doesn't look as visually appealing as vedo, and this is a serious issue for publications etc
  • We don't want to maintain two separate code-bases forever

napari-vedo-bridge seems like it could potentially help in a few ways:

  • Allow vedo-based mesh manipulation within napari
  • Possibly allow us to go from a napari canvas to a vedo plotter instance. This could allow more intuitive building of what we call a brainrender scene, but then export to vedo for the final visualisation
  • Provide the building blocks for a common napari/vedo brainrender code-base

We should look into napari-vedo-bridge more and see how we could best leverage it.

adamltyson avatar Jul 22 '24 10:07 adamltyson

Hi @adamltyson ,

thanks for your interest in the vedo-bridge! As discussed on Twitter (I'm stubborn😅) , turning the current cutter widget into a more abstract Baseclass and a more advanced cutting tool would probably help others to make use of the vedo rendering inside napari more easily.

The VedoViewerBase would probably have to expose functionalities to retrieve data from napari and add it to the vedo viewer and vice versa - anything else? 🤔

Other widgets built on top would just have to add their own buttons to the widget to add more functionalities to it.

Allow vedo-based mesh manipulation within napari

Where this is concerned: I am writing up a wrapper for pretty much every vedo function inside napari these days - maybe that could also make mesh interaction a bit more powerful. There is already napari-process-points-and-surfaces, but it's not very actively maintained these days. If you are interested we could collaborate a bit on the napari-vedo-bridge - a broader user base would likely make it easier to maintain in the long run.

jo-mueller avatar Jul 22 '24 16:07 jo-mueller

Thanks for your reply @jo-mueller. That all sounds great on our side. Visualisation isn't a top priority for us now, but it likely will be soon, alongside interactive processing of meshes. We'll make sure to contribute to your tool where possible and avoid reinventing the wheel.

adamltyson avatar Jul 23 '24 09:07 adamltyson

Hi @adamltyson ,

I released the napari-vedo-bridge 0.2.0 earlier. It comes with some mesh processing functions as well as a ore basic vedo/vtk mesh visualization widget that should be a bit easier to copy/extent. Hope it's of use to you and feel free to open any issues regarding improvements :)

jo-mueller avatar Aug 13 '24 08:08 jo-mueller

Thanks @jo-mueller, will take a look!

adamltyson avatar Aug 14 '24 12:08 adamltyson