@jax-data-science/sci-image-visualizer 0.8.3 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +201 -460
- package/esm2022/index.mjs +34 -15
- package/esm2022/lib/channel-histogram/channel-histogram.component.mjs +163 -91
- package/esm2022/lib/contracts/capabilities.contract.mjs +4 -3
- package/esm2022/lib/contracts/cell-segmenter.contract.mjs +1 -1
- package/esm2022/lib/contracts/channel-histogram-api.contract.mjs +5 -1
- package/esm2022/lib/contracts/color.mjs +60 -0
- package/esm2022/lib/contracts/colormap-lut.mjs +213 -57
- package/esm2022/lib/contracts/coordinate-transform.contract.mjs +1 -1
- package/esm2022/lib/contracts/display-types.mjs +11 -1
- package/esm2022/lib/contracts/image.contract.mjs +1 -1
- package/esm2022/lib/contracts/instance-segmenter.contract.mjs +1 -1
- package/esm2022/lib/contracts/intensity.mjs +48 -5
- package/esm2022/lib/contracts/plot-type-contribution.contract.mjs +1 -1
- package/esm2022/lib/contracts/plot-type.mjs +134 -17
- package/esm2022/lib/contracts/ports/image-state.port.mjs +4 -1
- package/esm2022/lib/contracts/ports/preferences.port.mjs +5 -1
- package/esm2022/lib/contracts/ports/region-io.port.mjs +2 -1
- package/esm2022/lib/contracts/ports/spatial-data.port.mjs +5 -1
- package/esm2022/lib/contracts/ports/tile-access.port.mjs +2 -1
- package/esm2022/lib/contracts/region-editor-api.contract.mjs +1 -1
- package/esm2022/lib/contracts/region-overlay.contract.mjs +1 -1
- package/esm2022/lib/contracts/region-store.contract.mjs +1 -1
- package/esm2022/lib/contracts/sam.contract.mjs +1 -1
- package/esm2022/lib/contracts/section-view.contract.mjs +2 -0
- package/esm2022/lib/contracts/semantic-segmenter.contract.mjs +1 -1
- package/esm2022/lib/contracts/spatial-dataset.contract.mjs +3 -1
- package/esm2022/lib/contracts/toolbar-tool.contract.mjs +6 -4
- package/esm2022/lib/contracts/visualizer.contract.mjs +1 -1
- package/esm2022/lib/contracts/viz-config.mjs +2 -1
- package/esm2022/lib/geometry/contour.mjs +63 -0
- package/esm2022/lib/geometry/loft.mjs +128 -0
- package/esm2022/lib/geometry/polylabel.mjs +156 -0
- package/esm2022/lib/geometry/raster.mjs +98 -0
- package/esm2022/lib/geometry/reconstruct.mjs +315 -0
- package/esm2022/lib/geometry/reslice-image.mjs +57 -0
- package/esm2022/lib/geometry/ring.mjs +201 -0
- package/esm2022/lib/geometry/section.mjs +215 -0
- package/esm2022/lib/hex-color-picker/hex-color-picker.component.mjs +202 -102
- package/esm2022/lib/implementations/base-store-visualizer.mjs +201 -48
- package/esm2022/lib/implementations/napari-js/napari-axes-gizmo.mjs +65 -0
- package/esm2022/lib/implementations/napari-js/napari-display-state.mjs +136 -0
- package/esm2022/lib/implementations/napari-js/napari-helpers.mjs +199 -0
- package/esm2022/lib/implementations/napari-js/napari-image-2d-scene.mjs +602 -0
- package/esm2022/lib/implementations/napari-js/napari-loading-badge.mjs +12 -9
- package/esm2022/lib/implementations/napari-js/napari-loading-state.mjs +83 -0
- package/esm2022/lib/implementations/napari-js/napari-region-mesh-pointer.mjs +100 -0
- package/esm2022/lib/implementations/napari-js/napari-region-overlay.mjs +180 -591
- package/esm2022/lib/implementations/napari-js/napari-scene.mjs +2 -0
- package/esm2022/lib/implementations/napari-js/napari-spatial-2d-scene.mjs +614 -0
- package/esm2022/lib/implementations/napari-js/napari-spatial-3d-scene.mjs +769 -0
- package/esm2022/lib/implementations/napari-js/napari-spatial-encoding.mjs +199 -0
- package/esm2022/lib/implementations/napari-js/napari-spatial-hover.mjs +270 -0
- package/esm2022/lib/implementations/napari-js/napari-spatial-scene.mjs +159 -0
- package/esm2022/lib/implementations/napari-js/napari-spatial-tiles.mjs +106 -1408
- package/esm2022/lib/implementations/napari-js/napari-spatial-tooltip.mjs +2 -2
- package/esm2022/lib/implementations/napari-js/napari-surface-scene.mjs +271 -0
- package/esm2022/lib/implementations/napari-js/napari-tile-client.mjs +562 -0
- package/esm2022/lib/implementations/napari-js/napari-tool-bridge.mjs +347 -0
- package/esm2022/lib/implementations/napari-js/napari-visualizer.service.mjs +427 -4207
- package/esm2022/lib/implementations/napari-js/napari-volume-region-meshes.mjs +129 -0
- package/esm2022/lib/implementations/napari-js/napari-volume-scene.mjs +550 -0
- package/esm2022/lib/implementations/napari-js/napari-volume-slice-planes.mjs +103 -0
- package/esm2022/lib/implementations/napari-js/napari-volume-z-handle.mjs +6 -6
- package/esm2022/lib/implementations/napari-js/region-overlay/overlay-projection.mjs +96 -0
- package/esm2022/lib/implementations/napari-js/region-overlay/region-edit.mjs +35 -0
- package/esm2022/lib/implementations/napari-js/region-overlay/region-svg-renderer.mjs +194 -0
- package/esm2022/lib/implementations/napari-js/spatial-tiles/categorical-lookup.mjs +30 -0
- package/esm2022/lib/implementations/napari-js/spatial-tiles/cell-layers.mjs +274 -0
- package/esm2022/lib/implementations/napari-js/spatial-tiles/density-layer.mjs +144 -0
- package/esm2022/lib/implementations/napari-js/spatial-tiles/layer-groups.mjs +165 -0
- package/esm2022/lib/implementations/napari-js/spatial-tiles/plan-context.mjs +78 -0
- package/esm2022/lib/implementations/napari-js/spatial-tiles/transcript-hover.mjs +182 -0
- package/esm2022/lib/implementations/napari-js/spatial-tiles/transcript-jobs.mjs +369 -0
- package/esm2022/lib/implementations/napari-js/spatial-tiles/transcript-layers.mjs +306 -0
- package/esm2022/lib/implementations/osd/display-pipeline.mjs +102 -40
- package/esm2022/lib/implementations/osd/histogram-sampler.mjs +56 -31
- package/esm2022/lib/implementations/osd/openseadragon-viewer-options.mjs +128 -0
- package/esm2022/lib/implementations/osd/openseadragon-visualizer.service.mjs +333 -1685
- package/esm2022/lib/implementations/osd/osd-coordinate-transform.mjs +1 -1
- package/esm2022/lib/implementations/osd/osd-coords.mjs +5 -6
- package/esm2022/lib/implementations/osd/osd-export.mjs +122 -0
- package/esm2022/lib/implementations/osd/osd-lib.mjs +15 -1
- package/esm2022/lib/implementations/osd/osd-navigator-chrome.mjs +205 -0
- package/esm2022/lib/implementations/osd/osd-pixel-readback.mjs +68 -0
- package/esm2022/lib/implementations/osd/osd-region-overlay-draw.mjs +164 -0
- package/esm2022/lib/implementations/osd/osd-region-overlay.mjs +213 -716
- package/esm2022/lib/implementations/osd/osd-scale-bar.mjs +52 -60
- package/esm2022/lib/implementations/osd/osd-tile-source.mjs +105 -0
- package/esm2022/lib/implementations/osd/osd-viewer-like.mjs +2 -0
- package/esm2022/lib/implementations/osd/osd-viewer-mount.mjs +44 -0
- package/esm2022/lib/implementations/osd/osd-viewport.mjs +184 -0
- package/esm2022/lib/implementations/osd/osd-zoom.mjs +7 -1
- package/esm2022/lib/implementations/osd/simple-source.mjs +395 -0
- package/esm2022/lib/implementations/osd/slice-cache.mjs +53 -48
- package/esm2022/lib/implementations/osd/tile-client.mjs +32 -11
- package/esm2022/lib/implementations/osd/tile-recolor.mjs +330 -0
- package/esm2022/lib/implementations/plotly/omics-trace-builders.mjs +161 -73
- package/esm2022/lib/implementations/plotly/plotly-coordinate-transform.mjs +1 -1
- package/esm2022/lib/implementations/plotly/plotly-image-loader.mjs +112 -0
- package/esm2022/lib/implementations/plotly/plotly-image-recolor.mjs +178 -0
- package/esm2022/lib/implementations/plotly/plotly-intensity-inset.mjs +33 -0
- package/esm2022/lib/implementations/plotly/plotly-isosurface-controls.mjs +83 -0
- package/esm2022/lib/implementations/plotly/plotly-layouts.mjs +121 -0
- package/esm2022/lib/implementations/plotly/plotly-readback.mjs +117 -0
- package/esm2022/lib/implementations/plotly/plotly-region-overlay.mjs +19 -10
- package/esm2022/lib/implementations/plotly/plotly-shape-projection.mjs +223 -0
- package/esm2022/lib/implementations/plotly/plotly-trace-builders.mjs +79 -19
- package/esm2022/lib/implementations/plotly/plotly-zoom-controller.mjs +223 -0
- package/esm2022/lib/implementations/plotly/plotly.service.mjs +439 -1655
- package/esm2022/lib/implementations/region-centroids.mjs +47 -0
- package/esm2022/lib/implementations/simple-slice-access.service.mjs +22 -12
- package/esm2022/lib/implementations/spatial-data-http/spatial-data-http.service.mjs +172 -92
- package/esm2022/lib/implementations/spatial-data-http/spatial-wire.mjs +103 -22
- package/esm2022/lib/implementations/tile-server/index.mjs +6 -0
- package/esm2022/lib/implementations/tile-server/native-histogram.mjs +30 -0
- package/esm2022/lib/implementations/tile-server/poll-descriptor.mjs +65 -0
- package/esm2022/lib/implementations/tile-server/tile-protocol.mjs +42 -0
- package/esm2022/lib/implementations/tile-server/transport.mjs +135 -0
- package/esm2022/lib/intensity/intensity-profile.mjs +107 -0
- package/esm2022/lib/intensity/intensity-profile.service.mjs +223 -0
- package/esm2022/lib/intensity-inset/intensity-inset.component.mjs +133 -0
- package/esm2022/lib/models/bezier.mjs +1 -11
- package/esm2022/lib/models/class-preset.mjs +41 -3
- package/esm2022/lib/models/geometry.mjs +27 -164
- package/esm2022/lib/models/polygon-edit.mjs +254 -0
- package/esm2022/lib/models/polygon-factory.mjs +134 -0
- package/esm2022/lib/models/region-clone.mjs +68 -0
- package/esm2022/lib/models/region-geojson.mjs +411 -0
- package/esm2022/lib/models/region.mjs +34 -33
- package/esm2022/lib/models/shape.mjs +18 -16
- package/esm2022/lib/plot-mode/contribution-host.mjs +297 -0
- package/esm2022/lib/plot-mode/plot-mode-controller.mjs +9 -6
- package/esm2022/lib/plot-mode/plot-type-menu.mjs +85 -0
- package/esm2022/lib/plot-mode/tool-params-model.mjs +87 -0
- package/esm2022/lib/plot.utilities.mjs +296 -473
- package/esm2022/lib/processing/image-crop.mjs +1 -1
- package/esm2022/lib/processing/processing-image.mjs +28 -15
- package/esm2022/lib/provide-visualization.mjs +40 -14
- package/esm2022/lib/region-editor/class-tree/class-tree.component.mjs +156 -0
- package/esm2022/lib/region-editor/class-tree/class-tree.mjs +108 -0
- package/esm2022/lib/region-editor/classes-panel/classes-panel.component.mjs +163 -0
- package/esm2022/lib/region-editor/file-stem.mjs +13 -0
- package/esm2022/lib/region-editor/manage-classes-dialog/manage-classes-dialog.component.mjs +118 -0
- package/esm2022/lib/region-editor/mask-export.service.mjs +98 -0
- package/esm2022/lib/region-editor/mask-raster.mjs +11 -5
- package/esm2022/lib/region-editor/region-color-dialog/region-color-dialog.component.mjs +56 -0
- package/esm2022/lib/region-editor/region-editor-help/region-editor-help.component.mjs +28 -0
- package/esm2022/lib/region-editor/region-editor.component.mjs +896 -660
- package/esm2022/lib/region-editor/region-metrics.mjs +86 -0
- package/esm2022/lib/region-editor/region-persistence.service.mjs +160 -0
- package/esm2022/lib/region-editor/region-table/region-table.component.mjs +169 -0
- package/esm2022/lib/region-editor/save-mask-dialog/save-mask-dialog.component.mjs +91 -0
- package/esm2022/lib/region-editor/save-regions-dialog/save-regions-dialog.component.mjs +92 -0
- package/esm2022/lib/region-ops.service.mjs +28 -70
- package/esm2022/lib/region-overlay/region-geometry.mjs +360 -0
- package/esm2022/lib/region-overlay/region-hit-test.mjs +103 -0
- package/esm2022/lib/region-overlay/region-source-layer.mjs +378 -0
- package/esm2022/lib/region-overlay/region-style.mjs +97 -0
- package/esm2022/lib/region-overlay/svg-region-renderer.mjs +228 -0
- package/esm2022/lib/region-source/http-region-source.mjs +104 -0
- package/esm2022/lib/region-source/region-source-ops.mjs +53 -0
- package/esm2022/lib/region-source/region-source-worker.mjs +10 -0
- package/esm2022/lib/region-source/region-source.mjs +67 -0
- package/esm2022/lib/region-source/region-tiles.mjs +708 -0
- package/esm2022/lib/region-source/worker-region-source.mjs +229 -0
- package/esm2022/lib/render-orchestrator.mjs +14 -11
- package/esm2022/lib/render-session.mjs +207 -0
- package/esm2022/lib/routing-visualizer.service.mjs +858 -414
- package/esm2022/lib/section-pane/section-pane.component.mjs +299 -0
- package/esm2022/lib/spatial/density-raster.mjs +14 -0
- package/esm2022/lib/spatial/embedding-compute-coordinator.mjs +239 -0
- package/esm2022/lib/spatial/embedding-compute.mjs +43 -10
- package/esm2022/lib/spatial/gene-search.mjs +1 -1
- package/esm2022/lib/spatial/glyphs.mjs +97 -0
- package/esm2022/lib/spatial/lod.mjs +187 -0
- package/esm2022/lib/spatial/spatial-controls.facade.mjs +200 -0
- package/esm2022/lib/spatial/spatial-density.mjs +25 -16
- package/esm2022/lib/spatial/spatial-encoding.mjs +26 -82
- package/esm2022/lib/spatial/spatial-expression.mjs +43 -42
- package/esm2022/lib/spatial/spatial-framing.mjs +1 -1
- package/esm2022/lib/spatial/spatial-heatmap.mjs +6 -3
- package/esm2022/lib/spatial/spatial-hover.mjs +5 -33
- package/esm2022/lib/spatial/spatial-panel-model.mjs +282 -0
- package/esm2022/lib/spatial/spatial-sections.mjs +1 -1
- package/esm2022/lib/spatial/spatial-selection.mjs +33 -46
- package/esm2022/lib/spatial/spatial-tile-merge.mjs +219 -0
- package/esm2022/lib/spatial/spatial-tiles.mjs +12 -648
- package/esm2022/lib/spatial/spatial-volume-image.mjs +2 -4
- package/esm2022/lib/spatial/stats.mjs +71 -0
- package/esm2022/lib/spatial/transcript-grouping.mjs +307 -0
- package/esm2022/lib/spatial-controls/spatial-cells-panel/spatial-cells-panel.component.mjs +150 -0
- package/esm2022/lib/spatial-controls/spatial-charts/chart-data-model.mjs +309 -0
- package/esm2022/lib/spatial-controls/spatial-charts/chart-help.mjs +145 -0
- package/esm2022/lib/spatial-controls/spatial-charts/plotly-chart-host.mjs +158 -0
- package/esm2022/lib/spatial-controls/spatial-charts/spatial-chart-window/spatial-chart-window.component.mjs +47 -0
- package/esm2022/lib/spatial-controls/spatial-charts/spatial-charts.component.mjs +297 -802
- package/esm2022/lib/spatial-controls/spatial-charts/spatial-embedding-controls/spatial-embedding-controls.component.mjs +89 -0
- package/esm2022/lib/spatial-controls/spatial-charts/spatial-heatmap-controls/spatial-heatmap-controls.component.mjs +52 -0
- package/esm2022/lib/spatial-controls/spatial-controls.component.mjs +143 -1238
- package/esm2022/lib/spatial-controls/spatial-gene-picker.mjs +153 -0
- package/esm2022/lib/spatial-controls/spatial-gene-tree/spatial-gene-tree.component.mjs +241 -0
- package/esm2022/lib/spatial-controls/spatial-groups-panel/spatial-groups-panel.component.mjs +193 -0
- package/esm2022/lib/spatial-controls/spatial-key/spatial-key.component.mjs +132 -0
- package/esm2022/lib/spatial-controls/spatial-key/spatial-key.model.mjs +67 -0
- package/esm2022/lib/spatial-controls/spatial-marker-genes-form/spatial-marker-genes-form.component.mjs +147 -0
- package/esm2022/lib/spatial-controls/spatial-observations-panel/spatial-observations-panel.component.mjs +300 -0
- package/esm2022/lib/spatial-controls/spatial-transcripts-panel/spatial-transcripts-panel.component.mjs +370 -0
- package/esm2022/lib/store/class-color.util.mjs +53 -5
- package/esm2022/lib/store/class-signatures.mjs +63 -0
- package/esm2022/lib/store/region-history.mjs +146 -0
- package/esm2022/lib/store/region-scope-cache.mjs +144 -0
- package/esm2022/lib/store/region-selection.mjs +82 -0
- package/esm2022/lib/store/region-source-scope.mjs +171 -0
- package/esm2022/lib/store/region-store.service.mjs +986 -670
- package/esm2022/lib/store/spatial-selection.service.mjs +2 -2
- package/esm2022/lib/store/visualizer-store.service.mjs +81 -76
- package/esm2022/lib/toast-outlets.mjs +5 -4
- package/esm2022/lib/toolbar/brush/brush-tool.service.mjs +92 -434
- package/esm2022/lib/toolbar/canvas-tools.mjs +20 -0
- package/esm2022/lib/toolbar/crop/slide-crop.mjs +26 -42
- package/esm2022/lib/toolbar/plot-type-selector/plot-type-selector.component.mjs +85 -0
- package/esm2022/lib/toolbar/region-tools/region-tool-buttons.mjs +74 -0
- package/esm2022/lib/toolbar/region-tools/region-tools.component.mjs +120 -0
- package/esm2022/lib/toolbar/segmentation/cell-segment-tool.service.mjs +74 -78
- package/esm2022/lib/toolbar/segmentation/cellpose-segmenter.service.mjs +50 -8
- package/esm2022/lib/toolbar/segmentation/onnx-sam-session.mjs +61 -42
- package/esm2022/lib/toolbar/segmentation/pending-calls.mjs +47 -0
- package/esm2022/lib/toolbar/segmentation/sam-model-registry.mjs +12 -4
- package/esm2022/lib/toolbar/segmentation/sam-onnx-core.mjs +70 -14
- package/esm2022/lib/toolbar/segmentation/sam-point-tool.service.mjs +135 -172
- package/esm2022/lib/toolbar/segmentation/sam-prompt.mjs +9 -90
- package/esm2022/lib/toolbar/segmentation/sam-session.service.mjs +183 -0
- package/esm2022/lib/toolbar/segmentation/sam-tool.service.mjs +95 -150
- package/esm2022/lib/toolbar/segmentation/segmentation-commit.mjs +12 -0
- package/esm2022/lib/toolbar/segmentation/segmentation-runner.mjs +108 -0
- package/esm2022/lib/toolbar/segmentation-tools/segmentation-tools.component.mjs +155 -0
- package/esm2022/lib/toolbar/stack-controls/stack-controls.component.mjs +121 -0
- package/esm2022/lib/toolbar/tool-kit/async-tool-status.mjs +37 -0
- package/esm2022/lib/toolbar/tool-kit/canvas-tool-manager.mjs +63 -0
- package/esm2022/lib/toolbar/tool-kit/canvas-tool.mjs +2 -0
- package/esm2022/lib/toolbar/tool-kit/frame-pixels.mjs +108 -0
- package/esm2022/lib/toolbar/tool-kit/mask-stroke-editor.mjs +306 -0
- package/esm2022/lib/toolbar/tool-kit/matrix-frame.mjs +61 -0
- package/esm2022/lib/toolbar/tool-kit/tool-overlay.mjs +140 -0
- package/esm2022/lib/toolbar/tool-kit/undo-gesture.mjs +24 -0
- package/esm2022/lib/toolbar/tool-slider/tool-slider.component.mjs +63 -0
- package/esm2022/lib/toolbar/toolbar-help-dialog/toolbar-help-dialog.component.mjs +50 -0
- package/esm2022/lib/toolbar/toolbar.component.mjs +84 -119
- package/esm2022/lib/toolbar/vertex-eraser/vertex-eraser-tool.service.mjs +93 -115
- package/esm2022/lib/toolbar/view-controls/view-controls.component.mjs +107 -0
- package/esm2022/lib/toolbar/wand/wand-region-grow.mjs +321 -0
- package/esm2022/lib/toolbar/wand/wand-tool.service.mjs +121 -416
- package/esm2022/lib/toolbar/wand/wand.service.mjs +30 -894
- package/esm2022/lib/toolbar/zoom-to-box/zoom-to-box-tool.service.mjs +48 -90
- package/esm2022/lib/util/mark-for-check.mjs +17 -0
- package/esm2022/lib/util/supersede.mjs +56 -0
- package/esm2022/lib/visualization.module.mjs +39 -141
- package/esm2022/lib/visualizer/floating-drag.directive.mjs +58 -0
- package/esm2022/lib/visualizer/region-actions.mjs +149 -0
- package/esm2022/lib/visualizer/region-load.mjs +123 -0
- package/esm2022/lib/visualizer/spatial-dataset-binder.mjs +163 -0
- package/esm2022/lib/visualizer/tool-modes.mjs +113 -0
- package/esm2022/lib/visualizer/viewer-shortcuts.mjs +167 -0
- package/esm2022/lib/visualizer/visualizer-context-menu.mjs +119 -0
- package/esm2022/lib/visualizer/volume-sections.mjs +175 -0
- package/esm2022/lib/visualizer.component.mjs +602 -1902
- package/esm2022/lib/workers/spatial-math-ops.mjs +43 -0
- package/esm2022/lib/workers/spatial-math-worker.mjs +10 -0
- package/esm2022/lib/workers/spatial-math.mjs +190 -0
- package/fesm2022/jax-data-science-sci-image-visualizer-jax-data-science-sci-image-visualizer-BKQhpbHv.mjs +47169 -0
- package/fesm2022/jax-data-science-sci-image-visualizer-jax-data-science-sci-image-visualizer-BKQhpbHv.mjs.map +1 -0
- package/fesm2022/jax-data-science-sci-image-visualizer-onnx-sam-session-z1IN-F7w.mjs +238 -0
- package/fesm2022/jax-data-science-sci-image-visualizer-onnx-sam-session-z1IN-F7w.mjs.map +1 -0
- package/fesm2022/jax-data-science-sci-image-visualizer-region-source-worker-CAqBjM5L.mjs +12 -0
- package/fesm2022/jax-data-science-sci-image-visualizer-region-source-worker-CAqBjM5L.mjs.map +1 -0
- package/fesm2022/jax-data-science-sci-image-visualizer-spatial-math-worker-BzVFFqGS.mjs +12 -0
- package/fesm2022/jax-data-science-sci-image-visualizer-spatial-math-worker-BzVFFqGS.mjs.map +1 -0
- package/fesm2022/jax-data-science-sci-image-visualizer.mjs +41 -34467
- package/fesm2022/jax-data-science-sci-image-visualizer.mjs.map +1 -1
- package/fesm2022/mask.worker.js +36 -917
- package/fesm2022/onnx-sam.worker.js +52 -16
- package/fesm2022/region-source.worker.js +1067 -0
- package/fesm2022/spatial-math.worker.js +471 -0
- package/fesm2022/tsne.worker.js +32 -15
- package/index.d.ts +19 -10
- package/lib/channel-histogram/channel-histogram.component.d.ts +53 -43
- package/lib/contracts/capabilities.contract.d.ts +4 -2
- package/lib/contracts/cell-segmenter.contract.d.ts +1 -0
- package/lib/contracts/channel-histogram-api.contract.d.ts +4 -0
- package/lib/contracts/color.d.ts +27 -0
- package/lib/contracts/colormap-lut.d.ts +19 -4
- package/lib/contracts/coordinate-transform.contract.d.ts +3 -3
- package/lib/contracts/display-types.d.ts +21 -0
- package/lib/contracts/image.contract.d.ts +4 -0
- package/lib/contracts/instance-segmenter.contract.d.ts +5 -0
- package/lib/contracts/intensity.d.ts +13 -2
- package/lib/contracts/plot-type.d.ts +3 -1
- package/lib/contracts/ports/image-state.port.d.ts +6 -2
- package/lib/contracts/ports/preferences.port.d.ts +4 -0
- package/lib/contracts/ports/region-io.port.d.ts +1 -0
- package/lib/contracts/ports/spatial-data.port.d.ts +4 -10
- package/lib/contracts/ports/tile-access.port.d.ts +1 -0
- package/lib/contracts/region-editor-api.contract.d.ts +85 -1
- package/lib/contracts/region-overlay.contract.d.ts +5 -0
- package/lib/contracts/region-store.contract.d.ts +22 -0
- package/lib/contracts/sam.contract.d.ts +7 -0
- package/lib/contracts/section-view.contract.d.ts +44 -0
- package/lib/contracts/semantic-segmenter.contract.d.ts +6 -0
- package/lib/contracts/spatial-dataset.contract.d.ts +19 -6
- package/lib/contracts/toolbar-tool.contract.d.ts +1 -0
- package/lib/contracts/visualizer.contract.d.ts +231 -54
- package/lib/contracts/viz-config.d.ts +9 -0
- package/lib/geometry/contour.d.ts +24 -0
- package/lib/geometry/loft.d.ts +22 -0
- package/lib/geometry/polylabel.d.ts +23 -0
- package/lib/geometry/raster.d.ts +42 -0
- package/lib/geometry/reconstruct.d.ts +54 -0
- package/lib/geometry/reslice-image.d.ts +33 -0
- package/lib/geometry/ring.d.ts +67 -0
- package/lib/geometry/section.d.ts +52 -0
- package/lib/hex-color-picker/hex-color-picker.component.d.ts +61 -27
- package/lib/implementations/base-store-visualizer.d.ts +61 -15
- package/lib/implementations/napari-js/napari-axes-gizmo.d.ts +36 -0
- package/lib/implementations/napari-js/napari-display-state.d.ts +76 -0
- package/lib/implementations/napari-js/napari-helpers.d.ts +129 -0
- package/lib/implementations/napari-js/napari-image-2d-scene.d.ts +162 -0
- package/lib/implementations/napari-js/napari-loading-badge.d.ts +4 -3
- package/lib/implementations/napari-js/napari-loading-state.d.ts +37 -0
- package/lib/implementations/napari-js/napari-region-mesh-pointer.d.ts +32 -0
- package/lib/implementations/napari-js/napari-region-overlay.d.ts +68 -71
- package/lib/implementations/napari-js/napari-scene.d.ts +126 -0
- package/lib/implementations/napari-js/napari-spatial-2d-scene.d.ts +163 -0
- package/lib/implementations/napari-js/napari-spatial-3d-scene.d.ts +212 -0
- package/lib/implementations/napari-js/napari-spatial-encoding.d.ts +114 -0
- package/lib/implementations/napari-js/napari-spatial-hover.d.ts +91 -0
- package/lib/implementations/napari-js/napari-spatial-scene.d.ts +118 -0
- package/lib/implementations/napari-js/napari-spatial-tiles.d.ts +56 -263
- package/lib/implementations/napari-js/napari-spatial-tooltip.d.ts +1 -1
- package/lib/implementations/napari-js/napari-surface-scene.d.ts +76 -0
- package/lib/implementations/napari-js/napari-tile-client.d.ts +214 -0
- package/lib/implementations/napari-js/napari-tool-bridge.d.ts +179 -0
- package/lib/implementations/napari-js/napari-visualizer.service.d.ts +169 -883
- package/lib/implementations/napari-js/napari-volume-region-meshes.d.ts +66 -0
- package/lib/implementations/napari-js/napari-volume-scene.d.ts +148 -0
- package/lib/implementations/napari-js/napari-volume-slice-planes.d.ts +43 -0
- package/lib/implementations/napari-js/napari-volume-z-handle.d.ts +8 -12
- package/lib/implementations/napari-js/region-overlay/overlay-projection.d.ts +59 -0
- package/lib/implementations/napari-js/region-overlay/region-edit.d.ts +15 -0
- package/lib/implementations/napari-js/region-overlay/region-svg-renderer.d.ts +54 -0
- package/lib/implementations/napari-js/spatial-tiles/categorical-lookup.d.ts +26 -0
- package/lib/implementations/napari-js/spatial-tiles/cell-layers.d.ts +70 -0
- package/lib/implementations/napari-js/spatial-tiles/density-layer.d.ts +61 -0
- package/lib/implementations/napari-js/spatial-tiles/layer-groups.d.ts +67 -0
- package/lib/implementations/napari-js/spatial-tiles/plan-context.d.ts +38 -0
- package/lib/implementations/napari-js/spatial-tiles/transcript-hover.d.ts +71 -0
- package/lib/implementations/napari-js/spatial-tiles/transcript-jobs.d.ts +105 -0
- package/lib/implementations/napari-js/spatial-tiles/transcript-layers.d.ts +56 -0
- package/lib/implementations/osd/display-pipeline.d.ts +38 -9
- package/lib/implementations/osd/histogram-sampler.d.ts +22 -12
- package/lib/implementations/osd/openseadragon-viewer-options.d.ts +35 -0
- package/lib/implementations/osd/openseadragon-visualizer.service.d.ts +78 -354
- package/lib/implementations/osd/osd-coordinate-transform.d.ts +2 -1
- package/lib/implementations/osd/osd-coords.d.ts +6 -4
- package/lib/implementations/osd/osd-export.d.ts +36 -0
- package/lib/implementations/osd/osd-lib.d.ts +7 -0
- package/lib/implementations/osd/osd-navigator-chrome.d.ts +69 -0
- package/lib/implementations/osd/osd-pixel-readback.d.ts +22 -0
- package/lib/implementations/osd/osd-region-overlay-draw.d.ts +38 -0
- package/lib/implementations/osd/osd-region-overlay.d.ts +46 -51
- package/lib/implementations/osd/osd-scale-bar.d.ts +8 -6
- package/lib/implementations/osd/osd-tile-source.d.ts +49 -0
- package/lib/implementations/osd/osd-viewer-like.d.ts +100 -0
- package/lib/implementations/osd/osd-viewer-mount.d.ts +14 -0
- package/lib/implementations/osd/osd-viewport.d.ts +77 -0
- package/lib/implementations/osd/osd-zoom.d.ts +6 -0
- package/lib/implementations/osd/simple-source.d.ts +161 -0
- package/lib/implementations/osd/slice-cache.d.ts +12 -3
- package/lib/implementations/osd/tile-client.d.ts +11 -14
- package/lib/implementations/osd/tile-recolor.d.ts +141 -0
- package/lib/implementations/plotly/omics-trace-builders.d.ts +32 -20
- package/lib/implementations/plotly/plotly-image-loader.d.ts +49 -0
- package/lib/implementations/plotly/plotly-image-recolor.d.ts +75 -0
- package/lib/implementations/plotly/plotly-intensity-inset.d.ts +8 -0
- package/lib/implementations/plotly/plotly-isosurface-controls.d.ts +38 -0
- package/lib/implementations/plotly/plotly-layouts.d.ts +188 -0
- package/lib/implementations/plotly/plotly-readback.d.ts +41 -0
- package/lib/implementations/plotly/plotly-region-overlay.d.ts +2 -2
- package/lib/implementations/plotly/plotly-shape-projection.d.ts +92 -0
- package/lib/implementations/plotly/plotly-trace-builders.d.ts +23 -12
- package/lib/implementations/plotly/plotly-zoom-controller.d.ts +86 -0
- package/lib/implementations/plotly/plotly.service.d.ts +136 -401
- package/lib/implementations/region-centroids.d.ts +14 -0
- package/lib/implementations/simple-slice-access.service.d.ts +7 -4
- package/lib/implementations/spatial-data-http/spatial-data-http.service.d.ts +42 -18
- package/lib/implementations/spatial-data-http/spatial-wire.d.ts +34 -9
- package/lib/implementations/tile-server/index.d.ts +5 -0
- package/lib/implementations/tile-server/native-histogram.d.ts +25 -0
- package/lib/implementations/tile-server/poll-descriptor.d.ts +39 -0
- package/lib/implementations/tile-server/tile-protocol.d.ts +83 -0
- package/lib/implementations/tile-server/transport.d.ts +62 -0
- package/lib/intensity/intensity-profile.d.ts +66 -0
- package/lib/intensity/intensity-profile.service.d.ts +108 -0
- package/lib/intensity-inset/intensity-inset.component.d.ts +58 -0
- package/lib/models/bezier.d.ts +0 -5
- package/lib/models/class-preset.d.ts +25 -0
- package/lib/models/geometry.d.ts +14 -48
- package/lib/models/polygon-edit.d.ts +72 -0
- package/lib/models/polygon-factory.d.ts +45 -0
- package/lib/models/region-clone.d.ts +20 -0
- package/lib/models/region-geojson.d.ts +57 -0
- package/lib/models/region.d.ts +59 -4
- package/lib/models/shape.d.ts +8 -0
- package/lib/plot-mode/contribution-host.d.ts +125 -0
- package/lib/plot-mode/plot-type-menu.d.ts +60 -0
- package/lib/plot-mode/tool-params-model.d.ts +49 -0
- package/lib/plot.utilities.d.ts +19 -30
- package/lib/processing/processing-image.d.ts +5 -2
- package/lib/provide-visualization.d.ts +19 -2
- package/lib/region-editor/class-tree/class-tree.component.d.ts +78 -0
- package/lib/region-editor/class-tree/class-tree.d.ts +31 -0
- package/lib/region-editor/classes-panel/classes-panel.component.d.ts +86 -0
- package/lib/region-editor/file-stem.d.ts +7 -0
- package/lib/region-editor/manage-classes-dialog/manage-classes-dialog.component.d.ts +45 -0
- package/lib/region-editor/mask-export.service.d.ts +54 -0
- package/lib/region-editor/mask-raster.d.ts +2 -8
- package/lib/region-editor/region-color-dialog/region-color-dialog.component.d.ts +29 -0
- package/lib/region-editor/region-editor-help/region-editor-help.component.d.ts +11 -0
- package/lib/region-editor/region-editor.component.d.ts +283 -200
- package/lib/region-editor/region-metrics.d.ts +34 -0
- package/lib/region-editor/region-persistence.service.d.ts +77 -0
- package/lib/region-editor/region-table/region-table.component.d.ts +89 -0
- package/lib/region-editor/save-mask-dialog/save-mask-dialog.component.d.ts +36 -0
- package/lib/region-editor/save-regions-dialog/save-regions-dialog.component.d.ts +37 -0
- package/lib/region-ops.service.d.ts +1 -7
- package/lib/region-overlay/region-geometry.d.ts +158 -0
- package/lib/region-overlay/region-hit-test.d.ts +38 -0
- package/lib/region-overlay/region-source-layer.d.ts +96 -0
- package/lib/region-overlay/region-style.d.ts +52 -0
- package/lib/region-overlay/svg-region-renderer.d.ts +110 -0
- package/lib/region-source/http-region-source.d.ts +45 -0
- package/lib/region-source/region-source-ops.d.ts +89 -0
- package/lib/region-source/region-source-worker.d.ts +7 -0
- package/lib/region-source/region-source.d.ts +82 -0
- package/lib/region-source/region-tiles.d.ts +289 -0
- package/lib/region-source/worker-region-source.d.ts +65 -0
- package/lib/render-orchestrator.d.ts +6 -2
- package/lib/render-session.d.ts +75 -0
- package/lib/routing-visualizer.service.d.ts +248 -59
- package/lib/section-pane/section-pane.component.d.ts +47 -0
- package/lib/spatial/density-raster.d.ts +6 -0
- package/lib/spatial/embedding-compute-coordinator.d.ts +123 -0
- package/lib/spatial/embedding-compute.d.ts +21 -2
- package/lib/spatial/glyphs.d.ts +16 -0
- package/lib/spatial/lod.d.ts +94 -0
- package/lib/spatial/spatial-controls.facade.d.ts +64 -0
- package/lib/spatial/spatial-density.d.ts +15 -5
- package/lib/spatial/spatial-encoding.d.ts +11 -44
- package/lib/spatial/spatial-expression.d.ts +40 -22
- package/lib/spatial/spatial-framing.d.ts +1 -0
- package/lib/spatial/spatial-heatmap.d.ts +2 -0
- package/lib/spatial/spatial-hover.d.ts +4 -16
- package/lib/spatial/spatial-panel-model.d.ts +135 -0
- package/lib/spatial/spatial-selection.d.ts +21 -26
- package/lib/spatial/spatial-tile-merge.d.ts +41 -0
- package/lib/spatial/spatial-tiles.d.ts +9 -256
- package/lib/spatial/stats.d.ts +38 -0
- package/lib/spatial/transcript-grouping.d.ts +119 -0
- package/lib/spatial-controls/spatial-cells-panel/spatial-cells-panel.component.d.ts +64 -0
- package/lib/spatial-controls/spatial-charts/chart-data-model.d.ts +153 -0
- package/lib/spatial-controls/spatial-charts/chart-help.d.ts +69 -0
- package/lib/spatial-controls/spatial-charts/plotly-chart-host.d.ts +98 -0
- package/lib/spatial-controls/spatial-charts/spatial-chart-window/spatial-chart-window.component.d.ts +26 -0
- package/lib/spatial-controls/spatial-charts/spatial-charts.component.d.ts +101 -260
- package/lib/spatial-controls/spatial-charts/spatial-embedding-controls/spatial-embedding-controls.component.d.ts +43 -0
- package/lib/spatial-controls/spatial-charts/spatial-heatmap-controls/spatial-heatmap-controls.component.d.ts +27 -0
- package/lib/spatial-controls/spatial-controls.component.d.ts +68 -448
- package/lib/spatial-controls/spatial-gene-picker.d.ts +86 -0
- package/lib/spatial-controls/spatial-gene-tree/spatial-gene-tree.component.d.ts +102 -0
- package/lib/spatial-controls/spatial-groups-panel/spatial-groups-panel.component.d.ts +72 -0
- package/lib/spatial-controls/spatial-key/spatial-key.component.d.ts +66 -0
- package/lib/spatial-controls/spatial-key/spatial-key.model.d.ts +33 -0
- package/lib/spatial-controls/spatial-marker-genes-form/spatial-marker-genes-form.component.d.ts +64 -0
- package/lib/spatial-controls/spatial-observations-panel/spatial-observations-panel.component.d.ts +117 -0
- package/lib/spatial-controls/spatial-transcripts-panel/spatial-transcripts-panel.component.d.ts +142 -0
- package/lib/store/class-color.util.d.ts +39 -2
- package/lib/store/class-signatures.d.ts +11 -0
- package/lib/store/region-history.d.ts +66 -0
- package/lib/store/region-scope-cache.d.ts +65 -0
- package/lib/store/region-selection.d.ts +36 -0
- package/lib/store/region-source-scope.d.ts +68 -0
- package/lib/store/region-store.service.d.ts +312 -116
- package/lib/store/visualizer-store.service.d.ts +32 -33
- package/lib/toast-outlets.d.ts +4 -3
- package/lib/toolbar/brush/brush-tool.service.d.ts +31 -98
- package/lib/toolbar/canvas-tools.d.ts +20 -0
- package/lib/toolbar/crop/slide-crop.d.ts +10 -4
- package/lib/toolbar/plot-type-selector/plot-type-selector.component.d.ts +38 -0
- package/lib/toolbar/region-tools/region-tool-buttons.d.ts +21 -0
- package/lib/toolbar/region-tools/region-tools.component.d.ts +62 -0
- package/lib/toolbar/segmentation/cell-segment-tool.service.d.ts +10 -14
- package/lib/toolbar/segmentation/cellpose-segmenter.service.d.ts +12 -2
- package/lib/toolbar/segmentation/onnx-sam-session.d.ts +22 -3
- package/lib/toolbar/segmentation/pending-calls.d.ts +31 -0
- package/lib/toolbar/segmentation/sam-model-registry.d.ts +9 -3
- package/lib/toolbar/segmentation/sam-onnx-core.d.ts +18 -5
- package/lib/toolbar/segmentation/sam-point-tool.service.d.ts +46 -32
- package/lib/toolbar/segmentation/sam-prompt.d.ts +7 -31
- package/lib/toolbar/segmentation/sam-session.service.d.ts +74 -0
- package/lib/toolbar/segmentation/sam-tool.service.d.ts +23 -30
- package/lib/toolbar/segmentation/segmentation-commit.d.ts +8 -0
- package/lib/toolbar/segmentation/segmentation-runner.d.ts +52 -0
- package/lib/toolbar/segmentation-tools/segmentation-tools.component.d.ts +87 -0
- package/lib/toolbar/stack-controls/stack-controls.component.d.ts +51 -0
- package/lib/toolbar/tool-kit/async-tool-status.d.ts +21 -0
- package/lib/toolbar/tool-kit/canvas-tool-manager.d.ts +36 -0
- package/lib/toolbar/tool-kit/canvas-tool.d.ts +86 -0
- package/lib/toolbar/tool-kit/frame-pixels.d.ts +45 -0
- package/lib/toolbar/tool-kit/mask-stroke-editor.d.ts +125 -0
- package/lib/toolbar/tool-kit/matrix-frame.d.ts +40 -0
- package/lib/toolbar/tool-kit/tool-overlay.d.ts +60 -0
- package/lib/toolbar/tool-kit/undo-gesture.d.ts +17 -0
- package/lib/toolbar/tool-slider/tool-slider.component.d.ts +33 -0
- package/lib/toolbar/toolbar-help-dialog/toolbar-help-dialog.component.d.ts +24 -0
- package/lib/toolbar/toolbar.component.d.ts +55 -84
- package/lib/toolbar/vertex-eraser/vertex-eraser-tool.service.d.ts +33 -40
- package/lib/toolbar/view-controls/view-controls.component.d.ts +54 -0
- package/lib/toolbar/wand/wand-region-grow.d.ts +49 -0
- package/lib/toolbar/wand/wand-tool.service.d.ts +39 -124
- package/lib/toolbar/wand/wand.service.d.ts +22 -116
- package/lib/toolbar/zoom-to-box/zoom-to-box-tool.service.d.ts +17 -37
- package/lib/util/mark-for-check.d.ts +11 -0
- package/lib/util/supersede.d.ts +53 -0
- package/lib/visualization.module.d.ts +18 -39
- package/lib/visualizer/floating-drag.directive.d.ts +30 -0
- package/lib/visualizer/region-actions.d.ts +54 -0
- package/lib/visualizer/region-load.d.ts +46 -0
- package/lib/visualizer/spatial-dataset-binder.d.ts +74 -0
- package/lib/visualizer/tool-modes.d.ts +49 -0
- package/lib/visualizer/viewer-shortcuts.d.ts +71 -0
- package/lib/visualizer/visualizer-context-menu.d.ts +55 -0
- package/lib/visualizer/volume-sections.d.ts +64 -0
- package/lib/visualizer.component.d.ts +232 -447
- package/lib/workers/spatial-math-ops.d.ts +65 -0
- package/lib/workers/spatial-math-worker.d.ts +7 -0
- package/lib/workers/spatial-math.d.ts +74 -0
- package/package.json +12 -3
- package/src/lib/assets/slice.svg +23 -0
- package/src/lib/styles/_viz-icons-rules.scss +73 -0
- package/src/lib/styles/viz-icons.scss +14 -0
- package/esm2022/lib/implementations/napari-js/napari-axes-labels.mjs +0 -97
- package/esm2022/lib/implementations/napari-js/napari-navigator.mjs +0 -195
- package/esm2022/lib/implementations/napari-js/napari-scale-bar.mjs +0 -92
- package/fesm2022/jax-data-science-sci-image-visualizer-onnx-sam-session-BwP-A11m.mjs +0 -329
- package/fesm2022/jax-data-science-sci-image-visualizer-onnx-sam-session-BwP-A11m.mjs.map +0 -1
- package/lib/implementations/napari-js/napari-axes-labels.d.ts +0 -49
- package/lib/implementations/napari-js/napari-navigator.d.ts +0 -72
- package/lib/implementations/napari-js/napari-scale-bar.d.ts +0 -35
- package/src/lib/assets/cell-detection.svg +0 -37
- package/src/lib/assets/click.svg +0 -1
- package/src/lib/assets/colormap-luts.json +0 -1
- package/src/lib/assets/edit-selection-white.svg +0 -47
- package/src/lib/assets/icons/colormap-earth.png +0 -0
- package/src/lib/assets/icons/colormap-placeholder.png +0 -0
- package/src/lib/assets/icons/colormap-pubu.png +0 -0
- package/src/lib/assets/interactive-segmentation-cursor.svg +0 -1
- package/src/lib/assets/picture-segmentation.svg +0 -43
- package/src/lib/assets/test/download-379.svg +0 -1
- package/src/lib/assets/test/download-98.svg +0 -1
- package/src/lib/assets/test/json-1.svg +0 -1
- package/src/lib/assets/test/load-53.svg +0 -1
- package/src/lib/assets/test/mask-44.svg +0 -1
- package/src/lib/assets/test/mask-download-44.svg +0 -15
- package/src/lib/assets/test/mask-save-44.svg +0 -11
- package/src/lib/assets/test/overlay-1.svg +0 -1
- package/src/lib/assets/test/overlay-4.svg +0 -1
- package/src/lib/assets/test/region-26.svg +0 -1
- package/src/lib/assets/test/save-56.svg +0 -1
- package/src/lib/assets/test/upload-43.svg +0 -1
|
@@ -7,99 +7,45 @@ import { IImageInfo } from '../../contracts/image.contract';
|
|
|
7
7
|
import { TileAccessPort } from '../../contracts/ports/tile-access.port';
|
|
8
8
|
import { VizConfig } from '../../contracts/viz-config';
|
|
9
9
|
import { PlotType, PlotTypeDescriptor } from '../../contracts/plot-type';
|
|
10
|
-
import {
|
|
10
|
+
import { IViewerBackend, PixelData, IIsosurfaceControls, IIntensityControls, ISurface3dControls, IOsdViewOptions, IIntensityViewportSource } from '../../contracts/visualizer.contract';
|
|
11
11
|
import { ViewerCapabilities } from '../../contracts/capabilities.contract';
|
|
12
12
|
import { IRegionOverlay } from '../../contracts/region-overlay.contract';
|
|
13
13
|
import { PlotModeViewport } from '../../contracts/plot-type-contribution.contract';
|
|
14
|
+
import { OsdLoaded } from './simple-source';
|
|
14
15
|
import { BaseStoreVisualizer } from '../base-store-visualizer';
|
|
16
|
+
import { CanvasToolId } from '../../contracts/display-types';
|
|
15
17
|
import { SimpleSliceAccessService } from '../simple-slice-access.service';
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
+
import { CanvasToolManager } from '../../toolbar/tool-kit/canvas-tool-manager';
|
|
19
|
+
import { WandService } from '../../toolbar/wand/wand.service';
|
|
18
20
|
import { SamToolService } from '../../toolbar/segmentation/sam-tool.service';
|
|
19
21
|
import { SamPointToolService } from '../../toolbar/segmentation/sam-point-tool.service';
|
|
20
22
|
import { CellSegmentToolService } from '../../toolbar/segmentation/cell-segment-tool.service';
|
|
21
23
|
import { ICellSegmenter } from '../../contracts/cell-segmenter.contract';
|
|
22
|
-
import { VertexEraserToolService } from '../../toolbar/vertex-eraser/vertex-eraser-tool.service';
|
|
23
|
-
import { ZoomToBoxToolService } from '../../toolbar/zoom-to-box/zoom-to-box-tool.service';
|
|
24
24
|
import { IHistogram } from '../../contracts/channel-histogram-api.contract';
|
|
25
25
|
import * as i0 from "@angular/core";
|
|
26
|
-
/** One pyramid level from `GET /tiles/info`. */
|
|
27
|
-
interface TileLevel {
|
|
28
|
-
res: number;
|
|
29
|
-
width: number;
|
|
30
|
-
height: number;
|
|
31
|
-
}
|
|
32
|
-
/** Tile-source descriptor returned by `GET /tiles/info`. */
|
|
33
|
-
interface TileDescriptor {
|
|
34
|
-
width: number;
|
|
35
|
-
height: number;
|
|
36
|
-
tileSize: number;
|
|
37
|
-
z: number;
|
|
38
|
-
channels: number;
|
|
39
|
-
/** True only for genuine multi-channel composites (indexed/LUT-bearing
|
|
40
|
-
* fluorescence stacks) the client should split into per-channel layers. The
|
|
41
|
-
* server sets it; an RGB photo read as separated planes has channels>1 but
|
|
42
|
-
* multichannel=false, so it stays a single composite tile source. */
|
|
43
|
-
multichannel?: boolean;
|
|
44
|
-
/** Real Bio-Formats resolution levels at the front of `levels`; the remaining
|
|
45
|
-
* levels are synthetic composited overviews (no per-channel tiles). */
|
|
46
|
-
realLevels?: number;
|
|
47
|
-
/** Per-channel metadata (name/color/bitDepth/min-maxAllowed) for native 16-bit
|
|
48
|
-
* windowing + histogram; null for plain 8-bit/RGB sources. */
|
|
49
|
-
channelInfo?: Array<{
|
|
50
|
-
name?: string;
|
|
51
|
-
color?: string;
|
|
52
|
-
bitDepth?: number;
|
|
53
|
-
minAllowed?: number;
|
|
54
|
-
maxAllowed?: number;
|
|
55
|
-
}> | null;
|
|
56
|
-
levels: TileLevel[];
|
|
57
|
-
/** Physical pixel size in µm (0 when the format doesn't report it). */
|
|
58
|
-
mppX?: number;
|
|
59
|
-
mppY?: number;
|
|
60
|
-
}
|
|
61
|
-
/** What `load()` hands to `plot()`. */
|
|
62
|
-
interface OsdLoaded {
|
|
63
|
-
descriptor: TileDescriptor | null;
|
|
64
|
-
infoB64: string;
|
|
65
|
-
z: number;
|
|
66
|
-
/** Mirrors the loaded image's filename — the diagram's render pipeline
|
|
67
|
-
* guards on `loaded.filename === phaseInfo.fileName` before calling plot(). */
|
|
68
|
-
filename: string | undefined;
|
|
69
|
-
/** Simple (non-tiled) image: `plot()` opens {@link url} directly via OSD's
|
|
70
|
-
* single-image source — no tile pyramid, no server. Set when the image
|
|
71
|
-
* carries `tiled === false` (see {@link IImageInfo.tiled}). */
|
|
72
|
-
simple?: boolean;
|
|
73
|
-
/** The directly-loadable image URL (`blob:`/`data:`/`http`) for simple mode. */
|
|
74
|
-
url?: string;
|
|
75
|
-
}
|
|
76
26
|
/**
|
|
77
27
|
* OpenSeadragon visualization backend.
|
|
78
28
|
*
|
|
79
29
|
* Renders the *image* plot type as a natively-tiled, zoomable raster, backed by
|
|
80
30
|
* the jit-service tile endpoints (`GET /tiles/info` + `GET /tile`, which reuse
|
|
81
|
-
* the Bio-Formats ROI renderer)
|
|
31
|
+
* the Bio-Formats ROI renderer), or — for a `tiled: false` image — by
|
|
32
|
+
* self-contained per-slice URLs. Plotly keeps the scientific/data plot types
|
|
82
33
|
* (scalar heatmap, surface, contour, scatter, line, scatter3d, isosurface) —
|
|
83
34
|
* hence this backend advertises only `ImageDisplay`.
|
|
84
35
|
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
* implementation against real endpoints.
|
|
36
|
+
* Display settings (window/gamma/colormap/invert, per-channel tints) are applied
|
|
37
|
+
* client-side by recoloring tiles; regions are drawn by {@link OsdRegionOverlay}
|
|
38
|
+
* and the canvas tools read back the rendered viewport. The collaborators
|
|
39
|
+
* (slice cache, display pipeline, histogram sampler, tile client) and the
|
|
40
|
+
* recolor invariant are described in this folder's README.
|
|
91
41
|
*/
|
|
92
|
-
export declare class OpenSeadragonVisualizerService extends BaseStoreVisualizer implements
|
|
42
|
+
export declare class OpenSeadragonVisualizerService extends BaseStoreVisualizer implements IViewerBackend {
|
|
93
43
|
private http;
|
|
94
44
|
private tiles;
|
|
95
|
-
private wandTool;
|
|
96
|
-
private brushTool;
|
|
97
45
|
private samTool;
|
|
98
46
|
private samPointTool;
|
|
99
47
|
private cellSegmentTool;
|
|
100
48
|
private cellSegmenter;
|
|
101
|
-
private eraserTool;
|
|
102
|
-
private zoomToBoxTool;
|
|
103
49
|
private simpleStack;
|
|
104
50
|
/** OSD's strength is displaying a large zoomable image — nothing else here. */
|
|
105
51
|
readonly capabilities: ViewerCapabilities;
|
|
@@ -112,33 +58,11 @@ export declare class OpenSeadragonVisualizerService extends BaseStoreVisualizer
|
|
|
112
58
|
* tile source and swap slices live (stack navigation). */
|
|
113
59
|
private infoB64;
|
|
114
60
|
private currentZ;
|
|
115
|
-
/** True while the current image is "simple" (tiled:false — self-contained
|
|
116
|
-
* per-slice URLs, no tile server; e.g. a numbered image series assembled
|
|
117
|
-
* client-side into a stack). setZIndex swaps the single-image source for
|
|
118
|
-
* the new slice's URL instead of updating a tiled z-param. */
|
|
119
|
-
private simpleMode;
|
|
120
|
-
/** urls[] for the current simple-mode image, so setZIndex can look up the
|
|
121
|
-
* slice being scrubbed to (via {@link SimpleSliceAccessService.urlFor}).
|
|
122
|
-
* Unused (and left stale, harmlessly) in tiled mode. */
|
|
123
|
-
private simpleUrls;
|
|
124
|
-
/** preview blob URL → full-res upscaled blob URL (see toFullResUrl), so
|
|
125
|
-
* re-visiting a simple-mode slice doesn't re-upscale. Revoked on file change. */
|
|
126
|
-
private readonly simpleFullResUrls;
|
|
127
|
-
/** SERVERLESS multichannel (tiled:false + channelCount>1): the stack's
|
|
128
|
-
* per-slice per-channel plane URLs, the current slice's decoded planes, and
|
|
129
|
-
* the last composite blob URL. Composited client-side via display.channelRgbLut
|
|
130
|
-
* (no tile server); kept OFF the tiled isMultiChannel path. */
|
|
131
|
-
private simpleMultichannel;
|
|
132
|
-
private simpleChannelUrls;
|
|
133
|
-
private simpleChannelPlanes;
|
|
134
|
-
private simpleCompositeUrl;
|
|
135
|
-
/** Skip the full-res upscale above this longest-side dimension — a folder
|
|
136
|
-
* stack is per-file previews (well under this); this only guards against an
|
|
137
|
-
* accidental enormous canvas allocation. */
|
|
138
|
-
private readonly SIMPLE_UPSCALE_MAX_DIM;
|
|
139
61
|
private coordTransform;
|
|
140
|
-
|
|
141
|
-
private
|
|
62
|
+
/** What this backend's canvas tools read and write (one host for every tool). */
|
|
63
|
+
private readonly toolHost;
|
|
64
|
+
/** This backend's own wand, brush, eraser, zoom-to-box and SAM point tools. */
|
|
65
|
+
protected readonly canvasTools: CanvasToolManager;
|
|
142
66
|
/** Wand sampling matrix read back from the rendered viewport; cached until
|
|
143
67
|
* the viewport changes (see readbackViewport). */
|
|
144
68
|
private viewportPixels;
|
|
@@ -147,183 +71,62 @@ export declare class OpenSeadragonVisualizerService extends BaseStoreVisualizer
|
|
|
147
71
|
private plotDiv;
|
|
148
72
|
/** Current file name, tagged onto wand-created shapes. */
|
|
149
73
|
private currentFileName;
|
|
150
|
-
/** 256-entry RGB LUT for the active colormap, applied to grayscale tiles via
|
|
151
|
-
* the tile-invalidated pixel pipeline (mirrors Plotly's heatmap colorscale).
|
|
152
|
-
* Null while options resolve; recoloring is skipped until it's built. */
|
|
153
|
-
private colorLut;
|
|
154
74
|
/** Only grayscale images get a colormap (RGB tiles pass through untouched). */
|
|
155
75
|
private isGrayscaleImage;
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
* each `await`, abandons the tile once a newer round has started. Writing a
|
|
159
|
-
* superseded context back is not merely wasted work: OSD's conversion sees a
|
|
160
|
-
* canvas the newer round already replaced, throws `DOMException`, and
|
|
161
|
-
* `_handleConversionError` DESTROYS the cache record and unloads the tile
|
|
162
|
-
* (unlike the drawer's rasterBlob path, it does not re-prepare). Enough of
|
|
163
|
-
* those and the viewer goes white mid-drag. */
|
|
164
|
-
private displayToken;
|
|
165
|
-
/** Pending coalesced invalidation (see {@link scheduleInvalidate}). */
|
|
166
|
-
private invalidateHandle;
|
|
167
|
-
/** Latest per-channel display state (window/gamma/visibility) from the store,
|
|
168
|
-
* read synchronously by recolorTile. Channel 0 drives grayscale windowing;
|
|
169
|
-
* R/G/B (indices 0-2) drive RGB per-channel windowing. */
|
|
170
|
-
private channelStates;
|
|
171
|
-
/** True for multichannel fluorescence (channelCount > 1, not RGB): tiles are
|
|
172
|
-
* composited client-side from per-channel single-band fetches (see
|
|
173
|
-
* recolorMultiChannelTile) rather than recolored in place. */
|
|
76
|
+
/** True for multichannel fluorescence drawn per channel: one single-band
|
|
77
|
+
* TiledImage per channel, tinted by the recolorer (see planTiledMount). */
|
|
174
78
|
private isMultiChannel;
|
|
175
79
|
/** Count of real Bio-Formats resolution levels (per-channel tiles exist only
|
|
176
80
|
* here). For multichannel images the tile source is built from these alone so
|
|
177
81
|
* every displayed tile supports a per-channel fetch. */
|
|
178
82
|
private realLevels;
|
|
179
|
-
/** Inverted background (white = zero): inverts the display value before the
|
|
180
|
-
* LUT (grayscale) / per channel (RGB). */
|
|
181
|
-
private invertBg;
|
|
182
83
|
/** Bearer token for OSD's own tile fetches (HttpClient calls get it via the
|
|
183
84
|
* interceptor; OSD's loader does not, so we pass it as an ajax header). */
|
|
184
85
|
private authHeaders;
|
|
185
|
-
/**
|
|
186
|
-
*
|
|
187
|
-
|
|
188
|
-
private navigatorVisible;
|
|
189
|
-
/** Image smoothing (bilinear). `false` → nearest-neighbour, so zoomed-in pixels
|
|
190
|
-
* render as crisp blocks (pixel inspection). Defaults to `false` so the image
|
|
191
|
-
* opens showing raw pixels. Read at viewer creation; toggled via
|
|
192
|
-
* {@link setImageSmoothingEnabled}. */
|
|
193
|
-
private smoothingEnabled;
|
|
86
|
+
/** Navigator, smoothing, initial fit and the toolbar repaint workaround
|
|
87
|
+
* (see OsdNavigatorChrome). */
|
|
88
|
+
private readonly chrome;
|
|
194
89
|
/** Overall deadline for the /tiles/info poll loop. An uncached whole-slide
|
|
195
90
|
* image (e.g. .ndpi) is cached server-side first (GCS->PVC), which can take
|
|
196
|
-
* several minutes
|
|
197
|
-
*
|
|
198
|
-
* expiry the render pipeline gives up and the router falls back to Plotly. */
|
|
91
|
+
* several minutes. Generous because each poll is cheap; on expiry the router
|
|
92
|
+
* falls back to Plotly. (napari-js waits less — it falls back to a single tile.) */
|
|
199
93
|
private readonly tilesInfoTimeoutMs;
|
|
200
|
-
/**
|
|
201
|
-
*
|
|
202
|
-
*
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
* shared by tile recoloring and the composite export so they stay identical
|
|
208
|
-
* (see DisplayPipeline). Host closures read the service's live fields. */
|
|
209
|
-
private readonly display;
|
|
94
|
+
/** Window/gamma/colormap/invert and per-channel tints, applied to the tiles
|
|
95
|
+
* through OSD's pixel pipeline (see OsdTileRecolorer and the README's recolor
|
|
96
|
+
* invariant). Its DisplayPipeline also drives the compositor and the export. */
|
|
97
|
+
private readonly recolor;
|
|
98
|
+
/** The serverless (`tiled: false`) image source and all its state (see
|
|
99
|
+
* OsdSimpleSource). */
|
|
100
|
+
private readonly simple;
|
|
210
101
|
/** Histogram + auto-window sampling (see HistogramSampler). Constructed in
|
|
211
102
|
* the ctor body because it captures the resolved API base URL. */
|
|
212
103
|
private sampler;
|
|
213
|
-
/** Stack-slice cache + background preloader (see SliceCache
|
|
214
|
-
* plan Step 3). The host accessors are live closures, so the cache always
|
|
215
|
-
* reads the service's current viewer/descriptor/z — exactly the fields the
|
|
216
|
-
* moved code used to read directly. */
|
|
104
|
+
/** Stack-slice cache + background preloader (see SliceCache). */
|
|
217
105
|
private readonly cache;
|
|
218
|
-
constructor(http: HttpClient, tiles: TileAccessPort,
|
|
106
|
+
constructor(http: HttpClient, tiles: TileAccessPort, wandService: WandService, samTool: SamToolService, samPointTool: SamPointToolService, cellSegmentTool: CellSegmentToolService, cellSegmenter: ICellSegmenter | null, store: VisualizerStore, regionStore: RegionStore, simpleStack: SimpleSliceAccessService, config: VizConfig);
|
|
219
107
|
private readonly stackLoading$;
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
* settles, so the intensity inset can re-sample at the current zoom level. */
|
|
224
|
-
private readonly viewportChange$;
|
|
225
|
-
/** The visible rect on every redraw, coalesced to one emission per animation
|
|
226
|
-
* frame. Feeds {@link PlotModeViewport.frame$}. */
|
|
227
|
-
private readonly frame$;
|
|
228
|
-
private frameRaf;
|
|
229
|
-
private plotModeViewport;
|
|
230
|
-
private readonly intensityProfile$;
|
|
231
|
-
/**
|
|
232
|
-
* Subscribe to the shared VisualizerStore colormap/reverse so OSD recolors in
|
|
233
|
-
* lock-step with Plotly. Idempotent and self-healing: this service is a root
|
|
234
|
-
* singleton, but `unsubscribe()` (called on VisualizerComponent destroy)
|
|
235
|
-
* tears the subscription down — and the constructor never runs again. So
|
|
236
|
-
* `plot()` calls this to re-establish it after a component teardown/recreate
|
|
237
|
-
* (e.g. switching images), otherwise colormap changes would be silently
|
|
238
|
-
* dropped on every image after the first switch.
|
|
239
|
-
*/
|
|
240
|
-
private ensureColormapSubscription;
|
|
241
|
-
/** Seed the Intensity channel with a measured auto-window while it's still
|
|
242
|
-
* at full range (never clobber the user's manual window); if the user
|
|
243
|
-
* already windowed, just re-invalidate so painted tiles pick the LUT up. */
|
|
244
|
-
private seedGrayWindow;
|
|
108
|
+
/** The viewport as the library sees it: visible rects, the plot-mode
|
|
109
|
+
* viewport, zoom/fit (see OsdViewportAdapter). */
|
|
110
|
+
private readonly viewport;
|
|
245
111
|
/**
|
|
246
112
|
* Fetch the tile-source descriptor for the selected file. The `info` param is
|
|
247
113
|
* the base64 RawFileInfo the rest of the API uses; the GET goes through the
|
|
248
114
|
* auth interceptor (Bearer). We also grab a token here for OSD's own tile
|
|
249
115
|
* fetches (its loader bypasses HttpClient).
|
|
116
|
+
*
|
|
117
|
+
* `signal` (the host's render supersession) cancels the `/tiles/info` poll and
|
|
118
|
+
* the simple-image fetches: the load then rejects with an `AbortError`.
|
|
250
119
|
*/
|
|
251
|
-
load(imageInfo: IImageInfo, zIndex: number): Promise<OsdLoaded>;
|
|
252
|
-
/** Build the `plot()` payload for a simple (tiled:false) image: a single-level
|
|
253
|
-
* descriptor sized from `trueImageSize`, plus the directly-loadable URL —
|
|
254
|
-
* resolved and fetched via {@link SimpleSliceAccessService} (shared with
|
|
255
|
-
* napari-js; see its docs for why this can't be a raw `fetch()`/`<img>`). */
|
|
256
|
-
private loadSimple;
|
|
257
|
-
/**
|
|
258
|
-
* OSD's `{type:'image'}` source sizes its coordinate world to the image's
|
|
259
|
-
* NATURAL pixels. A folder-stack slice is a server `/preview` whose pixel size
|
|
260
|
-
* needn't match the full-resolution image — it may be downscaled (large
|
|
261
|
-
* images) OR larger than the dimensions `/metadata` reports. Either way OSD's
|
|
262
|
-
* world would differ from the full-res ROI coordinate space (QuPath geojson,
|
|
263
|
-
* in level-0 pixels): a smaller preview renders ROIs oversized, a larger one
|
|
264
|
-
* renders them undersized/offset. Resample the preview to EXACTLY the
|
|
265
|
-
* full-resolution dimensions (blurry but positionally exact — scaling up or
|
|
266
|
-
* down as needed) so OSD's world matches the ROI coordinate space, while still
|
|
267
|
-
* using OSD's reliable single-image renderer. Cached per preview URL (revoked
|
|
268
|
-
* on file change); a no-op when the preview is already exactly full-res (small
|
|
269
|
-
* images, in-memory pipeline blobs), when the dims are unknown, or when
|
|
270
|
-
* they're implausibly large (guards against an enormous canvas). (jit-ui#93)
|
|
271
|
-
*/
|
|
272
|
-
private toFullResUrl;
|
|
273
|
-
/** Sample a SIMPLE-mode slice's own decoded pixels into the histogram — the
|
|
274
|
-
* serverless analog of the tiled samplers (no tile server). Fire-and-forget;
|
|
275
|
-
* a decode failure just leaves the pane empty rather than throwing. */
|
|
276
|
-
private sampleSimpleHistogram;
|
|
277
|
-
/** Fetch + decode a slice's per-channel planes (single-band grayscale) into
|
|
278
|
-
* pixel buffers, for the SERVERLESS multichannel compositor. Auth-safe: goes
|
|
279
|
-
* through SimpleSliceAccessService (blob:/data: as-is; http via HttpClient). */
|
|
280
|
-
private loadSimpleChannelPlanes;
|
|
281
|
-
/** Composite the cached per-channel planes into ONE RGBA image using the
|
|
282
|
-
* current channel states (colour/window/gamma/visibility) — the client-side,
|
|
283
|
-
* serverless analog of the tiled per-channel 'lighter' compositor
|
|
284
|
-
* (same display.channelRgbLut math as recolorChannelTile, applied per-plane).
|
|
285
|
-
* Returns a blob: URL of the composite PNG, revoking the previous one. */
|
|
286
|
-
private compositeSimpleMultichannel;
|
|
287
|
-
/** Re-composite the current slice from its cached planes (new channel states)
|
|
288
|
-
* and re-open — the serverless analog of the tiled invalidate-on-channel-change. */
|
|
289
|
-
private recompositeAndOpen;
|
|
290
|
-
/** Load a URL into an HTMLImageElement (resolves once decoded). Uses
|
|
291
|
-
* document.createElement rather than `new Image()` because this file's
|
|
292
|
-
* `Image` import is image-js's decoder, not the DOM element. */
|
|
293
|
-
private loadImageEl;
|
|
294
|
-
private revokeSimpleFullResUrls;
|
|
120
|
+
load(imageInfo: IImageInfo, zIndex: number, signal?: AbortSignal): Promise<OsdLoaded>;
|
|
295
121
|
/** Mount the viewer with a custom tile source pointing at `GET /tile`. */
|
|
296
122
|
plot(plotDiv: string, imageLoaded: any, imageInfo: IImageInfo, _screenHeight: number, _plotType: PlotType, inPlace?: boolean): Promise<boolean>;
|
|
297
|
-
/**
|
|
298
|
-
*
|
|
299
|
-
*
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
*
|
|
303
|
-
* ResizeObserver (the timed refits remain the fallback). One-shot + only
|
|
304
|
-
* attached on a fresh mount, so slice-scrub re-opens keep the user's zoom.
|
|
305
|
-
*/
|
|
306
|
-
private fitWhenContainerSized;
|
|
307
|
-
/**
|
|
308
|
-
* Custom tile source built from the descriptor. OSD numbers levels
|
|
309
|
-
* coarsest-first; the backend numbers resolutions full-res-first, so
|
|
310
|
-
* `res = (levels-1) - osdLevel`. Overriding getLevelScale/getNumTiles lets us
|
|
311
|
-
* honour Bio-Formats' actual per-level dimensions (not assume power-of-two).
|
|
312
|
-
*/
|
|
123
|
+
/** Wire a freshly opened viewer: the region overlay, coordinate transform and
|
|
124
|
+
* scale bar, the slice cache, the recolor pipeline, the viewport streams and
|
|
125
|
+
* the chrome. */
|
|
126
|
+
private onViewerOpened;
|
|
127
|
+
/** The `GET /tile` source for slice `z` (one channel's, when given) — see
|
|
128
|
+
* {@link buildOsdTileSource}. Multichannel draws off the real levels only. */
|
|
313
129
|
private buildTileSource;
|
|
314
|
-
/** Re-apply the display pipeline (window/gamma/colour/invert) after a state change.
|
|
315
|
-
* Multichannel invalidates ONLY the visible slice's channel images — invalidating
|
|
316
|
-
* the whole world would re-process every hidden/preloaded slice's tiles (hundreds),
|
|
317
|
-
* flooding OSD with "[CacheRecord] … InvalidStateError" and wasting work on tiles
|
|
318
|
-
* that aren't on screen. The other cached slices are marked stale and re-tinted
|
|
319
|
-
* lazily when revealed. Composite/grayscale invalidate the world as before. */
|
|
320
|
-
/** Collapse a burst of display-state changes into ONE invalidation on the next
|
|
321
|
-
* frame. Dragging a window slider emits per pixel of travel, and each round
|
|
322
|
-
* restores and re-processes every tile of every channel — so the burst is both
|
|
323
|
-
* wasted work and the race that breaks cache records (see {@link displayToken}).
|
|
324
|
-
* The store write stays live, so the pane itself remains responsive. */
|
|
325
|
-
private scheduleInvalidate;
|
|
326
|
-
private invalidateDisplay;
|
|
327
130
|
private destroyViewer;
|
|
328
131
|
/** This backend's region renderer (the SVG overlay), once a plot is mounted. */
|
|
329
132
|
getRegionOverlay(): IRegionOverlay | null;
|
|
@@ -343,12 +146,9 @@ export declare class OpenSeadragonVisualizerService extends BaseStoreVisualizer
|
|
|
343
146
|
zoomOut(): void;
|
|
344
147
|
setDragMode(mode: string | false): void;
|
|
345
148
|
setShowStack(_showstack: boolean): void;
|
|
346
|
-
/** Show/hide the overview navigator
|
|
347
|
-
* applied live when a viewer is already mounted (hides/reveals its element —
|
|
348
|
-
* the navigator instance itself only exists when created with showNavigator). */
|
|
149
|
+
/** Show/hide the overview navigator (now, and for the next viewer). */
|
|
349
150
|
setNavigatorVisible(visible: boolean): void;
|
|
350
|
-
/** Toggle bilinear smoothing vs nearest-neighbour (
|
|
351
|
-
* next viewer creation, and applied live (with a redraw) to a mounted viewer. */
|
|
151
|
+
/** Toggle bilinear smoothing vs nearest-neighbour (now, and for the next viewer). */
|
|
352
152
|
setImageSmoothingEnabled(enabled: boolean): void;
|
|
353
153
|
/**
|
|
354
154
|
* Swap the displayed z-slice live. Slices are kept as separate tiled images in
|
|
@@ -380,126 +180,56 @@ export declare class OpenSeadragonVisualizerService extends BaseStoreVisualizer
|
|
|
380
180
|
* are drawn.
|
|
381
181
|
*/
|
|
382
182
|
getDisplayedPixelData(): PixelData | null;
|
|
383
|
-
/**
|
|
384
|
-
*
|
|
385
|
-
* reads) currently covers. Unlike {@link emitViewportChange}, this is NOT
|
|
386
|
-
* clamped to the image bounds: the canvas maps 1:1 to the viewport rectangle,
|
|
387
|
-
* so leaving it unclamped keeps `canvasPx -> imagePx` an exact affine map
|
|
388
|
-
* (clamping would skew coordinates near the image edges). Routed through world
|
|
389
|
-
* item 0 (see {@link viewportRectToImage}) for multi-layer accuracy.
|
|
390
|
-
*/
|
|
183
|
+
/** Image-pixel rectangle the drawer canvas (what {@link getDisplayedPixelData}
|
|
184
|
+
* reads) currently covers — unclamped, see OsdViewportAdapter.displayedSourceRect. */
|
|
391
185
|
getDisplayedSourceRect(): {
|
|
392
186
|
x: number;
|
|
393
187
|
y: number;
|
|
394
188
|
width: number;
|
|
395
189
|
height: number;
|
|
396
190
|
} | null;
|
|
191
|
+
/** Snapshot the currently rendered view as a PNG (WYSIWYG) — the parallel to
|
|
192
|
+
* Plotly's downloadImage. The drawer canvas already carries the display
|
|
193
|
+
* settings (the recolor pipeline bakes them into the tiles); the full-resolution
|
|
194
|
+
* stitched export is exportComposite(). */
|
|
397
195
|
downloadImage(): void;
|
|
398
196
|
setPlotType(_plotType: PlotType): void;
|
|
399
197
|
setSurfaceDragMode(_mode: string): void;
|
|
400
198
|
resetSurfaceCamera(): void;
|
|
199
|
+
/** The router reads the autoscale event from Plotly only. */
|
|
401
200
|
getAutoscaleEvent(): Observable<any>;
|
|
402
201
|
/** Visible image region (full-image pixel coords), emitted when the view
|
|
403
202
|
* settles. The intensity inset re-samples this region at the zoom resolution. */
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
*
|
|
413
|
-
ensureIntensitySampling(_imageInfo: IImageInfo, _zIndex: number): Promise<void>;
|
|
414
|
-
/** {@link IIntensitySampling} stub — see {@link ensureIntensitySampling}. */
|
|
415
|
-
refreshIntensitySamplingForRoi(_x: number, _y: number, _width: number, _height: number, _zIndex: number): void;
|
|
416
|
-
/** Compute the current viewport's image-pixel rectangle (clamped to the image)
|
|
417
|
-
* and broadcast it. */
|
|
418
|
-
private emitViewportChange;
|
|
419
|
-
/** The current viewport's image-pixel rectangle, clamped to the image, or
|
|
420
|
-
* null when there is no laid-out viewport. */
|
|
421
|
-
private visibleImageRect;
|
|
422
|
-
/** Coalesce redraws into one {@link frame$} emission per animation frame.
|
|
423
|
-
* Skipped entirely while nothing listens. */
|
|
424
|
-
private scheduleFrame;
|
|
425
|
-
/**
|
|
426
|
-
* The viewport a contributed plot mode draws over. One stable object per
|
|
427
|
-
* service: every method reads the CURRENT viewer, so it stays valid across a
|
|
428
|
-
* viewer rebuild and reports `isReady() === false` while none is mounted
|
|
429
|
-
* (conversions then return NaN rather than throwing).
|
|
430
|
-
*/
|
|
203
|
+
getIntensitySampling(): IIntensityViewportSource;
|
|
204
|
+
private readonly viewportSource;
|
|
205
|
+
/** The navigator and image smoothing (see {@link setNavigatorVisible}). */
|
|
206
|
+
getOsdViewOptions(): IOsdViewOptions;
|
|
207
|
+
private readonly viewOptions;
|
|
208
|
+
/** OSD renders no volumes. */
|
|
209
|
+
getVolumeResolution(): null;
|
|
210
|
+
/** The viewport a contributed plot mode draws over: one stable object that
|
|
211
|
+
* always reads the current viewer (see OsdViewportAdapter.plotModeViewportFor). */
|
|
431
212
|
getPlotModeViewport(): PlotModeViewport;
|
|
432
|
-
/** `source`, preceded by the current visible rect for each subscriber (when ready). */
|
|
433
|
-
private withCurrentRect;
|
|
434
213
|
/** OSD targets the image display; the scalar/3D plot types belong to Plotly. */
|
|
435
214
|
getPlotTypeDescriptors(): PlotTypeDescriptor[];
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
setZoomToBoxMode(active: boolean): void;
|
|
447
|
-
/** Box-prompted SAM: segment the drawn rectangles. The SAM tool reuses the
|
|
448
|
-
* wand host (viewport readback + coordinate transform + region store). */
|
|
215
|
+
/**
|
|
216
|
+
* Mouse-nav is off while a canvas tool holds the pointer (its drag must draw,
|
|
217
|
+
* not pan) and on otherwise — also when a region draw mode is armed on the
|
|
218
|
+
* overlay, as the old per-tool fan-out left it (its setZoomToBoxMode(false)
|
|
219
|
+
* re-enabled nav after the overlay's setMode). A pixel tool samples the
|
|
220
|
+
* rendered viewport, read back lazily on first use.
|
|
221
|
+
*/
|
|
222
|
+
protected beforeToolChange(next: CanvasToolId | null): boolean;
|
|
223
|
+
/** Box-prompted SAM: segment the drawn rectangles against our tool host
|
|
224
|
+
* (viewport readback + coordinate transform + region store). */
|
|
449
225
|
segmentRectangles(): Promise<number>;
|
|
450
226
|
segmentRectanglesCellpose(): Promise<number>;
|
|
451
227
|
setSamModel(id: string): void;
|
|
452
|
-
setSamPointMode(active: boolean): void;
|
|
453
|
-
commitSamPoints(): void;
|
|
454
|
-
clearSamPoints(): void;
|
|
455
|
-
/** Build the wand/eraser host objects bound to this backend. Both tools run
|
|
456
|
-
* over OSD via the shared coordinate transform + a viewport pixel readback,
|
|
457
|
-
* and read/write regions directly on the shared RegionStore (neutral model). */
|
|
458
|
-
private buildToolHosts;
|
|
459
228
|
/** The element the on-canvas tool overlays attach to (OSD is mounted here). */
|
|
460
229
|
private getOverlayContainer;
|
|
461
|
-
/**
|
|
462
|
-
*
|
|
463
|
-
* once in the Viewer constructor — before the host flex layout settles —
|
|
464
|
-
* and never corrects it, leaving a stale-size element whose visible minimap
|
|
465
|
-
* floats above the bottom-right corner. */
|
|
466
|
-
private resizeNavigator;
|
|
467
|
-
/** Force the docked toolbar to repaint after an OSD zoom. Chrome leaves it
|
|
468
|
-
* laid-out-but-unpainted (the canvas's compositing churn strands the toolbar's
|
|
469
|
-
* raster). A synchronous display toggle re-rasters it with no visible gone-frame
|
|
470
|
-
* and no layout shift. Located via the DOM since this service doesn't own the
|
|
471
|
-
* toolbar; a no-op when there's no toolbar (e.g. embedded without one). */
|
|
472
|
-
private nudgeToolbarRepaint;
|
|
473
|
-
/** Host for the (shared) zoom-to-box tool: convert overlay pixels to image
|
|
474
|
-
* coords via the viewport, and fit the viewport to the chosen rectangle. */
|
|
475
|
-
private zoomBoxHost;
|
|
476
|
-
/** Fit the OSD viewport to an image-space rectangle (coords ordered
|
|
477
|
-
* [xMin, xMax, yMax, yMin]). */
|
|
478
|
-
private applyZoomToBox;
|
|
479
|
-
/**
|
|
480
|
-
* Read back the *currently rendered* OSD canvas as the wand's pixel matrix.
|
|
481
|
-
* The matrix covers only the visible viewport at screen resolution, so when
|
|
482
|
-
* the user is zoomed into a sub-region the wand samples that region's detail
|
|
483
|
-
* (rather than the whole image at preview resolution). `originX/originY` and
|
|
484
|
-
* `ratios` map image coords <-> readback-pixel coords for the wand's
|
|
485
|
-
* data/ratio/origin model. Cached until the viewport changes.
|
|
486
|
-
*/
|
|
230
|
+
/** The pixel tools' frame: the rendered viewport, read back once and cached
|
|
231
|
+
* until the viewport changes (see readbackViewportFrame). */
|
|
487
232
|
private readbackViewport;
|
|
488
|
-
/**
|
|
489
|
-
* Recolor a grayscale tile through the active colormap LUT, using OSD's
|
|
490
|
-
* tile-invalidated pixel pipeline (OSD 5+/6). Maps each pixel's grayscale
|
|
491
|
-
* value (r==g==b) to the LUT's RGB. No-op for RGB images or until the LUT is
|
|
492
|
-
* built. Handler is async — OSD awaits it (raiseEventAwaiting).
|
|
493
|
-
*/
|
|
494
|
-
private recolorTile;
|
|
495
|
-
/**
|
|
496
|
-
* Tint a single channel's tile in place. Each channel is its own OpenSeadragon
|
|
497
|
-
* TiledImage (a single-band grayscale tile); OSD composites the N images
|
|
498
|
-
* additively ('lighter') in its drawer — so this just maps the tile's intensity
|
|
499
|
-
* through the channel's window/gamma and its pseudo-colour. Synchronous (no
|
|
500
|
-
* cross-tile fetch) → no race, no seams. Channel is parsed from the tile URL.
|
|
501
|
-
*/
|
|
502
|
-
private recolorChannelTile;
|
|
503
233
|
/** Per-channel histogram for the Channels & Histogram pane, from the current
|
|
504
234
|
* slice's sampled tiles (grayscale → channel 0; RGB → R/G/B). Null until the
|
|
505
235
|
* async sampling resolves or if it was skipped. */
|
|
@@ -523,16 +253,10 @@ export declare class OpenSeadragonVisualizerService extends BaseStoreVisualizer
|
|
|
523
253
|
exportData(): Promise<void>;
|
|
524
254
|
/**
|
|
525
255
|
* Export the current slice as a publication-ready PNG composited with the
|
|
526
|
-
* active display settings
|
|
527
|
-
* colours / invert). Picks the largest pyramid level under a pixel cap (the
|
|
528
|
-
* coarser overview for huge whole-slides), fetches that level's tile grid,
|
|
529
|
-
* stitches it into one canvas, runs the shared display pipeline, and saves it.
|
|
256
|
+
* active display settings, the way it is drawn (see renderCompositePng).
|
|
530
257
|
*/
|
|
531
258
|
exportComposite(): Promise<void>;
|
|
532
|
-
/** True if any pixel in the RGBA buffer is non-transparent. */
|
|
533
|
-
private hasOpaque;
|
|
534
259
|
unsubscribe(): void;
|
|
535
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<OpenSeadragonVisualizerService, [null, null, null, null, null, null,
|
|
260
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<OpenSeadragonVisualizerService, [null, null, null, null, null, null, { optional: true; }, null, null, null, null]>;
|
|
536
261
|
static ɵprov: i0.ɵɵInjectableDeclaration<OpenSeadragonVisualizerService>;
|
|
537
262
|
}
|
|
538
|
-
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ICoordinateTransform } from '../../contracts/coordinate-transform.contract';
|
|
2
|
+
import { OsdViewerLike } from './osd-viewer-like';
|
|
2
3
|
/**
|
|
3
4
|
* OpenSeadragon implementation of {@link ICoordinateTransform}. "Data coords"
|
|
4
5
|
* here are image-pixel coordinates (OSD's native shape space), obtained from the
|
|
@@ -7,7 +8,7 @@ import { ICoordinateTransform } from '../../contracts/coordinate-transform.contr
|
|
|
7
8
|
*/
|
|
8
9
|
export declare class OsdCoordinateTransform implements ICoordinateTransform {
|
|
9
10
|
private viewer;
|
|
10
|
-
constructor(viewer:
|
|
11
|
+
constructor(viewer: OsdViewerLike);
|
|
11
12
|
isReady(): boolean;
|
|
12
13
|
clientToData(clientX: number, clientY: number): {
|
|
13
14
|
x: number;
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
+
import type * as OpenSeadragon from 'openseadragon';
|
|
2
|
+
import { OsdRectLike, OsdViewerLike } from './osd-viewer-like';
|
|
1
3
|
/** Viewer-element pixel -> image (data) coordinates. */
|
|
2
|
-
export declare function elementToImage(viewer:
|
|
4
|
+
export declare function elementToImage(viewer: OsdViewerLike, x: number, y: number): {
|
|
3
5
|
x: number;
|
|
4
6
|
y: number;
|
|
5
7
|
};
|
|
6
8
|
/** Image (data) coordinates -> viewer-element pixel point. */
|
|
7
|
-
export declare function imageToElement(viewer:
|
|
9
|
+
export declare function imageToElement(viewer: OsdViewerLike, x: number, y: number): {
|
|
8
10
|
x: number;
|
|
9
11
|
y: number;
|
|
10
12
|
};
|
|
11
13
|
/** Image-space rectangle -> viewport rectangle (for fitBounds). */
|
|
12
|
-
export declare function imageRectToViewport(viewer:
|
|
14
|
+
export declare function imageRectToViewport(viewer: OsdViewerLike, x: number, y: number, w: number, h: number): OpenSeadragon.Rect;
|
|
13
15
|
/** Viewport rectangle -> image (data) rectangle. Routes through world item 0 so
|
|
14
16
|
* it stays accurate when the world holds multiple images (stack slices /
|
|
15
17
|
* per-channel layers); falls back to the viewport when the world is empty. */
|
|
16
|
-
export declare function viewportRectToImage(viewer:
|
|
18
|
+
export declare function viewportRectToImage(viewer: OsdViewerLike, vpRect: OsdRectLike): OsdRectLike;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import { DisplayPipeline } from './display-pipeline';
|
|
3
|
+
import { TileDescriptor } from '../tile-server';
|
|
4
|
+
import { IChannelState } from '../../contracts/channel-histogram-api.contract';
|
|
5
|
+
/** What {@link renderCompositePng} draws. */
|
|
6
|
+
export interface CompositeExportInput {
|
|
7
|
+
http: HttpClient;
|
|
8
|
+
api: string;
|
|
9
|
+
descriptor: TileDescriptor;
|
|
10
|
+
infoB64: string;
|
|
11
|
+
z: number;
|
|
12
|
+
/** Drawn per channel (one TiledImage per channel), from the real levels only. */
|
|
13
|
+
multiChannel: boolean;
|
|
14
|
+
realLevels: number;
|
|
15
|
+
channelStates: IChannelState[];
|
|
16
|
+
display: DisplayPipeline;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Render the current slice as a publication-ready PNG composited with the
|
|
20
|
+
* active display settings (window / gamma / colormap or per-channel pseudo-
|
|
21
|
+
* colours / invert). Picks the largest pyramid level under a pixel cap (the
|
|
22
|
+
* coarser overview for huge whole-slides), fetches that level's tile grid,
|
|
23
|
+
* stitches it into one canvas and runs the shared display pipeline. A
|
|
24
|
+
* per-channel (multichannel) image is exported the way it is drawn: each
|
|
25
|
+
* visible channel's tiles are stitched and merged additively with its tint.
|
|
26
|
+
* Null when there is nothing to export.
|
|
27
|
+
*/
|
|
28
|
+
export declare function renderCompositePng(input: CompositeExportInput): Promise<Blob | null>;
|
|
29
|
+
/**
|
|
30
|
+
* Fetch the data-preserving multi-band TIFF from `GET /export/tiff` (the server
|
|
31
|
+
* reads the raw native-bit-depth planes — the client never sees them). Null
|
|
32
|
+
* while the file is still caching (202) or on failure, which is logged.
|
|
33
|
+
*/
|
|
34
|
+
export declare function fetchTiffExport(http: HttpClient, url: string): Promise<Blob | null>;
|
|
35
|
+
/** `name.tif` → `name` (the export file stem; `image` when there is no name). */
|
|
36
|
+
export declare function fileStem(fileName: string | undefined): string;
|