OmeZarrImageSource
A multiscale image opened from an OME-Zarr store.
Instances are created with fromHttp or fromFileSystem rather than the constructor. Both factories read the store's metadata up front so the returned source already knows its axes, resolution levels, and channel count. OME-Zarr versions 0.4 and 0.5 are supported and the version is detected from metadata when not given.
A source is handed to a layer which streams chunks from it on demand.
const source = await OmeZarrImageSource.fromHttp({
url: "https://example.com/image.ome.zarr",
});
const layer = new ImageLayer({
source,
sliceCoords: { t: 0, z: 0, c: [0] },
});Types
SourceDimensionMap
Per-axis dimension metadata for a multiscale image source.
Maps the spatial axes x, y, z and the non-spatial axes c and t onto the source's stored dimensions.
| Property | Description |
|---|---|
x: SourceDimension | The x spatial dimension. |
y: SourceDimension | The y spatial dimension. |
z?: SourceDimension | The z spatial dimension if present. |
c?: SourceDimension | The channel dimension if present. |
t?: SourceDimension | The time dimension if present. |
numLods: number | Number of levels of detail in the pyramid. |
SourceDimension
One dimension of a multiscale image source.
| Property | Description |
|---|---|
name: string | Axis name from the source metadata. |
index: number | Position of the axis in the stored arrays. |
unit?: string | Physical unit if declared in the metadata. |
lods: SourceDimensionLod[] | Per-LOD metadata ordered finest first. |
SourceDimensionLod
Metadata for one dimension at one level of detail.
Combines array metadata with the OME-Zarr coordinate transform.
HttpOmeZarrImageSourceProps
Input to OmeZarrImageSource.fromHttp.
| Property | Description |
|---|---|
url: string | URL of the OME-Zarr root group. |
version?: OmeZarrVersion | OME-Zarr version. Detected from metadata when omitted. |
FileSystemOmeZarrImageSourceProps
Input to OmeZarrImageSource.fromFileSystem.
Properties
location
The zarr store location the image was opened from.
readonly location: Location<Readable>;version?
The OME-Zarr version passed at creation if any.
readonly optional version?: "0.5" | "0.4";Accessors
loader OmeZarrImageLoader
The chunk loader that streams this image's data.
get loader(): OmeZarrImageLoader;Methods
getDimensions() SourceDimensionMap
Returns per-axis dimension metadata for the image.
Each axis entry lists one record per level of detail with its size, chunk size, scale, and translation. Use these to convert between array indices and world coordinates, pick slice coordinates, and frame cameras around the image extent.
getDimensions(): SourceDimensionMap;getChannelCount() number
Returns the number of channels in the image.
getChannelCount(): number;fromHttp() Promise<OmeZarrImageSource>
Opens an OME-Zarr image over HTTP(S).
static fromHttp(props): Promise<OmeZarrImageSource>;| Parameter | Description |
|---|---|
props: HttpOmeZarrImageSourceProps | The store url and optional version. |
fromFileSystem() Promise<OmeZarrImageSource>
Opens an OME-Zarr image from a local directory.
Uses the File System Access API so it only works in Chromium-based browsers. Pass the handle returned by window.showDirectoryPicker(). The optional path lets an application ask once for root permission and open many images.
static fromFileSystem(props): Promise<OmeZarrImageSource>;| Parameter | Description |
|---|---|
props: FileSystemOmeZarrImageSourceProps | The directory handle, optional version, and path. |