Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested chunk storage #80

Merged
merged 5 commits into from
Mar 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@ sourceCompatibility = 1.8
targetCompatibility = 1.8

repositories {
mavenLocal()
jcenter()
maven {
url 'https://artifacts.glencoesoftware.com/artifactory/ome.releases'
}
maven {
url 'https://repo.glencoesoftware.com/repository/n5-zarr-snapshots/'
}
maven {
url 'https://repo.glencoesoftware.com/repository/jzarr-snapshots'
}
maven {
url 'https://maven.scijava.org/content/groups/public'
}
Expand All @@ -37,7 +41,7 @@ dependencies {
implementation 'ome:formats-gpl:6.5.1'
implementation 'info.picocli:picocli:4.2.0'
implementation 'com.univocity:univocity-parsers:2.8.4'
implementation 'com.bc.zarr:jzarr:0.3.2'
implementation 'com.bc.zarr:jzarr:0.3.3-gs-SNAPSHOT'

implementation 'org.openpnp:opencv:3.4.2-1'
implementation 'me.tongfei:progressbar:0.9.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,13 @@ public class Converter implements Callable<Void> {
PyramidTiffReader.class, MiraxReader.class
};

@Option(
names = "--nested", negatable=true,
description = "Whether to use '/' as the chunk path seprator " +
"(false by default)"
)
private volatile boolean nested = false;

@Option(
names = "--pyramid-name",
description = "Name of pyramid (default: ${DEFAULT-VALUE}) " +
Expand Down Expand Up @@ -1025,6 +1032,7 @@ public void saveResolutions(int series)
workingReader, scaledWidth, scaledHeight))
.chunks(new int[] {1, 1, 1, activeTileHeight, activeTileWidth})
.dataType(dataType)
.nested(nested)
.compressor(CompressorFactory.create(
compressionType.toString(), compressionProperties));
root.createArray(resolutionString, arrayParams);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.EnumSource;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.opencv.core.Core;

public class ZarrTest {
Expand Down Expand Up @@ -767,6 +768,18 @@ public void testDownsampleTypes(Downsampling type) throws IOException {
}
}

/**
* Test that nested storage works equivalently.
*
* @param nested whether to use "/" or "." as the chunk separator.
*/
@ParameterizedTest
@ValueSource(booleans = {true, false})
public void testNestedStorage(boolean nested) throws IOException {
input = fake();
assertTool(nested ? "--nested" : "--no-nested");
}

/**
* Convert a plate with the --no-hcs option.
* The output should not be compliant with OME Zarr HCS.
Expand Down