@osdlabel/viewer-api
v0.21.0
Published
Viewer state types for osdlabel — cell transforms, UI state, and keyboard shortcut mappings.
Readme
@osdlabel/viewer-api
Viewer state types and utilities for osdlabel, a web-based image annotation library for gigapixel/DZI images.
Depends only on @osdlabel/annotation. No framework dependencies.
Installation
npm install @osdlabel/viewer-apiWhat's inside
ImageId(branded id),createImageId,ImageIdFieldsextension interfaceImageSource— describes a tile source / image to annotatePixelSpacing— physical calibration for measurementsAnnotationState<E>andgetAllAnnotationsFlatCellTransform,DEFAULT_CELL_TRANSFORM— per-cell view state:rotation,flippedH/flippedV, and the tonal fieldsexposure,contrast(both-1–1,0= unchanged) andinvertedViewerControlId— identifies a drag-driven viewer control (currentlytone, the two-axis exposure/contrast gesture)UIState,KeyboardShortcutMap
Usage
import {
type ImageSource,
type AnnotationState,
createImageId,
getAllAnnotationsFlat,
} from '@osdlabel/viewer-api';
const image: ImageSource = {
id: createImageId('slide-1'),
tileSource: 'https://example.com/slides/slide-1.dzi',
label: 'Slide 1',
};License
BSD-3-Clause. Part of the osdlabel monorepo.
