Open tischi opened 4 years ago
Tobias explained in gitter something about a 'ConverterSetup' class which could specify what can be set in bdv (min/max and optionnally a color) ? Isn't this related?
Yes, this is related. I think currently a ConverterSetup
only makes sense for a ColorConverter
.
Another thing we could do for cases where the provided Converter
is not a ColorConverter
is implement a wrapper, e.g. something like this
public static class ARGBConverter extends ScaledARGBConverter< ARGBType >
{
Converter< ?, ARGBType > converter
public ARGB( final Converter< ?, ARGBType > converter, final double min, final double max )
{
this.converter = converter;
super( min, max );
}
@Override
public void convert( final ? input, final ARGBType output )
{
converter.convert( input, output );
output.set( getScaledColor( output.get() ) );
}
}
@tpietzsch @NicoKiaru I am trying to implement
BdvFunctions.show( SourceAndConverter )
. At some point the code arrives here in bdv-core: https://github.com/bigdataviewer/bigdataviewer-core/blob/6d32df2f4fa849fdbd4b1ad9251a08376e3c82ab/src/main/java/bdv/BigDataViewer.java#L212 where onlyColorConverter
are accepted. I understand that for the current UI this is nice to have, but I guess, in principle, it would also be OK to have an arbitraryConverter< ?, ARGBType >
. What do you think?[EDIT] Maybe it in fact does make sense to only accept
ColorConverter
because otherwise one cannot adjust brightness and contrast. If we want to implement this in a clean way we should then maybe have a new class calledSourceAndColorConverter
? And only allow this one to be shown in the bdv?cc @hanslovsky