@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
|
@@ -3,8 +3,17 @@ import { IImageInfo } from '../contracts/image.contract';
|
|
|
3
3
|
import { Region, Rectangle, Polygon, MultiPolygon } from '../models/region';
|
|
4
4
|
import { VisualizerStore } from './visualizer-store.service';
|
|
5
5
|
import { IRegionStore } from '../contracts/visualizer.contract';
|
|
6
|
-
import { IRegionEditApi } from '../contracts/region-store.contract';
|
|
6
|
+
import { IRegionEditApi, IRegionSourceApi } from '../contracts/region-store.contract';
|
|
7
|
+
import type { Mesh } from 'napari-js/geometry';
|
|
8
|
+
import { SliceOutlines } from '../geometry/reconstruct';
|
|
9
|
+
import { StackSaveLayout } from './region-scope-cache';
|
|
10
|
+
import { RegionSourceOpener, RegionSourceSlices } from './region-source-scope';
|
|
11
|
+
import type { RegionSource, RegionSourceView } from '../region-source/region-source';
|
|
12
|
+
import type { RegionIndexPage, RegionIndexQuery } from '../region-source/region-tiles';
|
|
13
|
+
import { RegionStyle } from '../region-overlay/region-style';
|
|
7
14
|
import * as i0 from "@angular/core";
|
|
15
|
+
/** Selecting classes takes at most this many region-source features into the regions. */
|
|
16
|
+
export declare const SELECT_CLASSES_LIMIT = 5000;
|
|
8
17
|
/**
|
|
9
18
|
* Backend-neutral region store — the single source of truth for region state.
|
|
10
19
|
*
|
|
@@ -21,45 +30,33 @@ import * as i0 from "@angular/core";
|
|
|
21
30
|
* - {@link IRegionEditApi} — Region-native geometry edits (move/resize, and
|
|
22
31
|
* add/delete/move vertex) the OSD overlay drives.
|
|
23
32
|
*
|
|
33
|
+
* Copy-on-write (review RT-13): no operation changes a stored {@link Region}
|
|
34
|
+
* (or the regions array) in place. An edit builds a replacement — the geometry
|
|
35
|
+
* through the pure `models/polygon-edit` functions — and swaps it in, so the
|
|
36
|
+
* undo history ({@link RegionHistory}) can keep shallow snapshots that share
|
|
37
|
+
* every untouched region instead of deep-cloning the whole set per step.
|
|
38
|
+
* Callers must follow the same rule with the instances {@link getRegions}
|
|
39
|
+
* returns: treat them as read-only, and commit a changed copy.
|
|
40
|
+
*
|
|
24
41
|
* Classification colours live in {@link VisualizerStore} (shared by both
|
|
25
|
-
* backends); GeoJSON import/export
|
|
26
|
-
*
|
|
42
|
+
* backends); GeoJSON import/export is `models/region-geojson`. All coordinates
|
|
43
|
+
* are image pixels.
|
|
27
44
|
*/
|
|
28
|
-
export declare class RegionStore implements IRegionStore, IRegionEditApi {
|
|
45
|
+
export declare class RegionStore implements IRegionStore, IRegionEditApi, IRegionSourceApi {
|
|
29
46
|
private store;
|
|
30
47
|
private static readonly UNDO_LIMIT;
|
|
31
48
|
private static readonly UNDO_COALESCE_MS;
|
|
32
|
-
/** Per-image region cache. `regions` is always a snapshot of the entry for
|
|
33
|
-
* `currentImageKey`. */
|
|
34
|
-
private regionsByImageKey;
|
|
35
|
-
private currentImageKey;
|
|
36
49
|
/** The current image's regions — the live, edited array. */
|
|
37
50
|
private regions;
|
|
38
|
-
/** Last saved snapshot, restorable via plotPreviousShapes(). */
|
|
39
|
-
private previousRegions;
|
|
40
51
|
/**
|
|
41
52
|
* Undo/redo history (jit-ui#85): up to {@link UNDO_LIMIT} snapshots of the
|
|
42
|
-
* region set, each
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
* times) is coalesced into a single entry: the first commit of a burst
|
|
50
|
-
* captures the pre-burst state and every commit within
|
|
51
|
-
* {@link UNDO_COALESCE_MS} of the previous one is folded into it. History
|
|
52
|
-
* never crosses an image load/switch — {@link resetUndoHistory} clears it.
|
|
53
|
-
*/
|
|
54
|
-
private undoStack;
|
|
55
|
-
private redoStack;
|
|
56
|
-
/** True while a coalescing burst is open (further commits fold into it). */
|
|
57
|
-
private undoBurstOpen;
|
|
58
|
-
private undoBurstTimer;
|
|
59
|
-
/** True while restoring a snapshot, so the restore records no new history. */
|
|
60
|
-
private restoringUndo;
|
|
61
|
-
private readonly canUndo$;
|
|
62
|
-
private readonly canRedo$;
|
|
53
|
+
* region set, each taken just *before* a region-editing action; continuous
|
|
54
|
+
* gestures and rapid commits coalesce (see {@link RegionHistory}). Snapshots
|
|
55
|
+
* are shallow — the regions array as it was — which is safe because nothing
|
|
56
|
+
* here mutates a region or an array in place (RT-13). History never crosses an
|
|
57
|
+
* image load/switch — {@link resetUndoHistory} clears it.
|
|
58
|
+
*/
|
|
59
|
+
private readonly history;
|
|
63
60
|
/** Monotonic id source — ids never repeat within the service lifetime, so
|
|
64
61
|
* selection stays correct across delete/add cycles even when names collide. */
|
|
65
62
|
private nextId;
|
|
@@ -68,39 +65,56 @@ export declare class RegionStore implements IRegionStore, IRegionEditApi {
|
|
|
68
65
|
private fillColor;
|
|
69
66
|
private isRegionSavedOn;
|
|
70
67
|
/**
|
|
71
|
-
* Per-
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
private
|
|
83
|
-
private currentSliceZ;
|
|
84
|
-
/** How a stack's regions round-trip to disk (jit-ui#93): `combined` writes one
|
|
85
|
-
* z-indexed geojson (single-file z-stack, QuPath schema); `per-slice-file`
|
|
86
|
-
* writes one geojson per slice-file (a folder of numbered images). */
|
|
87
|
-
private stackSaveLayout;
|
|
88
|
-
/** Slices that were loaded with regions (jit-ui#93). A per-slice-file save
|
|
89
|
-
* re-writes these even when now empty, so clearing a slice's regions and
|
|
90
|
-
* saving removes its previously-saved geojson (writes an empty one). */
|
|
91
|
-
private stackInitialNonEmpty;
|
|
92
|
-
/** Selection is tracked by region *id* internally (stable across edits) and
|
|
93
|
-
* projected to array indices on the IRegionStore boundary. */
|
|
94
|
-
private selectedIds;
|
|
95
|
-
private readonly selectedIndices$;
|
|
68
|
+
* Per-image cache and, for z-stacks, per-slice regions (jit-ui#93). In stack
|
|
69
|
+
* mode the live `regions` array holds ONE slice — the display slice — so the
|
|
70
|
+
* overlays, the selection projection and the Regions table work unchanged
|
|
71
|
+
* (they all read {@link getRegions}); {@link setDisplaySlice} swaps the live
|
|
72
|
+
* set on scrub and {@link getSliceRegions} flattens every slice (each tagged
|
|
73
|
+
* with its zero-based {@link Region.z}) for save/export. Off by default, so
|
|
74
|
+
* single-plane images are unaffected.
|
|
75
|
+
*/
|
|
76
|
+
private readonly scope;
|
|
77
|
+
/** Selection by region *id* (stable across edits), projected to array
|
|
78
|
+
* indices on the IRegionStore boundary. */
|
|
79
|
+
private readonly selection;
|
|
96
80
|
private readonly regionUpdate$;
|
|
97
81
|
/** Non-coalesced sibling of regionUpdate$: fires on every change even during a
|
|
98
82
|
* batched drag, so live consumers (intensity inset) update per frame. */
|
|
99
83
|
private readonly regionLiveEdit$;
|
|
84
|
+
/** See {@link getRegionSetReplaced$}. */
|
|
85
|
+
private readonly regionSetReplaced$;
|
|
100
86
|
/** Emit coalescing for live drags (see IRegionEditApi.beginBatch). */
|
|
101
87
|
private batchDepth;
|
|
102
88
|
private pendingEmit;
|
|
103
|
-
|
|
89
|
+
/**
|
|
90
|
+
* Large region sets held as tiled region sources rather than as regions (see
|
|
91
|
+
* {@link attachRegionSource}): per image and slice, with the ids taken out of each.
|
|
92
|
+
*/
|
|
93
|
+
private readonly sources;
|
|
94
|
+
private readonly sourceView$;
|
|
95
|
+
/** The region look the user chose (overrides the source's hint), field by field. */
|
|
96
|
+
private userStyle;
|
|
97
|
+
/** The current source's style hint. */
|
|
98
|
+
private hintStyle;
|
|
99
|
+
private readonly regionStyle$;
|
|
100
|
+
/** Bumped on every change of the slice's source, so a late open is dropped. */
|
|
101
|
+
private sourceGeneration;
|
|
102
|
+
/** The source last published as the view: a source shown again does not turn the labels back on. */
|
|
103
|
+
private shownSource;
|
|
104
|
+
/** Bumped when a region source is attached or dropped: what is read from the sources is stale. */
|
|
105
|
+
private sourcesVersion;
|
|
106
|
+
/**
|
|
107
|
+
* The region sources' part of {@link classVolumes}, by class and what the sources hold (see
|
|
108
|
+
* {@link sourceStateKey}): an edit of the regions leaves it, so the volumes of a slice being drawn
|
|
109
|
+
* on cost no source reads.
|
|
110
|
+
*/
|
|
111
|
+
private readonly sourceVolumeCache;
|
|
112
|
+
/** The region sources' outlines of the class sets reconstructed last (see {@link sourceOutlines}). */
|
|
113
|
+
private readonly sourceOutlineCache;
|
|
114
|
+
/** The classes hidden from view (names as given); every class is shown at first. */
|
|
115
|
+
private readonly hiddenClasses$;
|
|
116
|
+
/** {@link hiddenClasses$} by {@link presetKey}, as a region's label is matched. */
|
|
117
|
+
private hiddenKeys;
|
|
104
118
|
constructor(store: VisualizerStore);
|
|
105
119
|
/**
|
|
106
120
|
* Replace (or, with `append`, add to) the current image's regions. Mints ids
|
|
@@ -109,7 +123,14 @@ export declare class RegionStore implements IRegionStore, IRegionEditApi {
|
|
|
109
123
|
* not stored — mirrors the previous Plotly behaviour.
|
|
110
124
|
*/
|
|
111
125
|
setRegions(regions: Region[], showRegionLabel?: boolean, isRegionSaveOn?: boolean, fillColor?: string, append?: boolean): void;
|
|
112
|
-
/**
|
|
126
|
+
/**
|
|
127
|
+
* The canonical accessor: the current image's regions. A fresh array, but the
|
|
128
|
+
* instances are the stored ones, shared with the undo history: treat them as
|
|
129
|
+
* read-only and change a region through the store's operations (or by
|
|
130
|
+
* committing a copy). Typed `Region[]` rather than
|
|
131
|
+
* `ReadonlyArray<Readonly<Region>>` because the IRegionStore contract and the
|
|
132
|
+
* backends still take a mutable array.
|
|
133
|
+
*/
|
|
113
134
|
getRegions(): Region[];
|
|
114
135
|
/** True while a z-stack is loaded and the store holds regions per slice. */
|
|
115
136
|
isStackMode(): boolean;
|
|
@@ -118,7 +139,7 @@ export declare class RegionStore implements IRegionStore, IRegionEditApi {
|
|
|
118
139
|
/** How the current stack persists to disk (jit-ui#93): `combined` = one
|
|
119
140
|
* z-indexed geojson (single-file z-stack); `per-slice-file` = one geojson per
|
|
120
141
|
* slice-file (folder stack). Meaningless outside stack mode. */
|
|
121
|
-
getStackSaveLayout():
|
|
142
|
+
getStackSaveLayout(): StackSaveLayout;
|
|
122
143
|
/**
|
|
123
144
|
* Enter per-slice stack mode. `slices` maps each zero-based slice index to
|
|
124
145
|
* the regions imported for that slice; the store makes `initialZ`'s slice the
|
|
@@ -128,9 +149,11 @@ export declare class RegionStore implements IRegionStore, IRegionEditApi {
|
|
|
128
149
|
* every slice for save/export. Ids/names/classification colours are minted
|
|
129
150
|
* exactly as {@link setRegions} does.
|
|
130
151
|
*/
|
|
131
|
-
enterStackMode(slices: Map<number, Region[]>, initialZ?: number, saveLayout?:
|
|
152
|
+
enterStackMode(slices: Map<number, Region[]>, initialZ?: number, saveLayout?: StackSaveLayout): void;
|
|
132
153
|
/** Leave stack mode (single-plane image, or the stack was closed). */
|
|
133
154
|
exitStackMode(): void;
|
|
155
|
+
/** The live-set swap of {@link setDisplaySlice}. */
|
|
156
|
+
private showSlice;
|
|
134
157
|
/**
|
|
135
158
|
* Show a different slice: capture the current slice's (possibly edited)
|
|
136
159
|
* regions back into the per-slice store, then load the target slice's regions
|
|
@@ -138,6 +161,8 @@ export declare class RegionStore implements IRegionStore, IRegionEditApi {
|
|
|
138
161
|
* this only records the requested slice index (a no-op otherwise: single-plane
|
|
139
162
|
* regions stay on the default plane — addRegion tags Region.z only in stack
|
|
140
163
|
* mode, so the recorded index is unused until a stack is entered). (jit-ui#93)
|
|
164
|
+
* Either way {@link getRegionSetReplaced$} emits: the slice on screen changed
|
|
165
|
+
* under any in-progress tool work.
|
|
141
166
|
*/
|
|
142
167
|
setDisplaySlice(z: number): void;
|
|
143
168
|
/**
|
|
@@ -157,16 +182,36 @@ export declare class RegionStore implements IRegionStore, IRegionEditApi {
|
|
|
157
182
|
/** Mint ids/names + apply classification colours + tag the slice index, as
|
|
158
183
|
* {@link setRegions} does, for regions entering the per-slice store. */
|
|
159
184
|
private normalizeSlice;
|
|
185
|
+
/**
|
|
186
|
+
* Regions entering the store: mint ids and default names, hydrate JSON bounds
|
|
187
|
+
* into class instances — everything downstream (rendering, geometry de-dup,
|
|
188
|
+
* moveRegion, GeoJSON export) discriminates them with `instanceof`
|
|
189
|
+
* (jit-ui#124) — and apply classification colours. A region that is new to
|
|
190
|
+
* the store (no id yet) is completed in place; one that already has an id may
|
|
191
|
+
* be a stored instance shared with the undo history, so it is copied if it
|
|
192
|
+
* changes.
|
|
193
|
+
*/
|
|
194
|
+
private admit;
|
|
160
195
|
/**
|
|
161
196
|
* Closed polygons projected for image-processing consumers (segmentation,
|
|
162
|
-
* trace builders)
|
|
163
|
-
*
|
|
197
|
+
* crop requests, trace builders), straight from each region's bounds: a
|
|
198
|
+
* rectangle's corners, a polygon with its holes (a bézier as its curve), one
|
|
199
|
+
* polygon per part of a multi-polygon. Open polylines are annotation-only and
|
|
200
|
+
* excluded. Coordinates are rounded to whole pixels.
|
|
164
201
|
*/
|
|
165
|
-
getRegionPolygons():
|
|
202
|
+
getRegionPolygons(): Polygon[];
|
|
166
203
|
getRegionUpdateEvent(): Observable<any[]>;
|
|
167
204
|
/** Live (non-coalesced) region-change stream — fires per frame during a drag.
|
|
168
205
|
* Used by the intensity-profile inset so it tracks line ROIs live. */
|
|
169
206
|
getRegionLiveEdit$(): Observable<Region[]>;
|
|
207
|
+
/**
|
|
208
|
+
* Emits after every {@link undo}, {@link redo} and {@link setDisplaySlice} call
|
|
209
|
+
* (even one that changed nothing): the region set was replaced under whatever
|
|
210
|
+
* a canvas tool was building on (a brush stroke, a SAM point prompt), so the
|
|
211
|
+
* backends reset their canvas tools on it. Not emitted for ordinary edits —
|
|
212
|
+
* a tool's own commit must not reset it.
|
|
213
|
+
*/
|
|
214
|
+
getRegionSetReplaced$(): Observable<void>;
|
|
170
215
|
/** Select regions by array index (or [] to clear). Stored internally by id
|
|
171
216
|
* so the selection survives subsequent edits/reorders. */
|
|
172
217
|
setSelectedShapeIndices(indices: number[]): void;
|
|
@@ -183,16 +228,11 @@ export declare class RegionStore implements IRegionStore, IRegionEditApi {
|
|
|
183
228
|
getShowShapeLabel(): boolean;
|
|
184
229
|
getShapeColor(): string;
|
|
185
230
|
getFillColor(): string;
|
|
186
|
-
/**
|
|
231
|
+
/** Show or hide region labels (not on the contract; specs drive it directly).
|
|
232
|
+
* @deprecated Nothing in the library calls it; will be removed next minor. */
|
|
187
233
|
setShowShapeLabel(show: boolean): void;
|
|
188
|
-
setShapeColor(color: string): void;
|
|
189
|
-
setFillColor(color: string): void;
|
|
190
234
|
getClassificationColors(): Map<string, string>;
|
|
191
235
|
setClassificationColor(label: string, color: string): void;
|
|
192
|
-
/** Re-show the last saved snapshot (transient — does not alter stored state). */
|
|
193
|
-
plotPreviousShapes(): void;
|
|
194
|
-
setPreviousShapes(shapes: any[]): void;
|
|
195
|
-
getPreviousShapes(): any[];
|
|
196
236
|
/** Emits whether an undo step is currently available — drives the toolbar
|
|
197
237
|
* Undo button's enabled state (greyed out when false). */
|
|
198
238
|
getCanUndo$(): Observable<boolean>;
|
|
@@ -224,35 +264,36 @@ export declare class RegionStore implements IRegionStore, IRegionEditApi {
|
|
|
224
264
|
* crosses images). */
|
|
225
265
|
resetUndoHistory(): void;
|
|
226
266
|
/** Make `snapshot` the live region set and notify both backends. Shared by
|
|
227
|
-
* {@link undo} and {@link redo};
|
|
228
|
-
* clone, so it becomes the live array directly. */
|
|
267
|
+
* {@link undo} and {@link redo}; nothing records history while it runs. */
|
|
229
268
|
private restoreSnapshot;
|
|
230
269
|
/**
|
|
231
270
|
* Capture the pre-action region set into the bounded undo history. Called at
|
|
232
|
-
* the top of every mutating operation, *before* it changes `regions
|
|
233
|
-
* snapshot is the
|
|
234
|
-
*
|
|
235
|
-
* any redo future.
|
|
271
|
+
* the top of every mutating operation, *before* it changes `regions`. The
|
|
272
|
+
* snapshot is the array itself: every operation replaces `regions` (and any
|
|
273
|
+
* region it edits) rather than changing them, so it never changes after this.
|
|
236
274
|
*/
|
|
237
275
|
private recordUndoSnapshot;
|
|
238
|
-
/**
|
|
239
|
-
private
|
|
240
|
-
/**
|
|
241
|
-
|
|
242
|
-
private closeUndoBurst;
|
|
243
|
-
private cloneRegions;
|
|
244
|
-
/** Deep clone a region so an in-place geometry edit can't mutate a stored
|
|
245
|
-
* history snapshot (bounds are cloned via {@link cloneBounds}). */
|
|
246
|
-
private cloneRegion;
|
|
276
|
+
/** The state an undo step restores. */
|
|
277
|
+
private snapshot;
|
|
278
|
+
/** Parse GeoJSON into regions, remembering the class colours the file carries so they are
|
|
279
|
+
* kept for classes with no preset (see VisualizerStore.rememberImportedClassColors). */
|
|
247
280
|
importRegions(geoJsonStr: string): Region[];
|
|
248
|
-
|
|
281
|
+
/** Download `regions` as GeoJSON, named after `fileName` (extension
|
|
282
|
+
* replaced by `.geojson`) or `rois.geojson` without one. */
|
|
283
|
+
exportRegions(regions: Region[], fileName?: string): void;
|
|
249
284
|
getGeoJsonString(regions: Region[]): string;
|
|
250
285
|
addRegion(region: Region): number;
|
|
251
286
|
removeRegion(id: number): void;
|
|
287
|
+
/**
|
|
288
|
+
* Remove the regions with these ids, if present. With `{ recordUndo: false }`
|
|
289
|
+
* no undo step is taken — for clearing transient shapes that were never the
|
|
290
|
+
* user's work (the 3D view's screen-space lassos on an orbit, NAPARI-SVC-11).
|
|
291
|
+
*/
|
|
292
|
+
removeRegions(ids: Iterable<number>, opts?: {
|
|
293
|
+
recordUndo?: boolean;
|
|
294
|
+
}): void;
|
|
252
295
|
updateBounds(id: number, bounds: Rectangle | Polygon | MultiPolygon): void;
|
|
253
296
|
moveRegion(id: number, dx: number, dy: number): void;
|
|
254
|
-
/** Translate a polygon's vertices and any holes in place by (dx, dy). */
|
|
255
|
-
private translatePolygon;
|
|
256
297
|
moveVertex(id: number, index: number, x: number, y: number): void;
|
|
257
298
|
/** Move a vertex on a polygon's interior ring (hole) — jit-ui#85. */
|
|
258
299
|
moveHoleVertex(id: number, holeIndex: number, index: number, x: number, y: number): void;
|
|
@@ -266,50 +307,205 @@ export declare class RegionStore implements IRegionStore, IRegionEditApi {
|
|
|
266
307
|
addVertex(id: number, segIndex: number, x: number, y: number): void;
|
|
267
308
|
deleteVertex(id: number, index: number): void;
|
|
268
309
|
setBezier(id: number, bezier: boolean): void;
|
|
269
|
-
/** Turn bezier on (and seed editable handles from the smooth default) or off
|
|
270
|
-
* (and drop the handles). */
|
|
271
|
-
private applyBezier;
|
|
272
|
-
/** (Re)seed per-hole bezier handles from the Catmull-Rom default, parallel to `poly.holes`. */
|
|
273
|
-
private seedHoleHandles;
|
|
274
310
|
/** Drag a bezier control point on a hole ring vertex (donut bezier editing). */
|
|
275
311
|
moveHoleBezierHandle(id: number, holeIndex: number, index: number, side: 'in' | 'out', x: number, y: number): void;
|
|
276
312
|
moveBezierHandle(id: number, index: number, side: 'in' | 'out', x: number, y: number): void;
|
|
313
|
+
/** Apply a copy-on-write polygon edit to region `id`: record, swap in, emit. */
|
|
314
|
+
private editPolygon;
|
|
315
|
+
/** Swap `next` in for the stored region with its id (a new array), then sync and emit. */
|
|
316
|
+
private replaceRegion;
|
|
317
|
+
/** Coalesce `regionUpdate$` until the matching {@link endBatch} (live drags);
|
|
318
|
+
* the batch is also one undo gesture ({@link beginGesture}). */
|
|
277
319
|
beginBatch(): void;
|
|
278
320
|
endBatch(): void;
|
|
321
|
+
/**
|
|
322
|
+
* Mark the start of one user gesture (e.g. a wand/brush mousedown): every
|
|
323
|
+
* commit until the matching {@link endGesture} becomes a single undo step,
|
|
324
|
+
* without delaying `regionUpdate$` (tools render through it while dragging).
|
|
325
|
+
* Calls nest. A gesture never folds into an earlier timed burst.
|
|
326
|
+
*/
|
|
327
|
+
beginGesture(): void;
|
|
328
|
+
/** End the gesture opened by {@link beginGesture}; the next commit starts a new step. */
|
|
329
|
+
endGesture(): void;
|
|
330
|
+
/**
|
|
331
|
+
* Hold a large region set as a tiled region source instead of as regions: the backends that
|
|
332
|
+
* draw sources (OpenSeadragon, napari) draw its features at the detail the zoom shows, from
|
|
333
|
+
* the tiles in view, and a feature joins the regions — exactly, as an ordinary editable
|
|
334
|
+
* {@link Region} with its {@link Region.sourceId} — only when it is selected or edited
|
|
335
|
+
* ({@link takeSourceFeatures}). Until then {@link getRegions} does not include it.
|
|
336
|
+
*
|
|
337
|
+
* `source` may be an opener, called the first time its slice is shown (and again if the
|
|
338
|
+
* source was closed to save memory). `slices` says which slice of the current image it
|
|
339
|
+
* serves: one (default: the slice shown; plane 0 of the source), or `'planes'`, every slice z
|
|
340
|
+
* from plane z of a z-indexed source. Replaces the source those slices had.
|
|
341
|
+
*/
|
|
342
|
+
attachRegionSource(source: RegionSource | RegionSourceOpener, slices?: RegionSourceSlices): void;
|
|
343
|
+
/** Drop the current image's region sources (closing them) and what was taken from them. */
|
|
344
|
+
detachRegionSources(): void;
|
|
345
|
+
/**
|
|
346
|
+
* Drop the slice's region source, for regions imported in place of the slice's (a small file
|
|
347
|
+
* replacing a large one): a source of the slice's own is detached; a z-indexed source over every
|
|
348
|
+
* slice has this slice's features taken out (as deleted). The other slices keep theirs.
|
|
349
|
+
*/
|
|
350
|
+
dropSliceRegionSource(): Promise<void>;
|
|
351
|
+
/** Whether the slice shown has a region source. */
|
|
352
|
+
hasRegionSource(): boolean;
|
|
353
|
+
/** The slice's region source as a source layer draws it; null without one (or until it opens). */
|
|
354
|
+
getRegionSourceView(): RegionSourceView | null;
|
|
355
|
+
/** {@link getRegionSourceView} and every change of it (slice, taken ids, class colours). */
|
|
356
|
+
getRegionSourceView$(): Observable<RegionSourceView | null>;
|
|
357
|
+
/**
|
|
358
|
+
* Take source features into the working set for editing: their exact geometry becomes
|
|
359
|
+
* ordinary regions (minted, coloured and slice-tagged as any region entering the store) and
|
|
360
|
+
* the source stops drawing them. Not an undo step of its own — undoing past it puts the
|
|
361
|
+
* features back in the source. Resolves the region ids, in the order asked (a feature already
|
|
362
|
+
* taken resolves to its region); [] when the slice changed meanwhile.
|
|
363
|
+
*/
|
|
364
|
+
takeSourceFeatures(ids: readonly string[]): Promise<number[]>;
|
|
365
|
+
/** {@link takeSourceFeatures}, then select them (added to the selection with `additive`). */
|
|
366
|
+
selectSourceFeatures(ids: readonly string[], additive?: boolean): Promise<number[]>;
|
|
367
|
+
/**
|
|
368
|
+
* Features per class still in the slice's region source (not taken); {} without one. With
|
|
369
|
+
* `stack`, a z-stack's over every slice: its source's planes, or each slice's source added up.
|
|
370
|
+
*/
|
|
371
|
+
getRegionSourceClassCounts(stack?: boolean): Promise<Record<string, number>>;
|
|
372
|
+
/**
|
|
373
|
+
* Select every region of these classes on the slice — the regions', and the region source's,
|
|
374
|
+
* which are taken into the regions (at most {@link SELECT_CLASSES_LIMIT} of them). Added to the
|
|
375
|
+
* selection with `additive`. Resolves the selected region ids.
|
|
376
|
+
*/
|
|
377
|
+
selectClasses(classes: readonly string[], additive?: boolean): Promise<number[]>;
|
|
378
|
+
/**
|
|
379
|
+
* The 3D reconstruction of each group of classes over every slice of the stack (an atlas
|
|
380
|
+
* structure with its substructures, say): the outlines of the regions of those classes on every
|
|
381
|
+
* slice — the region sources' and those drawn or taken — stacked and meshed in a worker. Meshes
|
|
382
|
+
* are in image px (x, y) and slice indices (z). `pixelStep` is the in-plane voxel size (image
|
|
383
|
+
* px); the outlines are read at the matching level of detail. A group with no outline gets an
|
|
384
|
+
* empty mesh.
|
|
385
|
+
*/
|
|
386
|
+
reconstructClasses(groups: ReadonlyArray<{
|
|
387
|
+
key: string;
|
|
388
|
+
classes: readonly string[];
|
|
389
|
+
}>, pixelStep?: number): Promise<Array<{
|
|
390
|
+
key: string;
|
|
391
|
+
mesh: Mesh;
|
|
392
|
+
}>>;
|
|
393
|
+
/**
|
|
394
|
+
* Each class's volume over the whole stack, in px² × slices: its outlines' area on every slice
|
|
395
|
+
* (its features' union, see `outlinesArea`), one slice thick (Cavalieri's estimator), from the
|
|
396
|
+
* exact outlines. Where a feature is, a region source's or a drawn or taken region, does not
|
|
397
|
+
* change it: taking one leaves the volume as it was. The region sources' part is cached until
|
|
398
|
+
* what they hold changes (a feature taken or deleted, another source); only the slices with
|
|
399
|
+
* drawn or taken regions of the class are measured again.
|
|
400
|
+
*/
|
|
401
|
+
classVolumes(classes: readonly string[]): Promise<Map<string, number>>;
|
|
402
|
+
/** The region sources' part of a class's volume, cached by what they hold (see classVolumes). */
|
|
403
|
+
private sourceVolume;
|
|
404
|
+
/**
|
|
405
|
+
* Every slice's outlines of these classes, the region sources' then the regions': closed shapes'
|
|
406
|
+
* rings, and open polylines as `lines`.
|
|
407
|
+
*/
|
|
408
|
+
private classOutlines;
|
|
409
|
+
/**
|
|
410
|
+
* The region sources' outlines of these classes on every slice, without the features taken or
|
|
411
|
+
* deleted. The last few class sets are kept until what the sources hold changes: rebuilding a
|
|
412
|
+
* surface after an edit reads nothing again.
|
|
413
|
+
*/
|
|
414
|
+
private sourceOutlines;
|
|
415
|
+
private readSourceOutlines;
|
|
416
|
+
/**
|
|
417
|
+
* Every class's outlines on every slice, by class: the region sources' (one read for all, kept
|
|
418
|
+
* like {@link sourceOutlines}) and the drawn and taken regions'. What a section through the
|
|
419
|
+
* stack cuts (see `geometry/section`).
|
|
420
|
+
*/
|
|
421
|
+
outlinesByClass(level: number): Promise<Map<string, SliceOutlines[]>>;
|
|
422
|
+
/** The drawn and taken regions' outlines of these classes, by slice. */
|
|
423
|
+
private regionOutlines;
|
|
424
|
+
/** Each drawn or taken region's outlines (of the `wanted` classes; null: every class) with its class. */
|
|
425
|
+
private labelledRegionOutlines;
|
|
426
|
+
/** What the region sources of the image hold (see {@link sourceStateKey}): it changes when a
|
|
427
|
+
* feature is taken or deleted, or that is undone. */
|
|
428
|
+
getSourceStateKey(): string;
|
|
429
|
+
/**
|
|
430
|
+
* What the region sources of the image hold: the image, its sources (one attached or dropped
|
|
431
|
+
* bumps the version) and the features taken from them. A key for what is read from them.
|
|
432
|
+
*/
|
|
433
|
+
private sourceStateKey;
|
|
434
|
+
/** Delete source features without taking them (one undo step). */
|
|
435
|
+
deleteSourceFeatures(ids: readonly string[]): void;
|
|
436
|
+
/**
|
|
437
|
+
* A page of the slice source's features not taken from it (file order), e.g. for the Region
|
|
438
|
+
* Editor's list; an empty page without a source.
|
|
439
|
+
*/
|
|
440
|
+
getRegionSourceIndex(query: Omit<RegionIndexQuery, 'exclude'>): Promise<RegionIndexPage>;
|
|
441
|
+
/**
|
|
442
|
+
* `regions` as a GeoJSON FeatureCollection string merged with the region source behind them:
|
|
443
|
+
* the source's features that were not taken (or deleted), then `regions`. Without a source,
|
|
444
|
+
* {@link getGeoJsonString}. `slice` names a folder stack's slice (default the one shown);
|
|
445
|
+
* on a z-indexed stack's source (`'planes'`) the export spans every slice.
|
|
446
|
+
*/
|
|
447
|
+
getGeoJsonWithSource(regions: Region[], slice?: number): Promise<string>;
|
|
448
|
+
/**
|
|
449
|
+
* Whether a region of class `label` goes unlabelled because a subclass of it (by the region
|
|
450
|
+
* source's class hierarchy) is among the regions too — an atlas's "Isocortex" under its areas.
|
|
451
|
+
* False without a hierarchy.
|
|
452
|
+
*/
|
|
453
|
+
isLabelCovered(label: string | undefined): boolean;
|
|
454
|
+
private coveredFor;
|
|
455
|
+
/** The classes hidden from view (see {@link setClassesHidden}). */
|
|
456
|
+
getHiddenClasses(): ReadonlySet<string>;
|
|
457
|
+
/** {@link getHiddenClasses} and every change of it. */
|
|
458
|
+
getHiddenClasses$(): Observable<ReadonlySet<string>>;
|
|
459
|
+
/**
|
|
460
|
+
* Hide (or show again) these classes' regions: the overlays and the region source's layer stop
|
|
461
|
+
* drawing them, and a hidden region can be neither picked nor kept selected. The regions stay in
|
|
462
|
+
* the set (the table lists them; a save keeps them).
|
|
463
|
+
*/
|
|
464
|
+
setClassesHidden(classes: readonly string[], hidden: boolean): void;
|
|
465
|
+
/** Whether regions labelled `label` are hidden (an unlabelled region never is). */
|
|
466
|
+
isClassHidden(label: string | null | undefined): boolean;
|
|
467
|
+
/** The region look: outlines, or filled (an atlas's look); see `region-style`. */
|
|
468
|
+
getRegionStyle(): RegionStyle;
|
|
469
|
+
/** {@link getRegionStyle} and every change of it. */
|
|
470
|
+
getRegionStyle$(): Observable<RegionStyle>;
|
|
471
|
+
/**
|
|
472
|
+
* Choose the region look, field by field; it overrides a region source's hint for the session.
|
|
473
|
+
* The overlays redraw.
|
|
474
|
+
*/
|
|
475
|
+
setRegionStyle(patch: Partial<RegionStyle>): void;
|
|
476
|
+
/** The look now: the user's choice, else the source's hint, else outlines. */
|
|
477
|
+
private effectiveStyle;
|
|
478
|
+
/** Publish the look when it changed: the overlays redraw the regions, the source layer its features. */
|
|
479
|
+
private restyle;
|
|
480
|
+
/** Re-emit the source view with the current look and label setting. */
|
|
481
|
+
private republishView;
|
|
482
|
+
/** The slice a region source is keyed by: the display slice in stack mode, else 0. */
|
|
483
|
+
private get sourceSlice();
|
|
484
|
+
private currentTaken;
|
|
485
|
+
/** Replace the slice's taken ids and tell the source layers. */
|
|
486
|
+
private setTaken;
|
|
487
|
+
/**
|
|
488
|
+
* Look up (opening it if needed) the slice's source and publish it as the source view. The view
|
|
489
|
+
* is withdrawn at once: until the incoming source opens, nothing reads, takes or deletes from the
|
|
490
|
+
* outgoing one into the slice now shown.
|
|
491
|
+
*/
|
|
492
|
+
private refreshSourceView;
|
|
279
493
|
/**
|
|
280
494
|
* Switch the active image: snapshot the outgoing regions, restore the
|
|
281
495
|
* incoming image's (or [] if none), clear selection, and notify. Idempotent
|
|
282
496
|
* for the same image (so repeated replots of one image keep its regions).
|
|
283
497
|
*/
|
|
284
498
|
setActiveImage(imageInfo: IImageInfo): void;
|
|
285
|
-
/**
|
|
286
|
-
|
|
287
|
-
private
|
|
288
|
-
/**
|
|
289
|
-
* Resolve each region's colour from the annotation-class preset set (jit-ui#70).
|
|
290
|
-
* The presets are the source of truth for colour — this **overrides any colour
|
|
291
|
-
* embedded in the GeoJSON** (which the YOLO worker writes today). A matching
|
|
292
|
-
* preset gives the class colour; an unknown class gets a deterministic fallback
|
|
293
|
-
* colour (and, only when `autoPromote` is on, is added to the editable list).
|
|
294
|
-
* Regions the user explicitly recoloured (`colorOverridden`) are left untouched.
|
|
295
|
-
*/
|
|
296
|
-
private applyClassificationColors;
|
|
499
|
+
/** Apply the preset set's class colours (see {@link applyPresetColors}),
|
|
500
|
+
* promoting unknown classes into the shared store when the set asks for it. */
|
|
501
|
+
private withClassificationColors;
|
|
297
502
|
private syncCache;
|
|
298
503
|
private emit;
|
|
299
|
-
/** Project selected ids
|
|
300
|
-
*
|
|
504
|
+
/** Project the selected ids onto the current regions (pruning gone ones);
|
|
505
|
+
* emits only if the index set changed. */
|
|
301
506
|
private emitSelection;
|
|
302
|
-
private indicesEqual;
|
|
303
507
|
private findById;
|
|
304
508
|
private indexOfId;
|
|
305
|
-
/** The region's bounds as a Polygon, or undefined if it isn't a polygon. */
|
|
306
|
-
private polygonOf;
|
|
307
|
-
private clonePolygon;
|
|
308
|
-
private cloneBounds;
|
|
309
|
-
private regionsEqual;
|
|
310
|
-
private polygonsEqual;
|
|
311
|
-
/** Compare two polygons' interior-ring (hole) sets for the dedupe path. */
|
|
312
|
-
private holesEqual;
|
|
313
509
|
static ɵfac: i0.ɵɵFactoryDeclaration<RegionStore, never>;
|
|
314
510
|
static ɵprov: i0.ɵɵInjectableDeclaration<RegionStore>;
|
|
315
511
|
}
|