Skip to content

Commit

Permalink
Test fixes: place n5 in HOME/Desktop/test.n5, add spark.driver.bindAd…
Browse files Browse the repository at this point in the history
…dress setting, and create n5 dataset before rendering it. To run in IntelliJ, edit run configuration classpath to include HOME/.m2/repository/org/apache/hadoop/hadoop-client-runtime/3.3.4/hadoop-client-runtime-3.3.4.jar and select "Add dependencies with "provided" scope to classpath".
  • Loading branch information
trautmane committed Sep 23, 2024
1 parent 8196941 commit 639711d
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -274,13 +274,14 @@ public static void main(final String[] args) {
parameters.stack = "s001_m239_align_no35";
parameters.tileWidth = 2048;
parameters.tileHeight = 2048;
parameters.n5Path = "test.n5";
parameters.n5Path = System.getenv("HOME") + "/Desktop/test.n5";
parameters.n5Dataset = "/output";

final N5Client n5Client = new N5Client(parameters);

final SparkConf sparkConf = new SparkConf()
.setMaster("local[4]") // run spark locally with 4 threads
.set("spark.driver.bindAddress", "127.0.0.1")
.setAppName("test");
final JavaSparkContext sparkContext = new JavaSparkContext(sparkConf);

Expand All @@ -300,6 +301,14 @@ public static void main(final String[] args) {
};
final ImageProcessorCacheSpec cacheSpec = N5Client.buildImageProcessorCacheSpec();

try (final N5Writer n5 = new N5FSWriter(parameters.n5Path)) {
n5.createDataset(fullScaleDatasetName,
dimensions,
blockSize,
DataType.UINT8,
new GzipCompression());
}

n5Client.renderStack(sparkContext,
blockSize,
fullScaleDatasetName,
Expand Down

0 comments on commit 639711d

Please sign in to comment.