bigdataviewer / bigdataviewer-core

ImgLib2-based viewer for registered SPIM stacks and more
BSD 2-Clause "Simplified" License
33 stars 35 forks source link

Can't find how to add / remove overlays in SourceGroup #183

Open NicoKiaru opened 2 months ago

NicoKiaru commented 2 months ago

Hello!

I'm struggling when trying to programmatically add / remove overlays in a source group. Drag and drop overlays from the gui works, but I think that there's a missing way to do it programmatically.

For instance if I create a BdvOverlay like this:

bos = BdvFunctions.showOverlay(selectorOverlay, "Selector_Overlay",
            BdvOptions.options().addTo(bdvh));

I can't find a way to access the SouceAndConverter to use in addSourcesToGroup:

bdvh.getViewerPanel().state().addSourcesToGroup(Collections.singleton(bos.???), group)

Maybe there's a missing accessor in BdvOverlaySource ?

https://github.com/bigdataviewer/bigdataviewer-vistools/blob/b89d8404bd11813e96363e9aecd0cbb58b65b89b/src/main/java/bdv/util/BdvOverlaySource.java#L50-L53