From 624833b6854d5485f2ac0af4ba9eeb84c8c2a1dd Mon Sep 17 00:00:00 2001 From: Michael Innerberger Date: Tue, 23 Apr 2024 17:22:39 -0400 Subject: [PATCH] Add an option to replace last few z-layer flat fields --- .../render/client/MultiSemFlatFieldCorrectionClient.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/render-ws-java-client/src/main/java/org/janelia/render/client/MultiSemFlatFieldCorrectionClient.java b/render-ws-java-client/src/main/java/org/janelia/render/client/MultiSemFlatFieldCorrectionClient.java index ac6e2a393..a98b97a7e 100644 --- a/render-ws-java-client/src/main/java/org/janelia/render/client/MultiSemFlatFieldCorrectionClient.java +++ b/render-ws-java-client/src/main/java/org/janelia/render/client/MultiSemFlatFieldCorrectionClient.java @@ -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) { @@ -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);