Skip to content

Request: Support for structured (compound) data types #121

@ehennestad

Description

@ehennestad

From the Zarr v2 specification

Structured data types (i.e., with multiple named fields) are encoded as a list of lists, following NumPy array protocol type descriptions (descr). Each sub-list has the form [fieldname, datatype, shape] where shape is optional. fieldname is a string, datatype is a string specifying a simple data type (see above), and shape is a list of integers specifying subarray shape. For example, the JSON list below defines a data type composed of three single-byte unsigned integer fields named “r”, “g” and “b”:

[["r", "|u1"], ["g", "|u1"], ["b", "|u1"]]

I am getting an error when trying to load a compound data type using zarrread.

Error using ZarrDatatype.fromZarrType (line 80)
Invalid argument at position 1. Value must be of type string or be convertible to string.

Error in Zarr/read (line 339)
            obj.Datatype = ZarrDatatype.fromZarrType(info.dtype);
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in zarrread (line 36)
data = zarrObj.read(options.Start, options.Count, options.Stride);
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Dataset: pixel_mask.zip
MATLAB Release: R2024b

Let me know if you need more info!

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