diff --git a/src/io.ts b/src/io.ts index 2f0de8d4..7a7d81c7 100644 --- a/src/io.ts +++ b/src/io.ts @@ -125,6 +125,7 @@ function isNested(attrs: Ome.Attrs) { } else if ('well' in attrs) { version = attrs.well.version; } + // OME-Zarr uses nested chunks since version 0.2 return version && version !== '0.1'; } diff --git a/src/ome.ts b/src/ome.ts index 5ba27378..1d1ee509 100644 --- a/src/ome.ts +++ b/src/ome.ts @@ -2,17 +2,10 @@ import { ZarrPixelSource } from '@hms-dbmi/viv'; import pMap from 'p-map'; import { Group as ZarrGroup, HTTPStore, openGroup, ZarrArray } from 'zarr'; import type { ImageLayerConfig, SourceData } from './state'; -import { guessTileSize, join, loadMultiscales, nested, parseMatrix, range } from './utils'; +import { join, loadMultiscales, guessTileSize, range, parseMatrix } from './utils'; -// OME-Zarr uses nested chunks since version 0.2 -function isNested(version: String | undefined): boolean { - return version != undefined && version !== '0.1'; -} export async function loadWell(config: ImageLayerConfig, grp: ZarrGroup, wellAttrs: Ome.Well): Promise { - if (isNested(wellAttrs.version)) { - grp.store = nested(grp.store); - } // Can filter Well fields by URL query ?acquisition=ID const acquisitionId: number | undefined = config.acquisition ? parseInt(config.acquisition) : undefined; let acquisitions: Ome.Acquisition[] = []; @@ -113,9 +106,6 @@ export async function loadWell(config: ImageLayerConfig, grp: ZarrGroup, wellAtt } export async function loadPlate(config: ImageLayerConfig, grp: ZarrGroup, plateAttrs: Ome.Plate): Promise { - if (isNested(plateAttrs.version)) { - grp.store = nested(grp.store); - } if (!('columns' in plateAttrs) || !('rows' in plateAttrs)) { throw Error(`Plate .zattrs missing columns or rows`); } @@ -204,9 +194,6 @@ export async function loadOmeroMultiscales( grp: ZarrGroup, attrs: { multiscales: Ome.Multiscale[]; omero: Ome.Omero } ): Promise { - if (isNested(attrs.multiscales[0]?.version)) { - grp.store = nested(grp.store); - } const { name, opacity = 1, colormap = '' } = config; const data = await loadMultiscales(grp, attrs.multiscales); const meta = parseOmeroMeta(attrs.omero);