Skip to content

Commit

Permalink
add downsample hack to SparkMaskedCLAHEMultiSEM, remove max parameter…
Browse files Browse the repository at this point in the history
… from batch call
  • Loading branch information
trautmane committed Nov 22, 2024
1 parent a11f40f commit 5cdfd83
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.api.java.JavaSparkContext;
import org.janelia.saalfeldlab.hotknife.util.Grid;
import org.janelia.saalfeldlab.hotknife.util.N5PathSupplier;
import org.janelia.saalfeldlab.hotknife.util.Transform;
import org.janelia.saalfeldlab.hotknife.util.Util;
import org.janelia.saalfeldlab.n5.DataType;
Expand Down Expand Up @@ -44,6 +45,8 @@
import net.imglib2.util.Intervals;
import net.imglib2.view.Views;

import static org.janelia.saalfeldlab.n5.spark.downsample.scalepyramid.N5ScalePyramidSpark.downsampleScalePyramid;

public class SparkMaskedCLAHEMultiSEM
{
@SuppressWarnings({"FieldMayBeFinal", "unused"})
Expand Down Expand Up @@ -325,7 +328,19 @@ public static void main(final String... args) throws IOException, InterruptedExc
final JavaSparkContext sparkContext = new JavaSparkContext(conf);
sparkContext.setLogLevel("ERROR");

process( sparkContext, options.n5PathInput, options.n5DatasetInput, options.n5DatasetOutput, options.blockFactorXY, options.blockFactorZ, options.overwrite );
final String fullScaleInputDataset = options.n5DatasetInput + "/s0";
final String outputDataset = options.n5DatasetInput + "_clahe";
final String fullScaleOutputDataset = outputDataset + "/s0";
final int[] downsampleFactors = new int[] { 2, 2, 1 };

process( sparkContext, options.n5PathInput, fullScaleInputDataset, fullScaleOutputDataset, options.blockFactorXY, options.blockFactorZ, options.overwrite );

downsampleScalePyramid(sparkContext,
new N5PathSupplier(options.n5PathInput),
fullScaleOutputDataset,
outputDataset,
downsampleFactors);


sparkContext.close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ public static void main(final String... args) throws Exception {
options.n5PathInput,
n5DatasetInput,
n5DatasetOutput,
n5FieldMax,
options.blockFactorXY,
options.blockFactorZ,
options.overwrite);
Expand Down

0 comments on commit 5cdfd83

Please sign in to comment.