feat(loaders): accept pre-constructed GeoTIFF in loadOmeTiff#957
Open
dahannes wants to merge 1 commit intohms-dbmi:mainfrom
Open
feat(loaders): accept pre-constructed GeoTIFF in loadOmeTiff#957dahannes wants to merge 1 commit intohms-dbmi:mainfrom
dahannes wants to merge 1 commit intohms-dbmi:mainfrom
Conversation
|
Fixed Issues (6)Great job! The following issues were fixed in this Pull Request
Use @Checkmarx to interact with Checkmarx PR Assistant. |
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.
fe59173 to
335729e
Compare
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
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Adds an optional
sourceproperty toTiffOptionsthat accepts a pre-constructedGeoTIFFinstance. When provided,createGeoTiffskips its internal HTTP client and uses the given instance directly.This is the TIFF equivalent of #933 / #944 — where
loadOmeZarrFromStorewas 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
Authorizationheader, which rules out both presigned URLs and static headers. geotiff'sfromCustomClient()handles this — this change lets the resultingGeoTIFFflow 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 propertycreateGeoTiff—options.source ?? await createGeoTiffObject(...)loadSingleFileOmeTiff— passessourcethrough tocreateGeoTiffFully backwards-compatible.