Skip to content

feat(loaders): accept pre-constructed GeoTIFF in loadOmeTiff#957

Open
dahannes wants to merge 1 commit intohms-dbmi:mainfrom
dahannes:feat/loadOmeTiff-accept-geotiff-source
Open

feat(loaders): accept pre-constructed GeoTIFF in loadOmeTiff#957
dahannes wants to merge 1 commit intohms-dbmi:mainfrom
dahannes:feat/loadOmeTiff-accept-geotiff-source

Conversation

@dahannes
Copy link
Copy Markdown
Contributor

@dahannes dahannes commented Apr 7, 2026

Adds an optional source property to TiffOptions that accepts a pre-constructed GeoTIFF instance. When provided, createGeoTiff skips its internal HTTP client and uses the given instance directly.

This is the TIFF equivalent of #933 / #944 — where loadOmeZarrFromStore was exported to enable custom stores with dynamic auth. The TIFF loader had no equivalent extension point.

Use case

Serving OME-TIFFs from S3 with STS temporary credentials and client-side SigV4 request signing. Each range request requires a unique Authorization header, which rules out both presigned URLs and static headers. geotiff's fromCustomClient() handles this — this change lets the resulting GeoTIFF flow into viv's pipeline.

Relation to #954

The store-level unification proposed in #954 would make this unnecessary long-term — a single zarrita store (with custom auth) would serve both TIFF and zarr. This PR is an interim solution until that lands.

Changes

  • TiffOptions.source?: GeoTIFF — new optional property
  • createGeoTiffoptions.source ?? await createGeoTiffObject(...)
  • loadSingleFileOmeTiff — passes source through to createGeoTiff
  • Single-file only; companion (multifile) OME-TIFFs are unaffected

Fully backwards-compatible.

@dbmi-svc-checkmarx
Copy link
Copy Markdown

dbmi-svc-checkmarx commented Apr 7, 2026

Logo
Checkmarx One – Scan Summary & Details30ab743d-5e78-488c-b46d-6a0559c49bb5


Fixed Issues (6) Great job! The following issues were fixed in this Pull Request
Severity Issue Source File / Package
LOW Unpinned Actions Full Length Commit SHA /release.yml: 33
LOW Unpinned Actions Full Length Commit SHA /pages.yml: 26
LOW Unpinned Actions Full Length Commit SHA /ci.yml: 37
LOW Unpinned Actions Full Length Commit SHA /ci.yml: 21
LOW Unpinned Actions Full Length Commit SHA /ci.yml: 30
LOW Unpinned Actions Full Length Commit SHA /release.yml: 28

Use @Checkmarx to interact with Checkmarx PR Assistant.
Examples:
@Checkmarx how are you able to help me?
@Checkmarx rescan this PR

Add an optional `source` property to `TiffOptions` that accepts a
pre-constructed `GeoTIFF` instance. When provided, `createGeoTiff`
skips its internal HTTP client (`fromUrl`/`fromBlob`) and uses the
given GeoTIFF directly.

This enables custom transport layers — for example, AWS SigV4 request
signing via geotiff's `fromCustomClient()` — without reimplementing
viv's OME-XML parsing and TiffPixelSource construction pipeline.

Only applies to single-file OME-TIFFs. Companion (multifile) OME-TIFFs
open multiple GeoTIFFs internally and ignore this option.

The change is fully backwards-compatible: existing callers that don't
pass `source` behave exactly as before.
@dahannes dahannes force-pushed the feat/loadOmeTiff-accept-geotiff-source branch from fe59173 to 335729e Compare April 7, 2026 06:51
dahannes added a commit to cytario/cytario-web that referenced this pull request Apr 7, 2026
Replace server-side presigned URL generation with client-side SigV4
request signing for all S3 image access (OME-TIFF + OME-Zarr).

Architecture:
- signedFetch: shared SigV4 signing primitive (app/utils/signedFetch.ts)
- SigV4TiffClient: geotiff BaseClient for TIFF range requests
- CredentialedHTTPStore: zarrita store for zarr chunk requests
- Both delegate to signedFetch for a single auth mechanism

Viewer simplification:
- ViewerStoreProvider accepts { connection, pathName } only
- Format detection + URL construction derived internally
- Strategy pattern: isZarrPath → zarr loader, else → TIFF loader
- Stale cache fix: key includes AccessKeyId for credential rotation

Presigned URLs removed from:
- objects.route.tsx loader (no more per-object presigning)
- connections.loader.ts (no preview/recently-viewed presigning)
- DirectoryViewGrid (unified preview logic, no format branching)
- home.route.tsx (no presignedUrl mapping)

File structure:
- ImageViewer/state/ reorganized into store/, transport/, loaders/,
  decoders/ subdirectories for clearer separation of concerns

Includes patch-package for @vivjs/loaders to accept pre-constructed
GeoTIFF source (see patches/@vivjs+loaders+0.20.0.patch).
Upstream PR: hms-dbmi/viv#957
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.

2 participants