Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ome.ts: update with dev2 version from the ngff challenge #616

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/datasource/zarr/ome.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export interface OmeMultiscaleMetadata {
coordinateSpace: CoordinateSpace;
}

const SUPPORTED_OME_MULTISCALE_VERSIONS = new Set(["0.4", "0.5-dev"]);
const SUPPORTED_OME_MULTISCALE_VERSIONS = new Set(["0.4", "0.5-dev", "0.5"]);

const OME_UNITS = new Map<string, { unit: string; scale: number }>([
["angstrom", { unit: "m", scale: 1e-10 }],
Expand Down Expand Up @@ -266,7 +266,9 @@ export function parseOmeMetadata(
url: string,
attrs: any,
): OmeMultiscaleMetadata | undefined {
const multiscales = attrs.multiscales;
const ome = attrs.ome;
const multiscales = (ome == undefined) ? attrs.multiscales : ome.multiscales; // >0.4

if (!Array.isArray(multiscales)) return undefined;
const errors: string[] = [];
for (const multiscale of multiscales) {
Expand All @@ -278,7 +280,9 @@ export function parseOmeMetadata(
// Not valid OME multiscale spec.
return undefined;
}
const version = multiscale.version;

const version = (ome == undefined) ? multiscale.version : ome.version; // >0.4

if (version === undefined) return undefined;
if (!SUPPORTED_OME_MULTISCALE_VERSIONS.has(version)) {
errors.push(
Expand Down
Loading