diff --git a/src/main/java/org/janelia/saalfeldlab/n5/ij/N5ScalePyramidExporter.java b/src/main/java/org/janelia/saalfeldlab/n5/ij/N5ScalePyramidExporter.java index 0efe5b1..5f509b1 100644 --- a/src/main/java/org/janelia/saalfeldlab/n5/ij/N5ScalePyramidExporter.java +++ b/src/main/java/org/janelia/saalfeldlab/n5/ij/N5ScalePyramidExporter.java @@ -42,7 +42,6 @@ import java.util.Map; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; @@ -163,6 +162,8 @@ public static enum DOWNSAMPLE_METHOD { Sample, Average }; + public static final DOWNSAMPLE_POLICY DEFAULT_POLICY = DOWNSAMPLE_POLICY.Aggressive; + public static final String DOWN_SAMPLE = "Sample"; public static final String DOWN_AVERAGE = "Average"; @@ -791,18 +792,19 @@ protected > N finalizeMultiscaleMetadata(final return multiscaleMetadata; } - protected boolean lastScale(final int[] chunkSize, final Interval imageDimensions, final M metadata) { + protected boolean lastScale(final int[] chunkSize, final Interval imageDimensions, + final M metadata) { // null check for tests - final String downsamplePolicy = prefs != null ? - prefs.get(getClass(), IJ_PROPERTY_DOWNSAMPLE_POLICY, DOWNSAMPLE_POLICY.Conservative.toString()) : - DOWNSAMPLE_POLICY.Aggressive.toString(); - - switch( DOWNSAMPLE_POLICY.valueOf(downsamplePolicy)) { - case Aggressive: - return lastScaleAggressive(chunkSize, imageDimensions, metadata); - default: - return lastScaleConservative(chunkSize, imageDimensions, metadata); + final String downsamplePolicy = prefs != null + ? prefs.get(getClass(), IJ_PROPERTY_DOWNSAMPLE_POLICY, DEFAULT_POLICY.toString()) + : DEFAULT_POLICY.toString(); + + switch (DOWNSAMPLE_POLICY.valueOf(downsamplePolicy)) { + case Aggressive: + return lastScaleAggressive(chunkSize, imageDimensions, metadata); + default: + return lastScaleConservative(chunkSize, imageDimensions, metadata); } }