ngff_zarr.parse_metadata¶
Module Contents¶
Functions¶
Parse OMERO metadata dictionary into Omero dataclass. |
|
Parse a potential HCS path into store and sub-path components. |
|
Check if root attributes indicate an HCS plate structure. |
|
Check if root attributes indicate a bioformats2raw container layout. |
|
Get the list of image paths from a bioformats2raw container. |
|
Detect NGFF version from root attributes. |
API¶
- ngff_zarr.parse_metadata._extract_method_metadata(
- metadata_dict: dict,
- ngff_zarr.parse_metadata._parse_omero( ) Optional[ngff_zarr.v04.zarr_metadata.Omero]¶
Parse OMERO metadata dictionary into Omero dataclass.
- ngff_zarr.parse_metadata._parse_hcs_path(store_path: str) tuple[str, str | None]¶
Parse a potential HCS path into store and sub-path components.
Parameters
store_path : str Path that may contain a zarr store with an optional sub-path (e.g., ‘plate.zarr/A/1/0’)
Returns
store : str The path to the zarr store (preserves original path separators) subpath : str or None The sub-path within the store using forward slashes, or None if no sub-path
Examples
_parse_hcs_path(‘plate.zarr’) (‘plate.zarr’, None) _parse_hcs_path(‘plate.zarr/A/1/0’) (‘plate.zarr’, ‘A/1/0’) _parse_hcs_path(‘/path/to/plate.ome.zarr/B/2’) (‘/path/to/plate.ome.zarr’, ‘B/2’)
- ngff_zarr.parse_metadata._is_hcs_plate(root_attrs: dict) bool¶
Check if root attributes indicate an HCS plate structure.
Returns True if this is an HCS plate (not a regular image group).
- ngff_zarr.parse_metadata._is_bioformats2raw(root_attrs: dict) bool¶
Check if root attributes indicate a bioformats2raw container layout.
bioformats2raw produces OME-Zarr containers where the root level has a
bioformats2raw.layoutkey (v0.4) or anomekey containingbioformats2raw.layout(v0.5), with the actual image data stored in numbered subdirectories (0/, 1/, …).Returns True if the root is a bioformats2raw container (not a regular image group).
- ngff_zarr.parse_metadata._get_bioformats2raw_series(root) list¶
Get the list of image paths from a bioformats2raw container.
Reads the
seriesarray from theOMEsubgroup if available, otherwise falls back to enumerating subgroups in the root.Parameters
root : zarr.Group The root zarr group of the bioformats2raw container.
Returns
list of str Sorted list of image path strings (e.g.,
["0", "1", "2"]).
- ngff_zarr.parse_metadata._detect_version(root_attrs: dict) ngff_zarr._supported_versions.NgffVersion¶
Detect NGFF version from root attributes.
Handles both regular image groups and HCS plate structures.