Skip to content

Commit 4cb3217

Browse files
support new fusion types, default stays the same
1 parent ec52095 commit 4cb3217

1 file changed

Lines changed: 8 additions & 19 deletions

File tree

src/main/java/net/preibisch/bigstitcher/spark/SparkAffineFusion.java

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import java.util.concurrent.Callable;
3434
import java.util.concurrent.ExecutorService;
3535
import java.util.concurrent.Executors;
36+
import java.util.stream.Collectors;
3637

3738
import org.apache.spark.SparkConf;
3839
import org.apache.spark.api.java.JavaRDD;
@@ -113,12 +114,14 @@ public enum DataTypeFusion
113114
@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)")
114115
private String maskOffset = "0.0,0.0,0.0";
115116

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;
118119

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;
121122

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;
122125

123126
@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.")
124127
private Integer timepointIndex = null;
@@ -182,12 +185,6 @@ public Void call() throws Exception
182185
return null;
183186
}
184187

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-
191188
if ( timepointIndex != null && channelIndex == null || timepointIndex == null && channelIndex != null )
192189
{
193190
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
277274
final DataType dataType = driverVolumeWriter.getAttribute( "/", "Bigstitcher-Spark/DataType", DataType.class );
278275

279276
System.out.println( "FusionFormat: " + fusionFormat );
277+
System.out.println( "FusionType: " + fusionType );
280278
System.out.println( "Input XML: " + xmlURI );
281279
System.out.println( "BDV project: " + bdv );
282280
System.out.println( "numTimepoints of fused dataset(s): " + numTimepoints );
@@ -598,15 +596,6 @@ else if ( dataType == DataType.UINT16 )
598596

599597
System.out.println( "Fusing block: offset=" + Util.printCoordinates( gridBlock[0] ) + ", dimension=" + Util.printCoordinates( gridBlock[1] ) );
600598

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-
610599
// returns a zero-min interval
611600
//blockSupplier = BlkAffineFusion.init(
612601
blockSupplier = BlkAffineFusion.initWithIntensityCoefficients(

0 commit comments

Comments
 (0)