Skip to content

Commit

Permalink
Rename BlockFusion -> BlockCombiner
Browse files Browse the repository at this point in the history
  • Loading branch information
minnerbe committed Sep 7, 2023
1 parent 4d9ec9a commit 1571266
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import mpicbg.models.InterpolatedAffineModel2D;
import mpicbg.models.RigidModel2D;
import org.janelia.render.client.newsolver.assembly.Assembler;
import org.janelia.render.client.newsolver.assembly.BlockFusion;
import org.janelia.render.client.newsolver.assembly.BlockCombiner;
import org.janelia.render.client.newsolver.assembly.BlockSolver;
import org.janelia.render.client.newsolver.assembly.matches.SameTileMatchCreatorAffine2D;
import org.janelia.render.client.newsolver.blockfactories.XYBlockFactory;
Expand Down Expand Up @@ -153,8 +153,8 @@ public static void main( final String[] args ) throws IOException
cmdLineSetup.distributedSolve.maxIterationsGlobal,
cmdLineSetup.distributedSolve.threadsGlobal);

final BlockFusion<AffineModel2D, AffineModel2D, RigidModel2D, AffineModel2D > fusion =
new BlockFusion<>(
final BlockCombiner<AffineModel2D, AffineModel2D, RigidModel2D, AffineModel2D > fusion =
new BlockCombiner<>(
blockSolver,
(r,g) -> {
final AffineModel2D i = new AffineModel2D();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import org.janelia.render.client.newsolver.assembly.Assembler;
import org.janelia.render.client.newsolver.assembly.BlockSolver;
import org.janelia.render.client.newsolver.assembly.BlockFusion;
import org.janelia.render.client.newsolver.assembly.BlockCombiner;
import org.janelia.render.client.newsolver.assembly.matches.SameTileMatchCreatorAffine2D;
import org.janelia.render.client.newsolver.blockfactories.ZBlockFactory;
import org.janelia.render.client.newsolver.blocksolveparameters.FIBSEMAlignmentParameters;
Expand Down Expand Up @@ -160,8 +160,8 @@ public static void main( final String[] args ) throws IOException
cmdLineSetup.distributedSolve.maxIterationsGlobal,
cmdLineSetup.distributedSolve.threadsGlobal);

final BlockFusion<AffineModel2D, AffineModel2D, RigidModel2D, AffineModel2D > fusion =
new BlockFusion<>(
final BlockCombiner<AffineModel2D, AffineModel2D, RigidModel2D, AffineModel2D > fusion =
new BlockCombiner<>(
blockSolver,
(r,g) -> {
final AffineModel2D i = new AffineModel2D();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import org.janelia.render.client.newsolver.assembly.Assembler;
import org.janelia.render.client.newsolver.assembly.AssemblyMaps;
import org.janelia.render.client.newsolver.assembly.BlockSolver;
import org.janelia.render.client.newsolver.assembly.BlockFusion;
import org.janelia.render.client.newsolver.assembly.BlockCombiner;
import org.janelia.render.client.newsolver.assembly.matches.SameTileMatchCreatorAffineIntensity;
import org.janelia.render.client.newsolver.blockfactories.ZBlockFactory;
import org.janelia.render.client.newsolver.blocksolveparameters.FIBSEMIntensityCorrectionParameters;
Expand Down Expand Up @@ -147,10 +147,10 @@ public AssemblyMaps<ArrayList<AffineModel1D>> assembleBlocks(final List<BlockDat
cmdLineSetup.distributedSolve.maxIterationsGlobal,
cmdLineSetup.distributedSolve.threadsGlobal);

final BlockFusion<ArrayList<AffineModel1D>, ArrayList<AffineModel1D>, TranslationModel1D, ArrayList<AffineModel1D>> fusion =
new BlockFusion<>(blockSolver,
DistributedIntensityCorrectionSolver::integrateGlobalTranslation,
DistributedIntensityCorrectionSolver::combineWeightedModels);
final BlockCombiner<ArrayList<AffineModel1D>, ArrayList<AffineModel1D>, TranslationModel1D, ArrayList<AffineModel1D>> fusion =
new BlockCombiner<>(blockSolver,
DistributedIntensityCorrectionSolver::integrateGlobalTranslation,
DistributedIntensityCorrectionSolver::combineWeightedModels);

final Assembler<ArrayList<AffineModel1D>, TranslationModel1D, ArrayList<AffineModel1D>> assembler =
new Assembler<>(allItems, blockSolver, fusion, r -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,24 @@ public class Assembler<Z, G extends Model<G>, R>
{
final List<BlockData<?, R, ?>> blocks;
final BlockSolver<Z, G, R> blockSolver;
final BlockFusion<Z, ?, G, R> blockFusion;
final BlockCombiner<Z, ?, G, R> blockCombiner;
final Function<R, Z> converter;

/**
* @param blocks - all individually computed blocks
* @param blockSolver - solver to use for the final assembly
* @param blockFusion - fusion to use for the final assembly
* @param blockCombiner - fusion to use for the final assembly
* @param converter - a converter from R to Z - for the trivial case of a single block
*/
public Assembler(
final List<BlockData<?, R, ?>> blocks,
final BlockSolver<Z, G, R> blockSolver,
final BlockFusion<Z, ?, G, R> blockFusion,
final BlockCombiner<Z, ?, G, R> blockCombiner,
final Function<R, Z> converter )
{
this.blocks = blocks;
this.blockSolver = blockSolver;
this.blockFusion = blockFusion;
this.blockCombiner = blockCombiner;
this.converter = converter;
}

Expand All @@ -63,7 +63,7 @@ public AssemblyMaps< Z > createAssembly()
blockSolver.globalSolve(blocks, am);

// now fuse blocks into a full assembly
blockFusion.fuseGlobally(am, blockToTile);
blockCombiner.fuseGlobally(am, blockToTile);
} catch (final Exception e) {
throw new RuntimeException("failed assembly", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
import java.util.Set;
import java.util.function.BiFunction;

public class BlockFusion<Z, I, G extends Model<G>, R> {
public class BlockCombiner<Z, I, G extends Model<G>, R> {

final BlockSolver<Z, G, R> solver;
final BiFunction<R, G, I> combineResultGlobal;
final BiFunction<List<I>, List<Double>, Z> fusion;

public BlockFusion(
public BlockCombiner(
final BlockSolver<Z, G, R> solver,
final BiFunction<R, G, I> combineResultGlobal,
final BiFunction<List<I>, List<Double>, Z> fusion
Expand Down Expand Up @@ -120,5 +120,5 @@ public double compute(final double x, final double y, final double z) {
}
}

private static final Logger LOG = LoggerFactory.getLogger(BlockFusion.class);
private static final Logger LOG = LoggerFactory.getLogger(BlockCombiner.class);
}

0 comments on commit 1571266

Please sign in to comment.