Skip to content

zarr-developers/zarr-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

zarr-java

This repository contains a Java implementation of Zarr version 2 and 3.

Usage

importdev.zarr.zarrjava.store.FilesystemStore; importdev.zarr.zarrjava.store.HttpStore; importdev.zarr.zarrjava.v3.Array; importdev.zarr.zarrjava.v3.DataType; importdev.zarr.zarrjava.v3.Group; Grouphierarchy = Group.open( newHttpStore("https://static.webknossos.org/data/zarr_v3") .resolve("l4_sample") ); Groupcolor = (Group) hierarchy.get("color"); Arrayarray = (Array) color.get("1"); ucar.ma2.ArrayoutArray = array.read( newlong[]{0, 3073, 3073, 513}, // offsetnewint[]{1, 64, 64, 64} // shape ); Arrayarray = Array.create( newFilesystemStore("/path/to/zarr").resolve("array"), Array.metadataBuilder() .withShape(1, 4096, 4096, 1536) .withDataType(DataType.UINT32) .withChunkShape(1, 1024, 1024, 1024) .withFillValue(0) .withCodecs(c -> c.withSharding(newint[]{1, 32, 32, 32}, c1 -> c1.withBlosc())) .build() ); ucar.ma2.Arraydata = ucar.ma2.Array.factory(ucar.ma2.DataType.UINT, newint[]{1, 1024, 1024, 1024}); array.write( newlong[]{0, 0, 0, 0}, // offsetdata );

Development Start-Guide

Run Tests Locally

To be able to run the tests locally, make sure to have python3.11 and uv installed.

Furthermore, you will need the l4_sample test data:

curl https://static.webknossos.org/data/zarr_v3/l4_sample.zip -o testdata/l4_sample.zip && cd testdata && unzip l4_sample.zip

About

Java implementation of the Zarr Specification

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 5