Skip to content

Commit

Permalink
Add an option to replace last few z-layer flat fields
Browse files Browse the repository at this point in the history
  • Loading branch information
minnerbe committed Apr 23, 2024
1 parent 6992f59 commit 624833b
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ public static class Parameters extends CommandLineParameters {
private String targetStackSuffix = "_corrected";
@Parameter(names = "--inputRoot", description = "Root folder for input data; if given, the structure under this root is replicated in the output folder")
private String inputRoot = null;
@Parameter(names = "--flatFieldConstantFromZ", description = "Maximum z-layer of flat field estimates to consider. All subsequent z-layers get corrected with the maxium, since the estimates can be bad for the last few z-layers. If not given, all z-layers are considered")
private Integer flatFieldConstantFromZ = Integer.MAX_VALUE;
}

public static void main(final String[] args) {
Expand Down Expand Up @@ -90,7 +92,7 @@ public void correctTiles() throws IOException {
for (final TileSpec tileSpec : tileSpecs.getTileSpecs()) {
final ImageProcessor ip = loadImageTile(tileSpec);
final int sfov = extractSfovNumber(tileSpec);
final ImageProcessor flatFieldEstimate = loadFlatFieldEstimate(z, sfov);
final ImageProcessor flatFieldEstimate = loadFlatFieldEstimate(Math.min(z, params.flatFieldConstantFromZ), sfov);

applyFlatFieldCorrection(ip, flatFieldEstimate);

Expand Down

0 comments on commit 624833b

Please sign in to comment.