zarr-developers / zarr-java Goto Github PK
View Code? Open in Web Editor NEWJava implementation of the Zarr Specification
License: MIT License
Java implementation of the Zarr Specification
License: MIT License
In experimenting a bit with writing v3 Zarr and then reading the results back, I haven't been able to read chunks that contain data other than the fill value using the most recent commit (a063c1e). This line seems to be the source of the problem:
If I change that line to if (!chunkIsInArray(chunkCoords)) {
and re-run my test code with the patched version of zarr-java, then I can see non-fill-value data as expected. I'm not sure if I just misunderstand that logic, though - it's also possible there is something wrong with my test data or code.
Minimal test code that demonstrates the issue:
// inputLocation is "/path/to/v3.zarr"
Store store = new FilesystemStore(inputLocation);
Group firstSeries = Group.open(store.resolve("0"));
Node[] resolutions = firstSeries.listAsArray();
for (Node r : resolutions) {
Array resolutionArray = (Array) r;
// only read the first chunk
int[] chunks = resolutionArray.metadata.chunkShape();
long[] offset = new long[] {0, 0, 0, 0, 0};
ucar.ma2.Array tile = resolutionArray.read(offset, chunks);
// test dataset only has uint8 arrays
ByteBuffer buffer = tile.getDataAsByteBuffer();
System.out.println("comparing " + buffer.limit() + " bytes against fill value");
int nonFill = 0;
for (int i=0; i<buffer.limit(); i++) {
if (buffer.get(i) != ((Number) resolutionArray.metadata.fillValue).byteValue()) {
nonFill++;
}
}
// expect this to print a value greater than 0 since none of the chunks are empty
System.out.println("bytes of non-fill: " + nonFill);
}
And test data: v3-example.tar.gz. That is https://openslide.cs.cmu.edu/download/openslide-testdata/Aperio/CMU-1-Small-Region.svs converted with https://github.com/glencoesoftware/bioformats2raw, then copied from v2 to v3 using jzarr to read and zarr-java to write.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.