Skip to content

Commit

Permalink
creating workers is now simply explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanPreibisch committed Aug 15, 2023
1 parent 61727bc commit cf8614f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.io.IOException;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Function;

Expand All @@ -10,6 +11,7 @@
import org.janelia.render.client.newsolver.blocksolveparameters.FIBSEMAlignmentParameters;
import org.janelia.render.client.newsolver.setup.AffineSolverSetup;
import org.janelia.render.client.newsolver.setup.RenderSetup;
import org.janelia.render.client.newsolver.solvers.affine.AffineAlignBlockWorker;

import mpicbg.models.Affine2D;
import mpicbg.models.AffineModel2D;
Expand Down Expand Up @@ -97,14 +99,20 @@ public < M extends Model< M > & Affine2D< M >, S extends Model< S > & Affine2D<
//
final BlockCollection< M, AffineModel2D, FIBSEMAlignmentParameters< M, S >, ZBlockFactory > col =
setupBlockCollection( blockFactory, solveParams );
}

protected ZBlockFactory setupBlockFactory()
{
//
// setup Z BlockFactory
// create workers
//
final ArrayList< AffineAlignBlockWorker<M, S, ZBlockFactory > > workers = new ArrayList<>();

for ( final BlockData< M, AffineModel2D, FIBSEMAlignmentParameters< M, S >, ZBlockFactory > block : col.allBlocks() )
{
workers.add( new AffineAlignBlockWorker<>( block, col.maxId() + 1, cmdLineSetup.threadsWorker ) );
}
}

protected ZBlockFactory setupBlockFactory()
{
final int minZ = (int)Math.round( renderSetup.minZ );
final int maxZ = 5000;//(int)Math.round( runParameters.maxZ );
final int blockSize = cmdLineSetup.blockSize;
Expand All @@ -117,9 +125,6 @@ protected < M extends Model< M > & Affine2D< M >, S extends Model< S > & Affine2
final M blockModel,
final S stitchingModel )
{
//
// setup FIB-SEM solve parameters
//
final boolean stitchFirst = cmdLineSetup.stitchFirst;

final FIBSEMAlignmentParameters< M, S > solveParams = new FIBSEMAlignmentParameters< M, S >(
Expand Down Expand Up @@ -152,9 +157,6 @@ protected < M extends Model< M > & Affine2D< M >, S extends Model< S > & Affine2
final ZBlockFactory blockFactory,
final FIBSEMAlignmentParameters< M, S > solveParams )
{
//
// create all blocks
//
final BlockCollection< M, AffineModel2D, FIBSEMAlignmentParameters< M, S >, ZBlockFactory > col =
blockFactory.defineBlockCollection( solveParams );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,6 @@ public BlockData(

public List< Function< Double, Double > > weightFunctions() { return weightF; }

public Worker< M, R, P, F > createWorker()
{
// should maybe ask the solveTypeParamters to create the object I think
return null;
}

/**
* Fetches basic data for all TileSpecs
*
Expand Down

0 comments on commit cf8614f

Please sign in to comment.