Skip to content

Unable to obtain an NGFF metadata from a validated zarr.  #60

Description

@odinsbane

I'm not sure if I am accessing the metadata incorrectly or if the metadata is not being loaded correctly. To get the multiscales data, scale, translate, axis I use this.

    N5Metadata rootMetadata = N5MetadataUtils.parseMetadata(reader, "/");
    System.out.println("root metadata: " + rootMetadata);
    if(rootMetadata instanceof OmeNgffMetadata){
        OmeNgffMetadata metadata = (OmeNgffMetadata)rootMetadata;
        for ( OmeNgffMultiScaleMetadata md : metadata.multiscales ){
            System.out.println(md);
        }
    }

When I open zarr files generated by the java n5 or ome-zarr then I get OmeNgffMetadata back.

When I use I used the ngff_zarr python package to create a zarr file. The resulting zarr file validates with

ome_zarr view testing.zarr

When I load the zarr from java I do not get any metadata back for the root, I also try to get the metadata per dataset.

    String[] sets = reader.deepListDatasets("/");
    for(String s: sets){
        N5Metadata n5md = N5MetadataUtils.parseMetadata(reader, s);
        System.out.println(n5md);

In the broken case the metadata is N5DefaultSingleScaleMetadata and I cannot access the values I want

        if(n5md instanceof N5DefaultSingleScaleMetadata){
            N5DefaultSingleScaleMetadata def = (N5DefaultSingleScaleMetadata) n5md;

I check the attributes and I cannot find what I need.

            Map<String, Object> objs = def.getAttributes().asMap();
            for(Map.Entry<String, Object> row : objs.entrySet()){
                System.out.println("row: " + row);
            }

The data is in the zarr file. I generated the data using the code found on an issue. When I run the code in the issue using ngff-zarr==0.12.0 and zarr==2.18.4 I get a valid zarr v2. testing.zarr.tar.gz

Will this library support zarr v3?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions