Skip to content

Commit

Permalink
generalize prealign parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanPreibisch committed Aug 1, 2023
1 parent 42b7bab commit fba9cd9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import org.janelia.render.client.newsolver.blockfactories.ZBlock;
import org.janelia.render.client.newsolver.blocksolveparameters.FIBSEMAlignmentParameters;
import org.janelia.render.client.newsolver.blocksolveparameters.FIBSEMAlignmentParameters.PreAlign;
import org.janelia.render.client.solver.DistributedSolveParameters;
import org.janelia.render.client.solver.RunParameters;

Expand Down Expand Up @@ -69,7 +70,7 @@ public static void main( final String[] args ) throws IOException
//
// setup FIB-SEM solve parameters
//
final boolean rigidPreAlign = false;
final PreAlign preAlign = PreAlign.TRANSLATION;

FIBSEMAlignmentParameters solveParams = new FIBSEMAlignmentParameters(
parameters.blockModel(),
Expand All @@ -80,7 +81,7 @@ public static void main( final String[] args ) throws IOException
parameters.blockOptimizerIterations,
parameters.blockMaxPlateauWidth,
parameters.blockMaxAllowedError,
rigidPreAlign,
preAlign,
parameters.renderWeb.baseDataUrl,
parameters.renderWeb.owner,
parameters.renderWeb.project,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
public class FIBSEMAlignmentParameters< B extends Model< B > & Affine2D< B >, S extends Model< S > & Affine2D< S > > extends BlockDataSolveParameters< S >
{
private static final long serialVersionUID = 4247180309556813829L;
public enum PreAlign { NONE, TRANSLATION, RIGID }

final private B blockSolveModel;
final private Function< Integer, S > stitchingModelSupplier;
Expand All @@ -26,7 +27,7 @@ public class FIBSEMAlignmentParameters< B extends Model< B > & Affine2D< B >, S
final private List<Integer> blockOptimizerIterations;
final private List<Integer> blockMaxPlateauWidth;

final boolean rigidPreAlign;
final int preAlignOrdinal; // storing the ordinal of the enum for serialization purposes
final private double blockMaxAllowedError;

public FIBSEMAlignmentParameters(
Expand All @@ -38,7 +39,7 @@ public FIBSEMAlignmentParameters(
final List<Integer> blockOptimizerIterations,
final List<Integer> blockMaxPlateauWidth,
final double blockMaxAllowedError,
final boolean rigidPreAlign,
final PreAlign preAlign,
final String baseDataUrl,
final String owner,
final String project,
Expand All @@ -54,7 +55,7 @@ public FIBSEMAlignmentParameters(
this.blockOptimizerIterations = blockOptimizerIterations;
this.blockMaxPlateauWidth = blockMaxPlateauWidth;
this.blockMaxAllowedError = blockMaxAllowedError;
this.rigidPreAlign = rigidPreAlign;
this.preAlignOrdinal = preAlign.ordinal();
}

public B blockSolveModelInstance() { return blockSolveModel.copy(); }
Expand All @@ -70,6 +71,5 @@ public FIBSEMAlignmentParameters(
public List<Integer> blockOptimizerIterations() { return blockOptimizerIterations; }
public List<Integer> blockMaxPlateauWidth() {return blockMaxPlateauWidth; }
public double blockMaxAllowedError() { return blockMaxAllowedError; }
public boolean rigidPreAlign() { return rigidPreAlign; }

public PreAlign preAlign() { return PreAlign.values()[ preAlignOrdinal ]; }
}

0 comments on commit fba9cd9

Please sign in to comment.