embl-cba / imagej-utils

BSD 2-Clause "Simplified" License
2 stars 4 forks source link

Set source active and get source #14

Open tischi opened 3 years ago

tischi commented 3 years ago

@nicokiaru

Do you know how below methods would be implemented in the new bdv?

Because some methods are now deprecated:

public static void setActive( Bdv bdv, int sourceId, boolean active )
{
    bdv.getBdvHandle().getViewerPanel().getVisibilityAndGrouping().setSourceActive( sourceId, active );
}
public static Source< ? > getSource( Bdv bdv, int sourceIndex )
{
    final List< SourceState< ? > > sources = bdv.getBdvHandle().getViewerPanel().getState().getSources();
    return sources.get( sourceIndex ).getSpimSource();
}
NicoKiaru commented 3 years ago

Indices are deprecated, everything go through SourceAndConverter keys.

Maybe having a look at the function makeVisible, isVisible, etc in the SourceAndConverterDisplayService can help ?

https://github.com/bigdataviewer/bigdataviewer-playground/blob/master/src/main/java/sc/fiji/bdvpg/scijava/services/SourceAndConverterBdvDisplayService.java