@jax-data-science/sci-image-visualizer 0.8.3 → 0.9.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 +28 -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/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/sam.contract.mjs +1 -1
- 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/raster.mjs +98 -0
- package/esm2022/lib/geometry/ring.mjs +201 -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 +3 -4
- package/esm2022/lib/implementations/napari-js/napari-loading-state.mjs +66 -0
- package/esm2022/lib/implementations/napari-js/napari-region-overlay.mjs +157 -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 +263 -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 +344 -0
- package/esm2022/lib/implementations/napari-js/napari-visualizer.service.mjs +358 -4218
- package/esm2022/lib/implementations/napari-js/napari-volume-scene.mjs +439 -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 +182 -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 +153 -0
- package/esm2022/lib/implementations/osd/osd-region-overlay.mjs +185 -718
- 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 +118 -0
- package/esm2022/lib/models/region-clone.mjs +68 -0
- package/esm2022/lib/models/region-geojson.mjs +373 -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/classes-panel/classes-panel.component.mjs +99 -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 +402 -651
- package/esm2022/lib/region-editor/region-metrics.mjs +68 -0
- package/esm2022/lib/region-editor/region-persistence.service.mjs +134 -0
- package/esm2022/lib/region-editor/region-table/region-table.component.mjs +153 -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/svg-region-renderer.mjs +228 -0
- package/esm2022/lib/render-orchestrator.mjs +14 -11
- package/esm2022/lib/render-session.mjs +207 -0
- package/esm2022/lib/routing-visualizer.service.mjs +459 -411
- 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 +46 -3
- package/esm2022/lib/store/region-history.mjs +146 -0
- package/esm2022/lib/store/region-scope-cache.mjs +140 -0
- package/esm2022/lib/store/region-selection.mjs +82 -0
- package/esm2022/lib/store/region-store.service.mjs +279 -675
- package/esm2022/lib/store/spatial-selection.service.mjs +2 -2
- package/esm2022/lib/store/visualizer-store.service.mjs +49 -71
- 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 +114 -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 +81 -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 +68 -117
- 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 +60 -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.component.mjs +480 -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-Csxlnq7I.mjs +41083 -0
- package/fesm2022/jax-data-science-sci-image-visualizer-jax-data-science-sci-image-visualizer-Csxlnq7I.mjs.map +1 -0
- package/fesm2022/jax-data-science-sci-image-visualizer-onnx-sam-session-Bkujqg7m.mjs +238 -0
- package/fesm2022/jax-data-science-sci-image-visualizer-onnx-sam-session-Bkujqg7m.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/spatial-math.worker.js +471 -0
- package/fesm2022/tsne.worker.js +32 -15
- package/index.d.ts +13 -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/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 +1 -1
- package/lib/contracts/region-overlay.contract.d.ts +5 -0
- package/lib/contracts/sam.contract.d.ts +7 -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 +221 -54
- package/lib/contracts/viz-config.d.ts +1 -0
- package/lib/geometry/contour.d.ts +24 -0
- package/lib/geometry/raster.d.ts +42 -0
- package/lib/geometry/ring.d.ts +67 -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 +0 -1
- package/lib/implementations/napari-js/napari-loading-state.d.ts +30 -0
- package/lib/implementations/napari-js/napari-region-overlay.d.ts +62 -70
- package/lib/implementations/napari-js/napari-scene.d.ts +93 -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 +89 -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 +121 -883
- package/lib/implementations/napari-js/napari-volume-scene.d.ts +104 -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 +37 -0
- package/lib/implementations/osd/osd-region-overlay.d.ts +36 -48
- 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 +80 -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 +18 -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 +40 -0
- package/lib/models/region-clone.d.ts +20 -0
- package/lib/models/region-geojson.d.ts +17 -0
- package/lib/models/region.d.ts +40 -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/classes-panel/classes-panel.component.d.ts +56 -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 +166 -199
- package/lib/region-editor/region-metrics.d.ts +26 -0
- package/lib/region-editor/region-persistence.service.d.ts +69 -0
- package/lib/region-editor/region-table/region-table.component.d.ts +83 -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 +157 -0
- package/lib/region-overlay/region-hit-test.d.ts +38 -0
- package/lib/region-overlay/svg-region-renderer.d.ts +110 -0
- package/lib/render-orchestrator.d.ts +6 -2
- package/lib/render-session.d.ts +75 -0
- package/lib/routing-visualizer.service.d.ts +110 -58
- 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 +35 -1
- package/lib/store/region-history.d.ts +66 -0
- package/lib/store/region-scope-cache.d.ts +63 -0
- package/lib/store/region-selection.d.ts +36 -0
- package/lib/store/region-store.service.d.ts +104 -112
- package/lib/store/visualizer-store.service.d.ts +22 -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 +60 -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 +40 -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 +47 -83
- 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 +27 -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.component.d.ts +201 -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/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
|
@@ -1,64 +1,57 @@
|
|
|
1
1
|
import { Image } from 'image-js';
|
|
2
2
|
import { HttpClient } from '@angular/common/http';
|
|
3
|
-
import {
|
|
4
|
-
import { IImageInfo
|
|
3
|
+
import { Region } from '../../models/region';
|
|
4
|
+
import { IImageInfo } from '../../contracts/image.contract';
|
|
5
5
|
import { TileAccessPort } from '../../contracts/ports/tile-access.port';
|
|
6
6
|
import { ImageStatePort } from '../../contracts/ports/image-state.port';
|
|
7
7
|
import { Observable } from 'rxjs';
|
|
8
8
|
import { MessageService } from 'primeng/api';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { WandToolService } from '../../toolbar/wand/wand-tool.service';
|
|
12
|
-
import { BrushToolService, BrushOptions } from '../../toolbar/brush/brush-tool.service';
|
|
9
|
+
import { WandService } from '../../toolbar/wand/wand.service';
|
|
10
|
+
import { CanvasToolManager } from '../../toolbar/tool-kit/canvas-tool-manager';
|
|
13
11
|
import { SamToolService } from '../../toolbar/segmentation/sam-tool.service';
|
|
14
12
|
import { SamPointToolService } from '../../toolbar/segmentation/sam-point-tool.service';
|
|
15
13
|
import { CellSegmentToolService } from '../../toolbar/segmentation/cell-segment-tool.service';
|
|
16
14
|
import { ICellSegmenter } from '../../contracts/cell-segmenter.contract';
|
|
17
|
-
import { VertexEraserToolService } from '../../toolbar/vertex-eraser/vertex-eraser-tool.service';
|
|
18
|
-
import { ZoomToBoxToolService } from '../../toolbar/zoom-to-box/zoom-to-box-tool.service';
|
|
19
15
|
import { PlotType, PlotTypeDescriptor } from '../../contracts/plot-type';
|
|
20
|
-
import {
|
|
16
|
+
import { IViewerBackend, IntensityProfile, IIsosurfaceControls, IIntensityControls, PixelData } from '../../contracts/visualizer.contract';
|
|
21
17
|
import { IHistogram } from '../../contracts/channel-histogram-api.contract';
|
|
22
18
|
import { ViewerCapabilities } from '../../contracts/capabilities.contract';
|
|
23
19
|
import { IRegionOverlay } from '../../contracts/region-overlay.contract';
|
|
20
|
+
import { PlotlyLoaded } from './plotly-image-loader';
|
|
21
|
+
import { IntensityProfileService } from '../../intensity/intensity-profile.service';
|
|
24
22
|
import { ICoordinateTransform } from '../../contracts/coordinate-transform.contract';
|
|
25
23
|
import { VisualizerStore } from '../../store/visualizer-store.service';
|
|
26
24
|
import { RegionStore } from '../../store/region-store.service';
|
|
25
|
+
import { BaseStoreVisualizer } from '../base-store-visualizer';
|
|
26
|
+
import { ColormapNode } from '../../contracts/display-types';
|
|
27
27
|
import * as i0 from "@angular/core";
|
|
28
28
|
export { PlotType } from '../../contracts/plot-type';
|
|
29
|
-
export declare class PlotlyService implements
|
|
29
|
+
export declare class PlotlyService extends BaseStoreVisualizer implements IViewerBackend {
|
|
30
30
|
private tiles;
|
|
31
31
|
private state;
|
|
32
32
|
messageService: MessageService;
|
|
33
|
-
private http;
|
|
34
|
-
private wandService;
|
|
35
|
-
private wandTool;
|
|
36
|
-
private brushTool;
|
|
37
33
|
private samTool;
|
|
38
34
|
private samPointTool;
|
|
39
35
|
private cellSegmentTool;
|
|
40
36
|
private cellSegmenter;
|
|
41
|
-
private
|
|
42
|
-
private zoomToBoxTool;
|
|
43
|
-
private store;
|
|
44
|
-
private regionStore;
|
|
37
|
+
private intensity;
|
|
45
38
|
/**
|
|
46
39
|
* Plotly is the full-featured data backend: it supports every feature,
|
|
47
40
|
* including 3D scenes, live scalar colormaps, pixel readback and the
|
|
48
|
-
* server-side high-def zoom re-fetch. (OpenSeadragon
|
|
49
|
-
* image display.)
|
|
41
|
+
* server-side high-def zoom re-fetch. (OpenSeadragon, the tiled image
|
|
42
|
+
* backend, advertises only image display.)
|
|
50
43
|
*/
|
|
51
44
|
readonly capabilities: ViewerCapabilities;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
private
|
|
45
|
+
/** Plotly's render projection of the shared RegionStore (the shape dicts) and
|
|
46
|
+
* the selection ↔ active-shape mapping (see PlotlyShapeProjection). */
|
|
47
|
+
private readonly shapeProjection;
|
|
48
|
+
/** Step/box zoom, autoscale and the high-def zoom re-fetch (see PlotlyZoomController). */
|
|
49
|
+
private readonly zoom;
|
|
55
50
|
private imageLength;
|
|
56
51
|
private screenHeight;
|
|
57
52
|
private plotDiv;
|
|
58
|
-
private isRealZoom;
|
|
59
53
|
private scaleratio;
|
|
60
54
|
private trueImgSize;
|
|
61
|
-
private zoomCoordinates;
|
|
62
55
|
private fileName;
|
|
63
56
|
private dragMode;
|
|
64
57
|
private urls;
|
|
@@ -72,7 +65,6 @@ export declare class PlotlyService implements IVisualizer {
|
|
|
72
65
|
* "can't access property isGrayscale" and aborted the load.
|
|
73
66
|
*/
|
|
74
67
|
imageInfo: IImageInfo;
|
|
75
|
-
private plotUtilities;
|
|
76
68
|
private plotType;
|
|
77
69
|
private onPlotMouseDown;
|
|
78
70
|
/** Pixel data cached for wand sampling. data[zIndex] is a 2-D matrix. */
|
|
@@ -81,141 +73,93 @@ export declare class PlotlyService implements IVisualizer {
|
|
|
81
73
|
private cachedImageHeight;
|
|
82
74
|
private cachedImageRatios;
|
|
83
75
|
private cachedIsGrayscale;
|
|
76
|
+
/** A serverless multichannel stack's raw channel planes, per loaded slice: the channels'
|
|
77
|
+
* histograms, and what its `image` trace is composited from. */
|
|
78
|
+
private cachedChannelPlanes?;
|
|
79
|
+
/** The channel display of a colour image's `image` traces (see PlotlyImageRecolor). */
|
|
80
|
+
private readonly recolor;
|
|
81
|
+
/** The pending per-frame recolour (requestAnimationFrame handle), if any. */
|
|
82
|
+
private recolorFrame;
|
|
83
|
+
/** A recoloured slice is being encoded; `recolorAgain`: an edit came in meanwhile. */
|
|
84
|
+
private recoloring;
|
|
85
|
+
private recolorAgain;
|
|
86
|
+
/** Recolours the slice a stack's slider brings on screen. */
|
|
87
|
+
private onSliderChange;
|
|
84
88
|
/** Data-space coordinate of the cached frame's pixel (0,0). [0,0] for the full
|
|
85
|
-
* image; a crop's top-left
|
|
89
|
+
* image; a crop's top-left after a high-def zoom (so the tools sample the
|
|
86
90
|
* zoom-level pixels at the right offset/resolution). */
|
|
87
91
|
private cachedFrameOrigin;
|
|
88
|
-
/** Last visible image-pixel rectangle from the active backend's viewport (set by
|
|
89
|
-
* the OSD viewport-change hook via refreshIntensitySamplingForRoi). New profile lines are
|
|
90
|
-
* placed within it so they land on-screen when zoomed in; null → use full image. */
|
|
91
|
-
private lastVisibleRoi;
|
|
92
92
|
/** events */
|
|
93
93
|
private onRelayoutEvent;
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
/** Bumped by every render of the plot div (plot, a high-def zoom re-render,
|
|
95
|
+
* purge, reset). A high-def zoom drops its crop if another render (or the
|
|
96
|
+
* hand-over of the div to another backend) happened while it was fetching. */
|
|
97
|
+
private renderGen;
|
|
98
|
+
/** Slice fetch + decode, the stack pool and its loading flag/progress. */
|
|
99
|
+
private readonly loader;
|
|
96
100
|
private zIndex;
|
|
97
101
|
private autoscaleEvent;
|
|
98
|
-
/**
|
|
99
|
-
|
|
100
|
-
private readonly PROFILE_PALETTE;
|
|
101
|
-
/** Palette cursor for profile lines (never reset on delete, so colours keep
|
|
102
|
-
* cycling across the session). */
|
|
103
|
-
private profileColorSeq;
|
|
104
|
-
private intensityProfile$;
|
|
105
|
-
/** ISOSURFACE band as a 0–255 slider position, mapped onto the volume's real
|
|
106
|
-
* intensity range at render time (see mapIsoBand). Defaults to the full range
|
|
107
|
-
* so the first render shows the whole structure regardless of how bright or
|
|
108
|
-
* dark the volume is; the user then narrows the band to isolate intensities. */
|
|
109
|
-
private isoMin;
|
|
110
|
-
private isoMax;
|
|
111
|
-
/** Actual intensity range of the volume on screen ([min,max] over the loaded
|
|
112
|
-
* frames). The slider spans 0–255, but a given stack often occupies only a
|
|
113
|
-
* sub-range, so we clamp the iso band into this range (with a small margin)
|
|
114
|
-
* to guarantee non-degenerate surfaces — both on first render and on live
|
|
115
|
-
* slider moves. Null until an isosurface volume has been measured. */
|
|
116
|
-
private isoDataRange;
|
|
102
|
+
/** The ISOSURFACE band, mapped onto the measured volume (see PlotlyIsosurfaceControls). */
|
|
103
|
+
private readonly iso;
|
|
117
104
|
private imageCached;
|
|
118
|
-
private imageCachedSubscription
|
|
119
|
-
private filenameSubscription
|
|
120
|
-
/** Drives the intensity inset off region adds/drags/deletes (both backends). */
|
|
121
|
-
private regionUpdateSubscription?;
|
|
122
|
-
/** Live (per-frame, non-coalesced) region edits — so the inset tracks an OSD
|
|
123
|
-
* line ROI live during a drag (OSD batches regionUpdate$ until release). */
|
|
124
|
-
private regionLiveEditSubscription?;
|
|
105
|
+
private imageCachedSubscription?;
|
|
106
|
+
private filenameSubscription?;
|
|
125
107
|
private channelSub?;
|
|
126
|
-
|
|
127
|
-
private
|
|
108
|
+
/** What this backend's canvas tools read and write (one host for every tool). */
|
|
109
|
+
private readonly toolHost;
|
|
110
|
+
/** This backend's own wand, brush, eraser, zoom-to-box and SAM point tools. */
|
|
111
|
+
protected readonly canvasTools: CanvasToolManager;
|
|
128
112
|
/** This backend's region renderer (lazily created in getRegionOverlay). */
|
|
129
113
|
private regionOverlay?;
|
|
130
114
|
private readonly coordinateTransform;
|
|
131
|
-
constructor(tiles: TileAccessPort, state: ImageStatePort, messageService: MessageService, http: HttpClient, wandService: WandService,
|
|
115
|
+
constructor(tiles: TileAccessPort, state: ImageStatePort, messageService: MessageService, http: HttpClient, wandService: WandService, samTool: SamToolService, samPointTool: SamPointToolService, cellSegmentTool: CellSegmentToolService, cellSegmenter: ICellSegmenter | null, store: VisualizerStore, regionStore: RegionStore, intensity: IntensityProfileService);
|
|
116
|
+
/**
|
|
117
|
+
* Subscribe to the shared stores (cached flag, filename, live channel recolor,
|
|
118
|
+
* profile-inset refresh). Idempotent and self-healing, like OSD's
|
|
119
|
+
* ensureColormapSubscription: this service is a root singleton, but
|
|
120
|
+
* `unsubscribe()` (called on VisualizerComponent destroy) tears these down and
|
|
121
|
+
* the constructor never runs again. So `load()`/`plot()` call this to
|
|
122
|
+
* re-establish them after a component teardown/recreate.
|
|
123
|
+
*/
|
|
124
|
+
private ensureSubscriptions;
|
|
132
125
|
getTrueImageSize(): {
|
|
133
126
|
width: number;
|
|
134
127
|
height: number;
|
|
135
128
|
} | null;
|
|
136
129
|
/**
|
|
137
|
-
* Load
|
|
138
|
-
*
|
|
139
|
-
* @param zIndex index of the image to load
|
|
140
|
-
* @return an object with data and ratio keys
|
|
141
|
-
*/
|
|
142
|
-
load(imageInfo: IImageInfo, zIndex: number): Promise<{
|
|
143
|
-
data: any[];
|
|
144
|
-
ratios: number[];
|
|
145
|
-
sizes: number[];
|
|
146
|
-
filename: string;
|
|
147
|
-
}>;
|
|
148
|
-
/**
|
|
149
|
-
*
|
|
150
|
-
* @param plotDiv
|
|
151
|
-
* @param imageLoaded object with data, ratios and sizes key
|
|
152
|
-
* @param imageInfo ImageInfo object
|
|
153
|
-
* @param screenHeight size of the available screen height
|
|
154
|
-
* @param plotType type of plotting
|
|
130
|
+
* Load slice `zIndex`, or the whole shown stack (see PlotlyImageLoader).
|
|
131
|
+
* `signal` aborts the requests: the load then rejects with an `AbortError`.
|
|
155
132
|
*/
|
|
133
|
+
load(imageInfo: IImageInfo, zIndex: number, signal?: AbortSignal): Promise<PlotlyLoaded>;
|
|
156
134
|
/**
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
* between phases.
|
|
135
|
+
* Plot a loaded image (see {@link load}) as `plotType`. `inPlace` updates the
|
|
136
|
+
* existing plot via Plotly.react instead of purge + newPlot — the multi-tier
|
|
137
|
+
* swap (small → large) — so the canvas doesn't briefly blank between phases.
|
|
161
138
|
*/
|
|
162
139
|
plot(plotDiv: string, imageLoaded: any, imageInfo: IImageInfo, screenHeight: number, plotType: PlotType, inPlace?: boolean): Promise<boolean>;
|
|
163
|
-
/**
|
|
164
|
-
* Function used to plot a grayscale heatmap
|
|
165
|
-
* @param plotDiv
|
|
166
|
-
* @param urls
|
|
167
|
-
* @param images
|
|
168
|
-
* @param trueImgSize array containing the following : [x0, x1, y0, y1]
|
|
169
|
-
* @param ratios
|
|
170
|
-
* @param screenHeight
|
|
171
|
-
* @return Promise true when plotting is finished
|
|
172
|
-
*/
|
|
140
|
+
/** Grayscale heatmap, one trace per z-plane. */
|
|
173
141
|
private plotHeatmap;
|
|
174
|
-
/**
|
|
175
|
-
* Function used to plot a grayscale surface
|
|
176
|
-
* @param plotDiv
|
|
177
|
-
* @param urls
|
|
178
|
-
* @param images
|
|
179
|
-
* @param trueImgSize array containing the following : [x0, x1, y0, y1]
|
|
180
|
-
* @param ratios
|
|
181
|
-
* @param screenHeight
|
|
182
|
-
* @return Promise true when plotting is finished
|
|
183
|
-
*/
|
|
142
|
+
/** Grayscale surface. */
|
|
184
143
|
private plotSurface;
|
|
144
|
+
/** RGB image (`width` × `height` pixels), one trace per z-plane, in the current channel
|
|
145
|
+
* display: `target.frames` are the raw frames, `planes` a serverless multichannel stack's raw
|
|
146
|
+
* channel planes per frame. An image that follows the channel states draws a `source` per
|
|
147
|
+
* slice (see PlotlyImageRecolor). */
|
|
148
|
+
private plotRGBHeatmap;
|
|
185
149
|
/**
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
* @param width
|
|
192
|
-
* @param height
|
|
193
|
-
* @param ratios
|
|
194
|
-
* @param screenHeight
|
|
195
|
-
* @return Promise
|
|
150
|
+
* Render `traces` into the plot div and wire the relayout/click events. In
|
|
151
|
+
* place (`Plotly.react`) for the multi-tier small → large swap — `Plotly.purge`
|
|
152
|
+
* + `Plotly.newPlot` blanks the canvas for ~100ms, which looks like a
|
|
153
|
+
* regression to "loading" before the sharper version appears. The layout is
|
|
154
|
+
* built after the per-plot state (screen height, slice count) is set.
|
|
196
155
|
*/
|
|
197
|
-
private
|
|
156
|
+
private renderPlot;
|
|
198
157
|
/**
|
|
199
158
|
* Assemble the normalised input the pluggable trace builders consume.
|
|
200
159
|
* Pure data only — no Plotly handles — so the builders stay backend-neutral.
|
|
201
160
|
*/
|
|
202
161
|
private buildTraceInput;
|
|
203
|
-
/**
|
|
204
|
-
* used to keep the iso band inside the data. Returns null for empty input. */
|
|
205
|
-
private measureIntensityRange;
|
|
206
|
-
/** Map the 0–255 slider band onto the volume's actual intensity range. The
|
|
207
|
-
* slider is fixed 0–255, but a stack often occupies only a narrow sub-range
|
|
208
|
-
* (e.g. this EDOF volume is ~2–50 with structure near 6–10). Mapping spreads
|
|
209
|
-
* the data across the whole slider so every intensity is easy to reach and
|
|
210
|
-
* the band always lands inside the data — a small inset keeps the extreme
|
|
211
|
-
* surfaces off the exact data edges, which are degenerate and draw nothing. */
|
|
212
|
-
private mapIsoBand;
|
|
213
|
-
/**
|
|
214
|
-
* Update the isosurface intensity bounds. When isosurface is on screen this
|
|
215
|
-
* restyles `isomin`/`isomax` in place for a live update (no volume rebuild).
|
|
216
|
-
* Slider values are mapped onto the volume's real range so the surfaces always
|
|
217
|
-
* have data to cross (matching the initial render).
|
|
218
|
-
*/
|
|
162
|
+
/** Update the isosurface intensity band (see PlotlyIsosurfaceControls). */
|
|
219
163
|
setIsoRange(isoMin: number, isoMax: number): void;
|
|
220
164
|
/** Plotly renders isosurfaces, so it exposes the isosurface controls (itself). */
|
|
221
165
|
getIsosurfaceControls(): IIsosurfaceControls | null;
|
|
@@ -225,160 +169,60 @@ export declare class PlotlyService implements IVisualizer {
|
|
|
225
169
|
* Mirrors the structure of the dedicated heatmap/surface renderers.
|
|
226
170
|
*/
|
|
227
171
|
private plotViaRegistry;
|
|
228
|
-
/** Plain 2D chart axes (intensity profile / line plots). */
|
|
229
|
-
private getChartLayout;
|
|
230
|
-
/** Image-aligned 2D axes without the z-plane slider (region scatter). */
|
|
231
|
-
private getOverlayLayout;
|
|
232
|
-
/** 3D scene for volumetric plot types (scatter3d, isosurface). */
|
|
233
|
-
private getVolumeLayout;
|
|
234
172
|
/** Plot types this backend advertises (drives the UI selector). */
|
|
235
173
|
getPlotTypeDescriptors(): PlotTypeDescriptor[];
|
|
236
174
|
/** This backend's region renderer. Plotly draws shapes natively, so the
|
|
237
175
|
* overlay is a thin adapter over this service's drag modes. */
|
|
238
176
|
getRegionOverlay(): IRegionOverlay;
|
|
239
|
-
/** Emits the full set of intensity profiles (one per profile-line region)
|
|
240
|
-
* whenever a profile line is added, moved, or removed. */
|
|
241
|
-
getIntensityProfile$(): Observable<IntensityProfile[]>;
|
|
242
177
|
/** Plotly renders the line ROIs + inset, so it exposes the intensity controls. */
|
|
243
178
|
getIntensityControls(): IIntensityControls | null;
|
|
244
|
-
/**
|
|
245
|
-
*
|
|
246
|
-
* trace per ROI, each drawn in its ROI's colour. Kept here (not in the diagram
|
|
247
|
-
* component) so the consumer never touches Plotly directly.
|
|
248
|
-
*/
|
|
179
|
+
/** Render the floating intensity-profile inset (see plotly-intensity-inset.ts),
|
|
180
|
+
* so the consumer never touches Plotly directly. */
|
|
249
181
|
renderIntensityInset(divId: string, profiles: IntensityProfile[]): void;
|
|
250
|
-
/**
|
|
251
|
-
*
|
|
252
|
-
* are ordinary store regions (tagged `kind: 'profile'`), so they are already
|
|
253
|
-
* part of `this.shapes` — no separate append is needed.
|
|
254
|
-
*/
|
|
182
|
+
/** Region shapes for the image on screen (profile lines included: they are
|
|
183
|
+
* ordinary store regions). */
|
|
255
184
|
private currentRenderShapes;
|
|
256
185
|
/**
|
|
257
|
-
* IIntensityControls: add another
|
|
258
|
-
*
|
|
259
|
-
*
|
|
260
|
-
* the next bright palette colour. Added to the shared store so both backends
|
|
261
|
-
* (Plotly + OpenSeadragon) render and drag it; excluded from the Regions tab
|
|
262
|
-
* and exports by its kind.
|
|
186
|
+
* IIntensityControls: add another profile line (see IntensityProfileService).
|
|
187
|
+
* It is a store region, so a Plotly plot on screen draws it from the store's
|
|
188
|
+
* region-update event, like the OSD/napari overlays.
|
|
263
189
|
*/
|
|
264
190
|
addProfileLine(): Region | null;
|
|
265
|
-
/** The profile-line ROIs currently in the store (kind === 'profile'). */
|
|
266
|
-
private getProfileRegions;
|
|
267
|
-
/** Recompute and broadcast a profile for every profile-line region (id + colour
|
|
268
|
-
* tagged so the inset trace matches its line). */
|
|
269
|
-
private emitProfiles;
|
|
270
|
-
/**
|
|
271
|
-
* Sample the intensity profile for a profile-line region: extract its two
|
|
272
|
-
* polygon endpoints and reuse the shared `computeIntensityProfile` sampling.
|
|
273
|
-
*/
|
|
274
|
-
private computeIntensityProfileForRegion;
|
|
275
191
|
/**
|
|
276
|
-
*
|
|
277
|
-
*
|
|
192
|
+
* Point the pixel tools at these frames (e.g. a high-def zoom crop whose pixel
|
|
193
|
+
* (0,0) sits at image `origin`), and sample the intensity profiles from them.
|
|
278
194
|
*/
|
|
279
195
|
setSamplingFrames(frames: any[], ratios: number[], origin?: [number, number]): void;
|
|
280
|
-
/**
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
ensureIntensitySampling(imageInfo: IImageInfo, zIndex: number): Promise<void>;
|
|
288
|
-
/**
|
|
289
|
-
* {@link IIntensitySampling} stub — the viewport-change signal is OpenSeadragon's
|
|
290
|
-
* (it re-samples on OSD zoom/pan). Plotly's own high-def zoom updates the
|
|
291
|
-
* sampling cache inline, so it never emits here; returns EMPTY so a uniform
|
|
292
|
-
* `IVisualizer` consumer can subscribe regardless of the active backend.
|
|
293
|
-
*/
|
|
294
|
-
getViewportChange$(): Observable<{
|
|
295
|
-
x: number;
|
|
296
|
-
y: number;
|
|
297
|
-
width: number;
|
|
298
|
-
height: number;
|
|
299
|
-
}>;
|
|
300
|
-
/**
|
|
301
|
-
* Re-fetch the given image-pixel ROI at the display resolution and use it as
|
|
302
|
-
* the intensity-sampling source, so the profile reflects the data at the
|
|
303
|
-
* current zoom level. Shared by both backends: the OSD viewport-change hook
|
|
304
|
-
* calls it on zoom/pan; Plotly's own high-def zoom (triggerZoom) updates the
|
|
305
|
-
* same cache inline. `roi` is in full-image pixel coordinates.
|
|
306
|
-
*/
|
|
307
|
-
refreshIntensitySamplingForRoi(x: number, y: number, width: number, height: number, zIndex: number): void;
|
|
308
|
-
/**
|
|
309
|
-
* Sample the active frame's intensity (grayscale value or RGB luminance)
|
|
310
|
-
* along the line ROI. Returns distance-along-line positions and values.
|
|
311
|
-
*/
|
|
312
|
-
private computeIntensityProfile;
|
|
313
|
-
/** Physical pixel size (microns/pixel) for the current image, if known.
|
|
314
|
-
* mpp is constant across frames/channels, so the first metadata entry that
|
|
315
|
-
* carries a positive mppX wins. Returns nulls when the image is unscaled. */
|
|
316
|
-
private currentMpp;
|
|
317
|
-
/**
|
|
318
|
-
* autoscale the plot
|
|
319
|
-
*/
|
|
196
|
+
/** No viewport signal: Plotly's own high-def zoom re-samples the profiles inline. */
|
|
197
|
+
getIntensitySampling(): null;
|
|
198
|
+
/** No navigator and no smoothing toggle (OpenSeadragon/napari-js view options). */
|
|
199
|
+
getOsdViewOptions(): null;
|
|
200
|
+
/** Plotly renders no decimated volumes (napari-js's Resolution control). */
|
|
201
|
+
getVolumeResolution(): null;
|
|
202
|
+
/** Autoscale the plot (see PlotlyZoomController). */
|
|
320
203
|
autoscale(): void;
|
|
321
|
-
/**
|
|
322
|
-
* relayout the plot
|
|
323
|
-
*/
|
|
204
|
+
/** Re-apply the image layout at the current height, over the zoom box if any. */
|
|
324
205
|
relayout(trueImageSize?: number[]): void;
|
|
325
206
|
private setEvents;
|
|
326
207
|
private relayoutEventHandler;
|
|
327
208
|
reloadAndPlot(): void;
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
clearActiveWandRegion(): void;
|
|
331
|
-
setBrushMode(active: boolean, options?: BrushOptions): void;
|
|
332
|
-
setBrushOptions(options: BrushOptions): void;
|
|
333
|
-
setVertexEraserMode(active: boolean): void;
|
|
334
|
-
setVertexEraserRadius(radius: number): void;
|
|
335
|
-
setZoomToBoxMode(active: boolean): void;
|
|
336
|
-
/** Bind the shared zoom-to-box tool to this (Plotly) backend's host. */
|
|
337
|
-
private bindZoomToBoxHost;
|
|
338
|
-
/** Box-prompted SAM: segment the drawn rectangles. The SAM tool reuses the
|
|
339
|
-
* wand host (cached frame + coordinate transform + region store). */
|
|
209
|
+
/** Box-prompted SAM: segment the drawn rectangles against our tool host
|
|
210
|
+
* (cached frame + coordinate transform + region store). */
|
|
340
211
|
segmentRectangles(): Promise<number>;
|
|
341
212
|
segmentRectanglesCellpose(): Promise<number>;
|
|
342
213
|
setSamModel(id: string): void;
|
|
343
|
-
setSamPointMode(active: boolean): void;
|
|
344
|
-
commitSamPoints(): void;
|
|
345
|
-
clearSamPoints(): void;
|
|
346
|
-
/**
|
|
347
|
-
* Tool-host callback: apply the zoom-to-box selection. Stack mode does a
|
|
348
|
-
* pure axis-range relayout; non-stack mode goes through the high-def
|
|
349
|
-
* triggerZoom pipeline so the image is re-fetched at the new resolution.
|
|
350
|
-
*/
|
|
351
|
-
/** Overlay-pixel -> Plotly data coords via the axis objects (subtracting the
|
|
352
|
-
* plot margin offset). The zoom-to-box tool calls this through its host. */
|
|
353
|
-
private zoomBoxPixelToData;
|
|
354
|
-
private applyZoomToBox;
|
|
355
214
|
/** The plot element the tool canvas overlays attach to. */
|
|
356
215
|
getOverlayContainer(): HTMLElement | null;
|
|
357
216
|
/** Plotly coordinate transform (screen <-> data via the axis objects). */
|
|
358
217
|
getCoordinateTransform(): ICoordinateTransform;
|
|
359
|
-
/** Pixel data the wand needs for sampling. null = no image loaded. */
|
|
360
|
-
private getCachedImageData;
|
|
361
|
-
/** Build Plotly shape dicts from the store's regions (the render projection). */
|
|
362
|
-
private regionsToShapeDicts;
|
|
363
|
-
/** Rebuild the dict working-set from the store (after an image switch, or when
|
|
364
|
-
* regions changed while another backend was rendering). */
|
|
365
|
-
private syncShapesFromStore;
|
|
366
218
|
/**
|
|
367
|
-
*
|
|
368
|
-
*
|
|
369
|
-
*
|
|
370
|
-
*
|
|
371
|
-
*
|
|
372
|
-
* (tagged `kind: 'profile'`) and round-trip through here too.
|
|
373
|
-
*/
|
|
374
|
-
private commitShapesToStore;
|
|
375
|
-
/**
|
|
376
|
-
* Push the current `this.shapes` to Plotly, mirror them into the shared store
|
|
377
|
-
* (which syncs its cache + emits the region-update event), and refresh the
|
|
378
|
-
* local previous-shapes buffer. The wand/eraser tools call this after mutating
|
|
379
|
-
* the shapes array directly.
|
|
219
|
+
* Pixel data the wand needs for sampling. null = no image loaded.
|
|
220
|
+
*
|
|
221
|
+
* The traces draw cell (i, j) over `origin + [i, i + 1)·ratio` (see `firstCellCentre`), as OSD
|
|
222
|
+
* and napari draw their pixels, so the frame starts at the cached origin: a click anywhere on a
|
|
223
|
+
* cell floors to that cell, and traced outlines run along the cells' edges.
|
|
380
224
|
*/
|
|
381
|
-
|
|
225
|
+
private getCachedImageData;
|
|
382
226
|
/** Active frame index in the cached image stack. */
|
|
383
227
|
private activeFrameIndex;
|
|
384
228
|
/** Capability-gated 3D scene controls (Plotly renders the 3D plot types). */
|
|
@@ -388,91 +232,31 @@ export declare class PlotlyService implements IVisualizer {
|
|
|
388
232
|
};
|
|
389
233
|
setSurfaceDragMode(mode: string): void;
|
|
390
234
|
resetSurfaceCamera(): void;
|
|
391
|
-
|
|
235
|
+
/** Re-render a high-def zoom crop in the plot type on screen. Without this the
|
|
236
|
+
* re-fetch always fell back to a heatmap, so zooming in contour (or any
|
|
237
|
+
* registry type) reverted to heatmap. */
|
|
238
|
+
private renderZoomCrop;
|
|
392
239
|
setPlotType(plotType: PlotType): void;
|
|
393
240
|
private setImageInfo;
|
|
394
|
-
getShapes(): any[];
|
|
395
|
-
/**
|
|
396
|
-
* Framework-neutral view of the current regions — delegates to the shared
|
|
397
|
-
* RegionStore (the single source of truth). The canonical accessor on the
|
|
398
|
-
* `IVisualizer` contract; consumers should prefer this over `getShapes()`
|
|
399
|
-
* (which exposes Plotly-shaped dicts).
|
|
400
|
-
*/
|
|
401
|
-
getRegions(): Region[];
|
|
402
241
|
/**
|
|
403
242
|
* Switch the active image. The shared RegionStore owns the per-image region
|
|
404
243
|
* cache (snapshot outgoing / restore incoming / clear selection / emit); we
|
|
405
244
|
* delegate to it, then re-project the store's regions into Plotly's dict
|
|
406
245
|
* working-set. Re-projecting unconditionally (even when the store no-ops for
|
|
407
246
|
* the same image) means Plotly also picks up regions another backend (OSD)
|
|
408
|
-
* added while it was off-screen.
|
|
409
|
-
*
|
|
247
|
+
* added while it was off-screen. The switch is not redrawn onto the plot on
|
|
248
|
+
* screen — that still shows the outgoing image, and the next plot draws the
|
|
249
|
+
* incoming one's shapes. Called from `plot()` and from the router before any
|
|
250
|
+
* backend renders.
|
|
410
251
|
*/
|
|
411
252
|
setActiveImage(imageInfo: IImageInfo): void;
|
|
412
|
-
/**
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
*/
|
|
419
|
-
getRegionPolygons(): any[];
|
|
420
|
-
isRectangle(bnds: any): bnds is Rectangle;
|
|
421
|
-
isPolygon(bnds: any): bnds is Polygon;
|
|
422
|
-
/**
|
|
423
|
-
* Set plot regions. Delegates the state change to the shared RegionStore
|
|
424
|
-
* (id/name minting, classification colours, append de-duplication, per-image
|
|
425
|
-
* cache and the region-update event all live there), then re-projects the
|
|
426
|
-
* store's regions into Plotly's dict working-set and renders.
|
|
427
|
-
*
|
|
428
|
-
* When `isRegionSaveOn` is false the regions are shown transiently — rendered
|
|
429
|
-
* without altering the stored working-set (preserves the prior behaviour).
|
|
430
|
-
*/
|
|
431
|
-
setRegions(regions: Region[], showRegionLabel?: boolean, isRegionSaveOn?: boolean, fillColor?: string, append?: boolean): void;
|
|
432
|
-
/** The shapes-relayout payload: region shapes (profile-line ROIs included, as
|
|
433
|
-
* they are ordinary regions) plus the active-shape fill colour. */
|
|
434
|
-
private shapesRelayout;
|
|
435
|
-
/** Push the current dict working-set to Plotly (no-op when another backend
|
|
436
|
-
* owns the div). */
|
|
437
|
-
private renderShapes;
|
|
438
|
-
getShowShapeLabel(): boolean;
|
|
439
|
-
/**
|
|
440
|
-
* Set previous saved shapes
|
|
441
|
-
*/
|
|
442
|
-
plotPreviousShapes(): void;
|
|
443
|
-
setPreviousShapes(shapes: ShapeSelection[]): void;
|
|
444
|
-
getPreviousShapes(): ShapeSelection[];
|
|
445
|
-
undo(): void;
|
|
446
|
-
redo(): void;
|
|
447
|
-
canUndo(): boolean;
|
|
448
|
-
canRedo(): boolean;
|
|
449
|
-
getCanUndo$(): Observable<boolean>;
|
|
450
|
-
getCanRedo$(): Observable<boolean>;
|
|
451
|
-
resetUndoHistory(): void;
|
|
452
|
-
enterStackMode(slices: Map<number, Region[]>, initialZ?: number, saveLayout?: 'combined' | 'per-slice-file'): void;
|
|
453
|
-
exitStackMode(): void;
|
|
454
|
-
isStackMode(): boolean;
|
|
455
|
-
getStackSaveLayout(): 'combined' | 'per-slice-file';
|
|
456
|
-
setDisplaySlice(z: number): void;
|
|
457
|
-
getSliceRegions(): Region[];
|
|
458
|
-
getStackSaveSlices(): Map<number, Region[]>;
|
|
253
|
+
/** The plot div while it hosts a live Plotly graph, else null. `plotDiv`
|
|
254
|
+
* stays set after purgePlot() hands the div to another backend (OSD,
|
|
255
|
+
* napari-js), and Plotly.relayout/restyle throw on a non-Plotly div. */
|
|
256
|
+
private liveGd;
|
|
257
|
+
/** The live state an image-aligned layout is built from. */
|
|
258
|
+
private layoutContext;
|
|
459
259
|
private getHeatmapLayout;
|
|
460
|
-
private shapesToRedraw;
|
|
461
|
-
/**
|
|
462
|
-
* Unused (will be used when surface plot is added)
|
|
463
|
-
* @param xRange
|
|
464
|
-
* @param yRange
|
|
465
|
-
* @param zRatio
|
|
466
|
-
* @private
|
|
467
|
-
*/
|
|
468
|
-
private getSurfaceLayout;
|
|
469
|
-
private getSteps;
|
|
470
|
-
/**
|
|
471
|
-
* Fetch an image via Angular HttpClient so that auth interceptors (Bearer token)
|
|
472
|
-
* are applied, then decode it with image-js. This avoids raw browser fetch()
|
|
473
|
-
* calls that bypass the interceptor chain and fail behind an OAuth2 proxy.
|
|
474
|
-
*/
|
|
475
|
-
private loadImage;
|
|
476
260
|
/**
|
|
477
261
|
* Get the currently displayed image as an image-js Image instance.
|
|
478
262
|
* Used by the processing pipeline to obtain the input image.
|
|
@@ -483,21 +267,10 @@ export declare class PlotlyService implements IVisualizer {
|
|
|
483
267
|
* This captures whatever is actually rendered — including zoomed regions.
|
|
484
268
|
* Returns { width, height, channels, data } or null if no plot is displayed.
|
|
485
269
|
*/
|
|
486
|
-
getDisplayedPixelData():
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
data: Uint8ClampedArray;
|
|
491
|
-
} | null;
|
|
492
|
-
/**
|
|
493
|
-
* Region of the original image that the displayed `z` grid covers, in
|
|
494
|
-
* full-image pixel coords. On a server zoom (`triggerZoom`) the trace `z` is
|
|
495
|
-
* replaced with the high-def crop and the axes are relaid out to the crop's
|
|
496
|
-
* original-image bounds (`imageSize`), so the live axis ranges ARE that
|
|
497
|
-
* rectangle; when the whole image is in view the ranges span `trueImgSize`.
|
|
498
|
-
* Reading the ranges therefore yields the crop origin + extent without
|
|
499
|
-
* tracking zoom state separately. Falls back to the full image, then `null`.
|
|
500
|
-
*/
|
|
270
|
+
getDisplayedPixelData(): PixelData | null;
|
|
271
|
+
/** The image rect the displayed `z` grid covers, in full-image pixel coords —
|
|
272
|
+
* read off the live axis ranges (a high-def zoom relays them out to the crop),
|
|
273
|
+
* else the whole image (see axesSourceRect). */
|
|
501
274
|
getDisplayedSourceRect(): {
|
|
502
275
|
x: number;
|
|
503
276
|
y: number;
|
|
@@ -517,74 +290,37 @@ export declare class PlotlyService implements IVisualizer {
|
|
|
517
290
|
downloadImage(): void;
|
|
518
291
|
resetAxes(): void;
|
|
519
292
|
setDragMode(mode: string | false): void;
|
|
520
|
-
/** {@link IDataRenderer} stub — Plotly has no overview navigator (it's an
|
|
521
|
-
* OpenSeadragon feature), so toggling it is a no-op here. */
|
|
522
|
-
setNavigatorVisible(_visible: boolean): void;
|
|
523
|
-
/** {@link IDataRenderer} stub — image smoothing is an OpenSeadragon canvas-drawer
|
|
524
|
-
* setting; the Plotly image/heatmap traces don't expose it, so it's a no-op. */
|
|
525
|
-
setImageSmoothingEnabled(_enabled: boolean): void;
|
|
526
293
|
zoomIn(): void;
|
|
527
|
-
/**
|
|
528
|
-
* Delete every currently selected shape. Falls back to the single
|
|
529
|
-
* `_activeShapeIndex` when no multi-selection is active (covers the case
|
|
530
|
-
* where Plotly clicked a shape without going through the table).
|
|
531
|
-
*/
|
|
532
|
-
deleteActiveShape(): void;
|
|
533
294
|
zoomOut(): void;
|
|
534
295
|
isStackLoading$(): Observable<boolean>;
|
|
535
296
|
setStackLoading(stackLoading: boolean): void;
|
|
536
297
|
getStackLoadingProgress$(): Observable<number>;
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
getColormap(): Observable<any>;
|
|
540
|
-
setReverseScale(reverscale: any): void;
|
|
541
|
-
getReverseScale(): Observable<boolean>;
|
|
542
|
-
setImageMeta(imageMeta: IImageMetadata[]): void;
|
|
543
|
-
getImageMeta(): Observable<IImageMetadata[]>;
|
|
298
|
+
setColormap(colormap: ColormapNode): void;
|
|
299
|
+
setReverseScale(reverscale: boolean): void;
|
|
544
300
|
setShowStack(showstack: boolean): void;
|
|
545
301
|
getAutoscaleEvent(): Observable<any>;
|
|
546
|
-
getRegionUpdateEvent(): Observable<any[]>;
|
|
547
|
-
/**
|
|
548
|
-
* Stream of the indices of currently selected regions — owned by the shared
|
|
549
|
-
* RegionStore so the selection is consistent across backends and the Region
|
|
550
|
-
* Editor table. Empty = nothing selected.
|
|
551
|
-
*/
|
|
552
|
-
getSelectedShapeIndices$(): Observable<number[]>;
|
|
553
|
-
/**
|
|
554
|
-
* Programmatically select regions (or clear with []). The shared store owns
|
|
555
|
-
* the selection state (validates/dedupes/emits); here we additionally point
|
|
556
|
-
* Plotly's `_activeShapeIndex` at the last selected shape so it gets the edit
|
|
557
|
-
* handles. No visual change to non-active shapes — Plotly's own active-shape
|
|
558
|
-
* rendering is the only highlight.
|
|
559
|
-
*/
|
|
560
|
-
setSelectedShapeIndices(indices: number[]): void;
|
|
561
|
-
/**
|
|
562
|
-
* Select a specific region (IRegionStore.selectRegion). Sets the shared store
|
|
563
|
-
* selection by identity and points Plotly's active-shape at the matching
|
|
564
|
-
* rendered shape so its edit handles appear.
|
|
565
|
-
*/
|
|
566
|
-
selectRegion(region: Region): void;
|
|
567
|
-
/**
|
|
568
|
-
* Read Plotly's `_activeShapeIndex` and push it as the selection. Called from
|
|
569
|
-
* the relayout handler and the post-click tick — Plotly doesn't fire a
|
|
570
|
-
* dedicated active-shape event for clicks, so we sample. The store no-ops if
|
|
571
|
-
* the selection is unchanged.
|
|
572
|
-
*/
|
|
573
|
-
private maybeEmitActiveShapeIndex;
|
|
574
302
|
setZIndex(zIndex: number): void;
|
|
575
|
-
getShapeColor(): string;
|
|
576
|
-
getFillColor(): string;
|
|
577
|
-
getClassificationColors(): Map<string, string>;
|
|
578
|
-
setClassificationColor(label: string, color: string): void;
|
|
579
303
|
/**
|
|
580
304
|
* Unsubscribe Subscriptions
|
|
581
305
|
*/
|
|
582
306
|
unsubscribe(): void;
|
|
583
307
|
/** Live-apply the channel display window (zmin/zmax) + reverse/invert to the
|
|
584
|
-
* heatmap
|
|
308
|
+
* heatmap — or, for a colour image's `image` trace, recomposite it per channel
|
|
309
|
+
* (PlotlyImageRecolor). No-op when no Plotly plot is mounted (OSD owns the div). */
|
|
585
310
|
private applyChannelDisplay;
|
|
311
|
+
/**
|
|
312
|
+
* Recolour the slice on screen on the next frame: a slider drag in the dialog
|
|
313
|
+
* emits per step, and coalescing them keeps one recomposite per frame — and
|
|
314
|
+
* none while the previous one is still encoding (see recolorShownFrame).
|
|
315
|
+
*/
|
|
316
|
+
private scheduleRecolor;
|
|
317
|
+
/** Restyle trace `index`'s `source` into the current channel display, unless it shows it
|
|
318
|
+
* already. One picture at a time: an edit made while one encodes is drawn after it, in the
|
|
319
|
+
* state current by then. */
|
|
320
|
+
private recolorShownFrame;
|
|
586
321
|
/** Binned intensity histogram for a channel from the cached source frames
|
|
587
|
-
* (raw, pre-LUT). Grayscale cells are numbers; RGB cells are [r,g,b]
|
|
322
|
+
* (raw, pre-LUT). Grayscale cells are numbers; RGB cells are [r,g,b]; a
|
|
323
|
+
* serverless multichannel stack bins the channel's own raw plane. */
|
|
588
324
|
getHistogram(channelIndex: number, _bins: number): IHistogram | null;
|
|
589
325
|
/** Async histogram stream — Plotly renders heatmap frame data (already in
|
|
590
326
|
* memory, 8-bit luminance), so this just wraps the synchronous 8-bit
|
|
@@ -593,11 +329,10 @@ export declare class PlotlyService implements IVisualizer {
|
|
|
593
329
|
/** Data export (16-bit TIFF) is an OSD-tile-path feature backed by the server.
|
|
594
330
|
* Plotly renders heatmaps from frame data, so there's nothing to export here. */
|
|
595
331
|
exportData(): void;
|
|
596
|
-
|
|
332
|
+
/** As the base class, but the file is named after the image on screen. */
|
|
597
333
|
exportRegions(regions: Region[]): void;
|
|
598
|
-
getGeoJsonString(regions: Region[]): string;
|
|
599
334
|
getStackLoadingProgress(): Observable<number>;
|
|
600
335
|
isStackLoading(): Observable<boolean>;
|
|
601
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<PlotlyService, [null, null, null, null, null, null, null, null,
|
|
336
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PlotlyService, [null, null, null, null, null, null, null, null, { optional: true; }, null, null, null]>;
|
|
602
337
|
static ɵprov: i0.ɵɵInjectableDeclaration<PlotlyService>;
|
|
603
338
|
}
|