|
33 | 33 | import java.util.concurrent.Callable; |
34 | 34 | import java.util.concurrent.ExecutorService; |
35 | 35 | import java.util.concurrent.Executors; |
| 36 | +import java.util.stream.Collectors; |
36 | 37 |
|
37 | 38 | import org.apache.spark.SparkConf; |
38 | 39 | import org.apache.spark.api.java.JavaRDD; |
@@ -113,12 +114,14 @@ public enum DataTypeFusion |
113 | 114 | @Option(names = "--maskOffset", description = "allows to make masks larger (+, the mask will include some background) or smaller (-, some fused content will be cut off), warning: in the non-isotropic coordinate space of the raw input images (default: 0.0,0.0,0.0)") |
114 | 115 | private String maskOffset = "0.0,0.0,0.0"; |
115 | 116 |
|
116 | | - @Option(names = { "--firstTileWins" }, description = "use firstTileWins fusion strategy, with lowest ViewIds winning (default: false - using weighted average blending fusion)") |
117 | | - private boolean firstTileWins = false; |
| 117 | + //@Option(names = { "--firstTileWins" }, description = "use firstTileWins fusion strategy, with lowest ViewIds winning (default: false - using weighted average blending fusion)") |
| 118 | + //private boolean firstTileWins = false; |
118 | 119 |
|
119 | | - @Option(names = { "--firstTileWinsInverse" }, description = "use firstTileWins fusion strategy, with highest ViewIds winning (default: false - using weighted average blending fusion)") |
120 | | - private boolean firstTileWinsInverse = false; |
| 120 | + //@Option(names = { "--firstTileWinsInverse" }, description = "use firstTileWins fusion strategy, with highest ViewIds winning (default: false - using weighted average blending fusion)") |
| 121 | + //private boolean firstTileWinsInverse = false; |
121 | 122 |
|
| 123 | + @Option(names = {"-f", "--fusion"}, description = "Strategy for merging overlapping views during fusion, supported: AVG, AVG_BLEND, AVG_CONTENT, AVG_BLEND_CONTENT, MAX_INTENSITY, LOWEST_VIEWID_WINS, HIGHEST_VIEWID_WINS, CLOSEST_PIXEL_WINS (default: AVG_BLEND)") |
| 124 | + private FusionType fusionType = FusionType.AVG_BLEND; |
122 | 125 |
|
123 | 126 | @Option(names = { "-t", "--timepointIndex" }, description = "specify a specific timepoint index of the output container that should be fused, usually you would also specify what --angleId, --tileId, ... or ViewIds -vi are being fused.") |
124 | 127 | private Integer timepointIndex = null; |
@@ -182,12 +185,6 @@ public Void call() throws Exception |
182 | 185 | return null; |
183 | 186 | } |
184 | 187 |
|
185 | | - if ( firstTileWins && firstTileWinsInverse ) |
186 | | - { |
187 | | - System.out.println( "You can only choose one of the two firstTileWins or firstTileWinsInverse."); |
188 | | - return null; |
189 | | - } |
190 | | - |
191 | 188 | if ( timepointIndex != null && channelIndex == null || timepointIndex == null && channelIndex != null ) |
192 | 189 | { |
193 | 190 | System.out.println( "You have to specify timepointId and channelId together, one alone does not work. timepointId =" + timepointIndex + ", channelId=" + channelIndex ); |
@@ -277,6 +274,7 @@ else if ( outputPathURIString.toLowerCase().endsWith( ".h5" ) || outPathURI.toSt |
277 | 274 | final DataType dataType = driverVolumeWriter.getAttribute( "/", "Bigstitcher-Spark/DataType", DataType.class ); |
278 | 275 |
|
279 | 276 | System.out.println( "FusionFormat: " + fusionFormat ); |
| 277 | + System.out.println( "FusionType: " + fusionType ); |
280 | 278 | System.out.println( "Input XML: " + xmlURI ); |
281 | 279 | System.out.println( "BDV project: " + bdv ); |
282 | 280 | System.out.println( "numTimepoints of fused dataset(s): " + numTimepoints ); |
@@ -598,15 +596,6 @@ else if ( dataType == DataType.UINT16 ) |
598 | 596 |
|
599 | 597 | System.out.println( "Fusing block: offset=" + Util.printCoordinates( gridBlock[0] ) + ", dimension=" + Util.printCoordinates( gridBlock[1] ) ); |
600 | 598 |
|
601 | | - final FusionType fusionType; |
602 | | - |
603 | | - if ( firstTileWins ) |
604 | | - fusionType = FusionType.FIRST_LOW; |
605 | | - else if ( firstTileWinsInverse ) |
606 | | - fusionType = FusionType.FIRST_HIGH; |
607 | | - else |
608 | | - fusionType = FusionType.AVG_BLEND; |
609 | | - |
610 | 599 | // returns a zero-min interval |
611 | 600 | //blockSupplier = BlkAffineFusion.init( |
612 | 601 | blockSupplier = BlkAffineFusion.initWithIntensityCoefficients( |
|
0 commit comments