Skip to content

Update with main changes#38

Merged
tylere merged 7 commits into
fix/conventions-multiscale-detectionfrom
main
Jun 26, 2026
Merged

Update with main changes#38
tylere merged 7 commits into
fix/conventions-multiscale-detectionfrom
main

Conversation

@tylere

@tylere tylere commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

github-actions Bot and others added 7 commits June 25, 2026 23:57
For stores using the multiscales convention (multiscale-grid profile),
compute the downsample factor for each level from the GeoTransform pixel
sizes and expose it through a new `pyramidLevelDownsamples` profile hook.
The existing `PyramidBadge` already renders "1:X" when `downsample` is
non-null, but the map host (deck.gl tile path) never populated it.

- Add `levelDownsamples: number[]` to `MultiscaleGridContext`
- Add `pyramidLevelDownsamples?` to the `ZarrProfile` interface
- Store per-level downsamples in `tile-activity.ts` via `setPyramid`;
  `tileLoadStart`/`tileLoadEnd` now look up the downsample for the
  current level from the table (image host flow is unaffected since it
  keeps using `setActiveLevel` which bypasses the table)
- Pass downsamples from `App.tsx` when calling `setPyramid`

Closes #33

Co-authored-by: Tyler Erickson <tylere@users.noreply.github.com>
…cale-detection

Fix OME-Zarr mislabel; detect multiscales + link convention specs
…25-2349

Show scale ratio in pyramid badge for multiscale zarr stores
The image-orthographic profile (OME-Zarr bioimaging) was only reachable via
an explicit ?p=image-orthographic. With no override, the default scalar-grid
profile ran, found no lat/lon variables, and errored — so pasting an OME-Zarr
URL (e.g. an IDR v0.5 plate) just failed.

Mirror the existing MultiscaleStoreError redirect: scalar-grid's prepare now
detects OME-Zarr markers in the root attrs and throws OmeZarrStoreError, which
App.tsx catches to switch to image-orthographic (only when no ?p= is pinned).

- isOmeZarrAttrs() detects v0.5 (`ome` wrapper), v0.4 root multiscales (with
  `axes`, distinct from CF/rioxarray pyramids), HCS plate/well, and
  bioformats2raw.layout. Checked BEFORE parseMultiscaleDatasets so a v0.4 OME
  root (which also has `datasets`) doesn't mis-route to multiscale-grid.
- v0.4 (Zarr v2) stores have no root zarr.json, so scalar-grid's v3 open throws
  first; on that failure it retries a metadata-only auto-version open to sniff
  OME markers, else rethrows the original error (geographic fast path unchanged).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The level badge used a displayIndex where 1 = coarsest … N = finest, so a
full-resolution OME-Zarr level read as "Level 3/3" — the opposite of the
OME-Zarr/vizarr/napari convention where dataset 0 is finest.

Relabel in the badge itself via a pure omeLevelLabel() helper: shown = N - level,
max = N - 1. Both render hosts already feed the same displayIndex, so this one
transform fixes the OME image host AND geographic multiscale stores (e.g. Meta
CHM), with no changes to the loaders or stored values. Finest now reads
"Level 0/N-1"; the "· 1:N" ratio is also shown at the finest level (1:1).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
On the map host the level badge was driven only by the tile loader
(tileLoadStart/End), which deck.gl calls on cache misses only. Revisiting an
already-cached zoom fired no fetch, so the badge went stale and reflected
fetching rather than what was on screen.

deck.gl's TileLayer fires onViewportLoad(selectedTiles) on every viewport
change once the selected tiles are loaded — including cache hits. But
@developmentseed/deck.gl-raster's RasterTileLayer builds its inner TileLayer
from a fixed prop list and never forwards that callback. ReportingZarrLayer
subclasses ZarrLayer and clones the inner TileLayer to attach it, reporting the
finest loaded selected tile's level via reportDisplayedTiles(). It no-ops for
non-multiscale stores and while a fetch is in flight (the load path owns the
level then). multiscale-grid now uses ReportingZarrLayer.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ect-and-level-badge

Auto-detect OME-Zarr + OME-Zarr level numbering + cache-independent level badge
@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
geozarr-viewer Ready Ready Preview, Comment Jun 26, 2026 5:23pm

Request Review

@tylere tylere merged commit 1e523b2 into fix/conventions-multiscale-detection Jun 26, 2026
3 checks passed
tylere added a commit that referenced this pull request Jun 26, 2026
…cale-detection

Merge pull request #38 from source-cooperative/main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant