|
| 1 | +package sc.fiji.bdvpg.bdv.source.display; |
| 2 | + |
| 3 | +import bdv.util.BdvFunctions; |
| 4 | +import bdv.util.BdvHandle; |
| 5 | +import bdv.util.BdvOptions; |
| 6 | +import bdv.viewer.Source; |
| 7 | +import bdv.viewer.SourceAndConverter; |
| 8 | +import mpicbg.spim.data.SpimData; |
| 9 | +import sc.fiji.bdvpg.bdv.BDVSingleton; |
| 10 | +import sc.fiji.bdvpg.bdv.navigate.ViewerTransformAdjuster; |
| 11 | +import sc.fiji.bdvpg.bdv.source.append.SourceAdder; |
| 12 | +import sc.fiji.bdvpg.source.importer.SourceLoader; |
| 13 | +import sc.fiji.bdvpg.source.importer.samples.VoronoiSourceGetter; |
| 14 | + |
| 15 | +public class BrightnessAutoAdjusterDemo |
| 16 | +{ |
| 17 | + public static void main( String[] args ) |
| 18 | + { |
| 19 | + // Mri stack |
| 20 | + BdvHandle bdvHandle = BDVSingleton.getInstance(); |
| 21 | + |
| 22 | + final Source source = getMriSource(); |
| 23 | + addSource( bdvHandle, source ); |
| 24 | + |
| 25 | + // Voronoi |
| 26 | + final Source voronoiSource = new VoronoiSourceGetter( new long[]{ 512, 512, 1 }, 256, true ).get(); |
| 27 | + addSource( bdvHandle, voronoiSource ); |
| 28 | + } |
| 29 | + |
| 30 | + public static Source getMriSource() |
| 31 | + { |
| 32 | + final String filePath = "src/test/resources/mri-stack.xml"; |
| 33 | + final SourceLoader sourceLoader = new SourceLoader( filePath ); |
| 34 | + sourceLoader.run(); |
| 35 | + return sourceLoader.getSource( 0 ); |
| 36 | + } |
| 37 | + |
| 38 | + public static void addSource( BdvHandle bdvHandle, Source source ) |
| 39 | + { |
| 40 | + new SourceAdder( bdvHandle, source ).run(); |
| 41 | + new ViewerTransformAdjuster( bdvHandle, source ).run(); |
| 42 | + new BrightnessAutoAdjuster( bdvHandle, source ).run(); |
| 43 | + } |
| 44 | +} |
0 commit comments