ome/napari-ome-zarr

Layer name only contains first character from a multi-scale 2D image

andy-sweet opened this issue · 0 comments

When writing a multi-scale image with a name using ome_zarr.writer.write_multiscale, I'd expect to be get that name when reading the layer back in with the reader plugin in this repo.

However, instead the name is truncated to the first character.

Here's a test that I'd expect to pass, but fails because assert "k" == "kermit" fails.

def test_read_multiscale_2d_image_with_name(path: str):
    from ome_zarr.writer import write_multiscale
    from napari_ome_zarr import napari_get_reader
    import zarr
    data = [np.zeros((64, 32)), np.zeros((32, 16))]
    store = parse_url(path, mode="w").store
    root = zarr.group(store=store)
    write_multiscale(data, group=root, name="kermit")

    reader = napari_get_reader(path)
    layers = reader(path)

    assert len(layers) == 1
    _, read_metadata, _ = layers[0]
    assert read_metadata["name"] == "kermit"