Skip to content

Latest commit

 

History

History
41 lines (26 loc) · 1.54 KB

loading-data.md

File metadata and controls

41 lines (26 loc) · 1.54 KB

Loading data

Remote datasets

Pass a URL. Kiln uses the sharded binary format if the URL serves a volume.json, OME-Zarr otherwise. See OME-Zarr for what is supported and Hosting for CORS.

import { KilnViewer, preValidateRemoteZarr } from 'kiln-render';

const issues = await preValidateRemoteZarr(url); // optional: reasons the dataset can't load, e.g. unsupported dtype
if (issues.length === 0) await KilnViewer.create(canvas, url);

Local directories

Chrome and Edge only (File System Access API):

import { KilnViewer, LocalZarrDataProvider, promptForZarrDirectory, preValidateLocalZarr } from 'kiln-render';

const handle = await promptForZarrDirectory(); // throws if the API is unavailable
if ((await preValidateLocalZarr(handle)).length === 0) {
  await KilnViewer.create(canvas, new LocalZarrDataProvider(handle));
}

The handle is stored for later visits; see Local files for restoring it and for limitations.

Multichannel

Datasets with a channel axis are detected automatically. See Multichannel for channel selection, colours and windows.

Demo viewer

Click Load in the top bar to paste a URL or choose a local directory, or open a link directly:

https://kilnrender.com/app/?dataset=https://ome-zarr-scivis.s3.us-east-1.amazonaws.com/v0.5/96x2/kingsnake.ome.zarr

Opening a local directory replaces the URL with ?local=true, so the dataset starts from default settings; reloading asks for permission to reopen it.