@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.
Files changed (579) hide show
  1. package/README.md +201 -460
  2. package/esm2022/index.mjs +34 -15
  3. package/esm2022/lib/channel-histogram/channel-histogram.component.mjs +163 -91
  4. package/esm2022/lib/contracts/capabilities.contract.mjs +4 -3
  5. package/esm2022/lib/contracts/cell-segmenter.contract.mjs +1 -1
  6. package/esm2022/lib/contracts/channel-histogram-api.contract.mjs +5 -1
  7. package/esm2022/lib/contracts/color.mjs +60 -0
  8. package/esm2022/lib/contracts/colormap-lut.mjs +213 -57
  9. package/esm2022/lib/contracts/coordinate-transform.contract.mjs +1 -1
  10. package/esm2022/lib/contracts/display-types.mjs +11 -1
  11. package/esm2022/lib/contracts/image.contract.mjs +1 -1
  12. package/esm2022/lib/contracts/instance-segmenter.contract.mjs +1 -1
  13. package/esm2022/lib/contracts/intensity.mjs +48 -5
  14. package/esm2022/lib/contracts/plot-type-contribution.contract.mjs +1 -1
  15. package/esm2022/lib/contracts/plot-type.mjs +134 -17
  16. package/esm2022/lib/contracts/ports/image-state.port.mjs +4 -1
  17. package/esm2022/lib/contracts/ports/preferences.port.mjs +5 -1
  18. package/esm2022/lib/contracts/ports/region-io.port.mjs +2 -1
  19. package/esm2022/lib/contracts/ports/spatial-data.port.mjs +5 -1
  20. package/esm2022/lib/contracts/ports/tile-access.port.mjs +2 -1
  21. package/esm2022/lib/contracts/region-editor-api.contract.mjs +1 -1
  22. package/esm2022/lib/contracts/region-overlay.contract.mjs +1 -1
  23. package/esm2022/lib/contracts/region-store.contract.mjs +1 -1
  24. package/esm2022/lib/contracts/sam.contract.mjs +1 -1
  25. package/esm2022/lib/contracts/section-view.contract.mjs +2 -0
  26. package/esm2022/lib/contracts/semantic-segmenter.contract.mjs +1 -1
  27. package/esm2022/lib/contracts/spatial-dataset.contract.mjs +3 -1
  28. package/esm2022/lib/contracts/toolbar-tool.contract.mjs +6 -4
  29. package/esm2022/lib/contracts/visualizer.contract.mjs +1 -1
  30. package/esm2022/lib/contracts/viz-config.mjs +2 -1
  31. package/esm2022/lib/geometry/contour.mjs +63 -0
  32. package/esm2022/lib/geometry/loft.mjs +128 -0
  33. package/esm2022/lib/geometry/polylabel.mjs +156 -0
  34. package/esm2022/lib/geometry/raster.mjs +98 -0
  35. package/esm2022/lib/geometry/reconstruct.mjs +315 -0
  36. package/esm2022/lib/geometry/reslice-image.mjs +57 -0
  37. package/esm2022/lib/geometry/ring.mjs +201 -0
  38. package/esm2022/lib/geometry/section.mjs +215 -0
  39. package/esm2022/lib/hex-color-picker/hex-color-picker.component.mjs +202 -102
  40. package/esm2022/lib/implementations/base-store-visualizer.mjs +201 -48
  41. package/esm2022/lib/implementations/napari-js/napari-axes-gizmo.mjs +65 -0
  42. package/esm2022/lib/implementations/napari-js/napari-display-state.mjs +136 -0
  43. package/esm2022/lib/implementations/napari-js/napari-helpers.mjs +199 -0
  44. package/esm2022/lib/implementations/napari-js/napari-image-2d-scene.mjs +602 -0
  45. package/esm2022/lib/implementations/napari-js/napari-loading-badge.mjs +12 -9
  46. package/esm2022/lib/implementations/napari-js/napari-loading-state.mjs +83 -0
  47. package/esm2022/lib/implementations/napari-js/napari-region-mesh-pointer.mjs +100 -0
  48. package/esm2022/lib/implementations/napari-js/napari-region-overlay.mjs +180 -591
  49. package/esm2022/lib/implementations/napari-js/napari-scene.mjs +2 -0
  50. package/esm2022/lib/implementations/napari-js/napari-spatial-2d-scene.mjs +614 -0
  51. package/esm2022/lib/implementations/napari-js/napari-spatial-3d-scene.mjs +769 -0
  52. package/esm2022/lib/implementations/napari-js/napari-spatial-encoding.mjs +199 -0
  53. package/esm2022/lib/implementations/napari-js/napari-spatial-hover.mjs +270 -0
  54. package/esm2022/lib/implementations/napari-js/napari-spatial-scene.mjs +159 -0
  55. package/esm2022/lib/implementations/napari-js/napari-spatial-tiles.mjs +106 -1408
  56. package/esm2022/lib/implementations/napari-js/napari-spatial-tooltip.mjs +2 -2
  57. package/esm2022/lib/implementations/napari-js/napari-surface-scene.mjs +271 -0
  58. package/esm2022/lib/implementations/napari-js/napari-tile-client.mjs +562 -0
  59. package/esm2022/lib/implementations/napari-js/napari-tool-bridge.mjs +347 -0
  60. package/esm2022/lib/implementations/napari-js/napari-visualizer.service.mjs +427 -4207
  61. package/esm2022/lib/implementations/napari-js/napari-volume-region-meshes.mjs +129 -0
  62. package/esm2022/lib/implementations/napari-js/napari-volume-scene.mjs +550 -0
  63. package/esm2022/lib/implementations/napari-js/napari-volume-slice-planes.mjs +103 -0
  64. package/esm2022/lib/implementations/napari-js/napari-volume-z-handle.mjs +6 -6
  65. package/esm2022/lib/implementations/napari-js/region-overlay/overlay-projection.mjs +96 -0
  66. package/esm2022/lib/implementations/napari-js/region-overlay/region-edit.mjs +35 -0
  67. package/esm2022/lib/implementations/napari-js/region-overlay/region-svg-renderer.mjs +194 -0
  68. package/esm2022/lib/implementations/napari-js/spatial-tiles/categorical-lookup.mjs +30 -0
  69. package/esm2022/lib/implementations/napari-js/spatial-tiles/cell-layers.mjs +274 -0
  70. package/esm2022/lib/implementations/napari-js/spatial-tiles/density-layer.mjs +144 -0
  71. package/esm2022/lib/implementations/napari-js/spatial-tiles/layer-groups.mjs +165 -0
  72. package/esm2022/lib/implementations/napari-js/spatial-tiles/plan-context.mjs +78 -0
  73. package/esm2022/lib/implementations/napari-js/spatial-tiles/transcript-hover.mjs +182 -0
  74. package/esm2022/lib/implementations/napari-js/spatial-tiles/transcript-jobs.mjs +369 -0
  75. package/esm2022/lib/implementations/napari-js/spatial-tiles/transcript-layers.mjs +306 -0
  76. package/esm2022/lib/implementations/osd/display-pipeline.mjs +102 -40
  77. package/esm2022/lib/implementations/osd/histogram-sampler.mjs +56 -31
  78. package/esm2022/lib/implementations/osd/openseadragon-viewer-options.mjs +128 -0
  79. package/esm2022/lib/implementations/osd/openseadragon-visualizer.service.mjs +333 -1685
  80. package/esm2022/lib/implementations/osd/osd-coordinate-transform.mjs +1 -1
  81. package/esm2022/lib/implementations/osd/osd-coords.mjs +5 -6
  82. package/esm2022/lib/implementations/osd/osd-export.mjs +122 -0
  83. package/esm2022/lib/implementations/osd/osd-lib.mjs +15 -1
  84. package/esm2022/lib/implementations/osd/osd-navigator-chrome.mjs +205 -0
  85. package/esm2022/lib/implementations/osd/osd-pixel-readback.mjs +68 -0
  86. package/esm2022/lib/implementations/osd/osd-region-overlay-draw.mjs +164 -0
  87. package/esm2022/lib/implementations/osd/osd-region-overlay.mjs +213 -716
  88. package/esm2022/lib/implementations/osd/osd-scale-bar.mjs +52 -60
  89. package/esm2022/lib/implementations/osd/osd-tile-source.mjs +105 -0
  90. package/esm2022/lib/implementations/osd/osd-viewer-like.mjs +2 -0
  91. package/esm2022/lib/implementations/osd/osd-viewer-mount.mjs +44 -0
  92. package/esm2022/lib/implementations/osd/osd-viewport.mjs +184 -0
  93. package/esm2022/lib/implementations/osd/osd-zoom.mjs +7 -1
  94. package/esm2022/lib/implementations/osd/simple-source.mjs +395 -0
  95. package/esm2022/lib/implementations/osd/slice-cache.mjs +53 -48
  96. package/esm2022/lib/implementations/osd/tile-client.mjs +32 -11
  97. package/esm2022/lib/implementations/osd/tile-recolor.mjs +330 -0
  98. package/esm2022/lib/implementations/plotly/omics-trace-builders.mjs +161 -73
  99. package/esm2022/lib/implementations/plotly/plotly-coordinate-transform.mjs +1 -1
  100. package/esm2022/lib/implementations/plotly/plotly-image-loader.mjs +112 -0
  101. package/esm2022/lib/implementations/plotly/plotly-image-recolor.mjs +178 -0
  102. package/esm2022/lib/implementations/plotly/plotly-intensity-inset.mjs +33 -0
  103. package/esm2022/lib/implementations/plotly/plotly-isosurface-controls.mjs +83 -0
  104. package/esm2022/lib/implementations/plotly/plotly-layouts.mjs +121 -0
  105. package/esm2022/lib/implementations/plotly/plotly-readback.mjs +117 -0
  106. package/esm2022/lib/implementations/plotly/plotly-region-overlay.mjs +19 -10
  107. package/esm2022/lib/implementations/plotly/plotly-shape-projection.mjs +223 -0
  108. package/esm2022/lib/implementations/plotly/plotly-trace-builders.mjs +79 -19
  109. package/esm2022/lib/implementations/plotly/plotly-zoom-controller.mjs +223 -0
  110. package/esm2022/lib/implementations/plotly/plotly.service.mjs +439 -1655
  111. package/esm2022/lib/implementations/region-centroids.mjs +47 -0
  112. package/esm2022/lib/implementations/simple-slice-access.service.mjs +22 -12
  113. package/esm2022/lib/implementations/spatial-data-http/spatial-data-http.service.mjs +172 -92
  114. package/esm2022/lib/implementations/spatial-data-http/spatial-wire.mjs +103 -22
  115. package/esm2022/lib/implementations/tile-server/index.mjs +6 -0
  116. package/esm2022/lib/implementations/tile-server/native-histogram.mjs +30 -0
  117. package/esm2022/lib/implementations/tile-server/poll-descriptor.mjs +65 -0
  118. package/esm2022/lib/implementations/tile-server/tile-protocol.mjs +42 -0
  119. package/esm2022/lib/implementations/tile-server/transport.mjs +135 -0
  120. package/esm2022/lib/intensity/intensity-profile.mjs +107 -0
  121. package/esm2022/lib/intensity/intensity-profile.service.mjs +223 -0
  122. package/esm2022/lib/intensity-inset/intensity-inset.component.mjs +133 -0
  123. package/esm2022/lib/models/bezier.mjs +1 -11
  124. package/esm2022/lib/models/class-preset.mjs +41 -3
  125. package/esm2022/lib/models/geometry.mjs +27 -164
  126. package/esm2022/lib/models/polygon-edit.mjs +254 -0
  127. package/esm2022/lib/models/polygon-factory.mjs +134 -0
  128. package/esm2022/lib/models/region-clone.mjs +68 -0
  129. package/esm2022/lib/models/region-geojson.mjs +411 -0
  130. package/esm2022/lib/models/region.mjs +34 -33
  131. package/esm2022/lib/models/shape.mjs +18 -16
  132. package/esm2022/lib/plot-mode/contribution-host.mjs +297 -0
  133. package/esm2022/lib/plot-mode/plot-mode-controller.mjs +9 -6
  134. package/esm2022/lib/plot-mode/plot-type-menu.mjs +85 -0
  135. package/esm2022/lib/plot-mode/tool-params-model.mjs +87 -0
  136. package/esm2022/lib/plot.utilities.mjs +296 -473
  137. package/esm2022/lib/processing/image-crop.mjs +1 -1
  138. package/esm2022/lib/processing/processing-image.mjs +28 -15
  139. package/esm2022/lib/provide-visualization.mjs +40 -14
  140. package/esm2022/lib/region-editor/class-tree/class-tree.component.mjs +156 -0
  141. package/esm2022/lib/region-editor/class-tree/class-tree.mjs +108 -0
  142. package/esm2022/lib/region-editor/classes-panel/classes-panel.component.mjs +163 -0
  143. package/esm2022/lib/region-editor/file-stem.mjs +13 -0
  144. package/esm2022/lib/region-editor/manage-classes-dialog/manage-classes-dialog.component.mjs +118 -0
  145. package/esm2022/lib/region-editor/mask-export.service.mjs +98 -0
  146. package/esm2022/lib/region-editor/mask-raster.mjs +11 -5
  147. package/esm2022/lib/region-editor/region-color-dialog/region-color-dialog.component.mjs +56 -0
  148. package/esm2022/lib/region-editor/region-editor-help/region-editor-help.component.mjs +28 -0
  149. package/esm2022/lib/region-editor/region-editor.component.mjs +896 -660
  150. package/esm2022/lib/region-editor/region-metrics.mjs +86 -0
  151. package/esm2022/lib/region-editor/region-persistence.service.mjs +160 -0
  152. package/esm2022/lib/region-editor/region-table/region-table.component.mjs +169 -0
  153. package/esm2022/lib/region-editor/save-mask-dialog/save-mask-dialog.component.mjs +91 -0
  154. package/esm2022/lib/region-editor/save-regions-dialog/save-regions-dialog.component.mjs +92 -0
  155. package/esm2022/lib/region-ops.service.mjs +28 -70
  156. package/esm2022/lib/region-overlay/region-geometry.mjs +360 -0
  157. package/esm2022/lib/region-overlay/region-hit-test.mjs +103 -0
  158. package/esm2022/lib/region-overlay/region-source-layer.mjs +378 -0
  159. package/esm2022/lib/region-overlay/region-style.mjs +97 -0
  160. package/esm2022/lib/region-overlay/svg-region-renderer.mjs +228 -0
  161. package/esm2022/lib/region-source/http-region-source.mjs +104 -0
  162. package/esm2022/lib/region-source/region-source-ops.mjs +53 -0
  163. package/esm2022/lib/region-source/region-source-worker.mjs +10 -0
  164. package/esm2022/lib/region-source/region-source.mjs +67 -0
  165. package/esm2022/lib/region-source/region-tiles.mjs +708 -0
  166. package/esm2022/lib/region-source/worker-region-source.mjs +229 -0
  167. package/esm2022/lib/render-orchestrator.mjs +14 -11
  168. package/esm2022/lib/render-session.mjs +207 -0
  169. package/esm2022/lib/routing-visualizer.service.mjs +858 -414
  170. package/esm2022/lib/section-pane/section-pane.component.mjs +299 -0
  171. package/esm2022/lib/spatial/density-raster.mjs +14 -0
  172. package/esm2022/lib/spatial/embedding-compute-coordinator.mjs +239 -0
  173. package/esm2022/lib/spatial/embedding-compute.mjs +43 -10
  174. package/esm2022/lib/spatial/gene-search.mjs +1 -1
  175. package/esm2022/lib/spatial/glyphs.mjs +97 -0
  176. package/esm2022/lib/spatial/lod.mjs +187 -0
  177. package/esm2022/lib/spatial/spatial-controls.facade.mjs +200 -0
  178. package/esm2022/lib/spatial/spatial-density.mjs +25 -16
  179. package/esm2022/lib/spatial/spatial-encoding.mjs +26 -82
  180. package/esm2022/lib/spatial/spatial-expression.mjs +43 -42
  181. package/esm2022/lib/spatial/spatial-framing.mjs +1 -1
  182. package/esm2022/lib/spatial/spatial-heatmap.mjs +6 -3
  183. package/esm2022/lib/spatial/spatial-hover.mjs +5 -33
  184. package/esm2022/lib/spatial/spatial-panel-model.mjs +282 -0
  185. package/esm2022/lib/spatial/spatial-sections.mjs +1 -1
  186. package/esm2022/lib/spatial/spatial-selection.mjs +33 -46
  187. package/esm2022/lib/spatial/spatial-tile-merge.mjs +219 -0
  188. package/esm2022/lib/spatial/spatial-tiles.mjs +12 -648
  189. package/esm2022/lib/spatial/spatial-volume-image.mjs +2 -4
  190. package/esm2022/lib/spatial/stats.mjs +71 -0
  191. package/esm2022/lib/spatial/transcript-grouping.mjs +307 -0
  192. package/esm2022/lib/spatial-controls/spatial-cells-panel/spatial-cells-panel.component.mjs +150 -0
  193. package/esm2022/lib/spatial-controls/spatial-charts/chart-data-model.mjs +309 -0
  194. package/esm2022/lib/spatial-controls/spatial-charts/chart-help.mjs +145 -0
  195. package/esm2022/lib/spatial-controls/spatial-charts/plotly-chart-host.mjs +158 -0
  196. package/esm2022/lib/spatial-controls/spatial-charts/spatial-chart-window/spatial-chart-window.component.mjs +47 -0
  197. package/esm2022/lib/spatial-controls/spatial-charts/spatial-charts.component.mjs +297 -802
  198. package/esm2022/lib/spatial-controls/spatial-charts/spatial-embedding-controls/spatial-embedding-controls.component.mjs +89 -0
  199. package/esm2022/lib/spatial-controls/spatial-charts/spatial-heatmap-controls/spatial-heatmap-controls.component.mjs +52 -0
  200. package/esm2022/lib/spatial-controls/spatial-controls.component.mjs +143 -1238
  201. package/esm2022/lib/spatial-controls/spatial-gene-picker.mjs +153 -0
  202. package/esm2022/lib/spatial-controls/spatial-gene-tree/spatial-gene-tree.component.mjs +241 -0
  203. package/esm2022/lib/spatial-controls/spatial-groups-panel/spatial-groups-panel.component.mjs +193 -0
  204. package/esm2022/lib/spatial-controls/spatial-key/spatial-key.component.mjs +132 -0
  205. package/esm2022/lib/spatial-controls/spatial-key/spatial-key.model.mjs +67 -0
  206. package/esm2022/lib/spatial-controls/spatial-marker-genes-form/spatial-marker-genes-form.component.mjs +147 -0
  207. package/esm2022/lib/spatial-controls/spatial-observations-panel/spatial-observations-panel.component.mjs +300 -0
  208. package/esm2022/lib/spatial-controls/spatial-transcripts-panel/spatial-transcripts-panel.component.mjs +370 -0
  209. package/esm2022/lib/store/class-color.util.mjs +53 -5
  210. package/esm2022/lib/store/class-signatures.mjs +63 -0
  211. package/esm2022/lib/store/region-history.mjs +146 -0
  212. package/esm2022/lib/store/region-scope-cache.mjs +144 -0
  213. package/esm2022/lib/store/region-selection.mjs +82 -0
  214. package/esm2022/lib/store/region-source-scope.mjs +171 -0
  215. package/esm2022/lib/store/region-store.service.mjs +986 -670
  216. package/esm2022/lib/store/spatial-selection.service.mjs +2 -2
  217. package/esm2022/lib/store/visualizer-store.service.mjs +81 -76
  218. package/esm2022/lib/toast-outlets.mjs +5 -4
  219. package/esm2022/lib/toolbar/brush/brush-tool.service.mjs +92 -434
  220. package/esm2022/lib/toolbar/canvas-tools.mjs +20 -0
  221. package/esm2022/lib/toolbar/crop/slide-crop.mjs +26 -42
  222. package/esm2022/lib/toolbar/plot-type-selector/plot-type-selector.component.mjs +85 -0
  223. package/esm2022/lib/toolbar/region-tools/region-tool-buttons.mjs +74 -0
  224. package/esm2022/lib/toolbar/region-tools/region-tools.component.mjs +120 -0
  225. package/esm2022/lib/toolbar/segmentation/cell-segment-tool.service.mjs +74 -78
  226. package/esm2022/lib/toolbar/segmentation/cellpose-segmenter.service.mjs +50 -8
  227. package/esm2022/lib/toolbar/segmentation/onnx-sam-session.mjs +61 -42
  228. package/esm2022/lib/toolbar/segmentation/pending-calls.mjs +47 -0
  229. package/esm2022/lib/toolbar/segmentation/sam-model-registry.mjs +12 -4
  230. package/esm2022/lib/toolbar/segmentation/sam-onnx-core.mjs +70 -14
  231. package/esm2022/lib/toolbar/segmentation/sam-point-tool.service.mjs +135 -172
  232. package/esm2022/lib/toolbar/segmentation/sam-prompt.mjs +9 -90
  233. package/esm2022/lib/toolbar/segmentation/sam-session.service.mjs +183 -0
  234. package/esm2022/lib/toolbar/segmentation/sam-tool.service.mjs +95 -150
  235. package/esm2022/lib/toolbar/segmentation/segmentation-commit.mjs +12 -0
  236. package/esm2022/lib/toolbar/segmentation/segmentation-runner.mjs +108 -0
  237. package/esm2022/lib/toolbar/segmentation-tools/segmentation-tools.component.mjs +155 -0
  238. package/esm2022/lib/toolbar/stack-controls/stack-controls.component.mjs +121 -0
  239. package/esm2022/lib/toolbar/tool-kit/async-tool-status.mjs +37 -0
  240. package/esm2022/lib/toolbar/tool-kit/canvas-tool-manager.mjs +63 -0
  241. package/esm2022/lib/toolbar/tool-kit/canvas-tool.mjs +2 -0
  242. package/esm2022/lib/toolbar/tool-kit/frame-pixels.mjs +108 -0
  243. package/esm2022/lib/toolbar/tool-kit/mask-stroke-editor.mjs +306 -0
  244. package/esm2022/lib/toolbar/tool-kit/matrix-frame.mjs +61 -0
  245. package/esm2022/lib/toolbar/tool-kit/tool-overlay.mjs +140 -0
  246. package/esm2022/lib/toolbar/tool-kit/undo-gesture.mjs +24 -0
  247. package/esm2022/lib/toolbar/tool-slider/tool-slider.component.mjs +63 -0
  248. package/esm2022/lib/toolbar/toolbar-help-dialog/toolbar-help-dialog.component.mjs +50 -0
  249. package/esm2022/lib/toolbar/toolbar.component.mjs +84 -119
  250. package/esm2022/lib/toolbar/vertex-eraser/vertex-eraser-tool.service.mjs +93 -115
  251. package/esm2022/lib/toolbar/view-controls/view-controls.component.mjs +107 -0
  252. package/esm2022/lib/toolbar/wand/wand-region-grow.mjs +321 -0
  253. package/esm2022/lib/toolbar/wand/wand-tool.service.mjs +121 -416
  254. package/esm2022/lib/toolbar/wand/wand.service.mjs +30 -894
  255. package/esm2022/lib/toolbar/zoom-to-box/zoom-to-box-tool.service.mjs +48 -90
  256. package/esm2022/lib/util/mark-for-check.mjs +17 -0
  257. package/esm2022/lib/util/supersede.mjs +56 -0
  258. package/esm2022/lib/visualization.module.mjs +39 -141
  259. package/esm2022/lib/visualizer/floating-drag.directive.mjs +58 -0
  260. package/esm2022/lib/visualizer/region-actions.mjs +149 -0
  261. package/esm2022/lib/visualizer/region-load.mjs +123 -0
  262. package/esm2022/lib/visualizer/spatial-dataset-binder.mjs +163 -0
  263. package/esm2022/lib/visualizer/tool-modes.mjs +113 -0
  264. package/esm2022/lib/visualizer/viewer-shortcuts.mjs +167 -0
  265. package/esm2022/lib/visualizer/visualizer-context-menu.mjs +119 -0
  266. package/esm2022/lib/visualizer/volume-sections.mjs +175 -0
  267. package/esm2022/lib/visualizer.component.mjs +602 -1902
  268. package/esm2022/lib/workers/spatial-math-ops.mjs +43 -0
  269. package/esm2022/lib/workers/spatial-math-worker.mjs +10 -0
  270. package/esm2022/lib/workers/spatial-math.mjs +190 -0
  271. package/fesm2022/jax-data-science-sci-image-visualizer-jax-data-science-sci-image-visualizer-BKQhpbHv.mjs +47169 -0
  272. package/fesm2022/jax-data-science-sci-image-visualizer-jax-data-science-sci-image-visualizer-BKQhpbHv.mjs.map +1 -0
  273. package/fesm2022/jax-data-science-sci-image-visualizer-onnx-sam-session-z1IN-F7w.mjs +238 -0
  274. package/fesm2022/jax-data-science-sci-image-visualizer-onnx-sam-session-z1IN-F7w.mjs.map +1 -0
  275. package/fesm2022/jax-data-science-sci-image-visualizer-region-source-worker-CAqBjM5L.mjs +12 -0
  276. package/fesm2022/jax-data-science-sci-image-visualizer-region-source-worker-CAqBjM5L.mjs.map +1 -0
  277. package/fesm2022/jax-data-science-sci-image-visualizer-spatial-math-worker-BzVFFqGS.mjs +12 -0
  278. package/fesm2022/jax-data-science-sci-image-visualizer-spatial-math-worker-BzVFFqGS.mjs.map +1 -0
  279. package/fesm2022/jax-data-science-sci-image-visualizer.mjs +41 -34467
  280. package/fesm2022/jax-data-science-sci-image-visualizer.mjs.map +1 -1
  281. package/fesm2022/mask.worker.js +36 -917
  282. package/fesm2022/onnx-sam.worker.js +52 -16
  283. package/fesm2022/region-source.worker.js +1067 -0
  284. package/fesm2022/spatial-math.worker.js +471 -0
  285. package/fesm2022/tsne.worker.js +32 -15
  286. package/index.d.ts +19 -10
  287. package/lib/channel-histogram/channel-histogram.component.d.ts +53 -43
  288. package/lib/contracts/capabilities.contract.d.ts +4 -2
  289. package/lib/contracts/cell-segmenter.contract.d.ts +1 -0
  290. package/lib/contracts/channel-histogram-api.contract.d.ts +4 -0
  291. package/lib/contracts/color.d.ts +27 -0
  292. package/lib/contracts/colormap-lut.d.ts +19 -4
  293. package/lib/contracts/coordinate-transform.contract.d.ts +3 -3
  294. package/lib/contracts/display-types.d.ts +21 -0
  295. package/lib/contracts/image.contract.d.ts +4 -0
  296. package/lib/contracts/instance-segmenter.contract.d.ts +5 -0
  297. package/lib/contracts/intensity.d.ts +13 -2
  298. package/lib/contracts/plot-type.d.ts +3 -1
  299. package/lib/contracts/ports/image-state.port.d.ts +6 -2
  300. package/lib/contracts/ports/preferences.port.d.ts +4 -0
  301. package/lib/contracts/ports/region-io.port.d.ts +1 -0
  302. package/lib/contracts/ports/spatial-data.port.d.ts +4 -10
  303. package/lib/contracts/ports/tile-access.port.d.ts +1 -0
  304. package/lib/contracts/region-editor-api.contract.d.ts +85 -1
  305. package/lib/contracts/region-overlay.contract.d.ts +5 -0
  306. package/lib/contracts/region-store.contract.d.ts +22 -0
  307. package/lib/contracts/sam.contract.d.ts +7 -0
  308. package/lib/contracts/section-view.contract.d.ts +44 -0
  309. package/lib/contracts/semantic-segmenter.contract.d.ts +6 -0
  310. package/lib/contracts/spatial-dataset.contract.d.ts +19 -6
  311. package/lib/contracts/toolbar-tool.contract.d.ts +1 -0
  312. package/lib/contracts/visualizer.contract.d.ts +231 -54
  313. package/lib/contracts/viz-config.d.ts +9 -0
  314. package/lib/geometry/contour.d.ts +24 -0
  315. package/lib/geometry/loft.d.ts +22 -0
  316. package/lib/geometry/polylabel.d.ts +23 -0
  317. package/lib/geometry/raster.d.ts +42 -0
  318. package/lib/geometry/reconstruct.d.ts +54 -0
  319. package/lib/geometry/reslice-image.d.ts +33 -0
  320. package/lib/geometry/ring.d.ts +67 -0
  321. package/lib/geometry/section.d.ts +52 -0
  322. package/lib/hex-color-picker/hex-color-picker.component.d.ts +61 -27
  323. package/lib/implementations/base-store-visualizer.d.ts +61 -15
  324. package/lib/implementations/napari-js/napari-axes-gizmo.d.ts +36 -0
  325. package/lib/implementations/napari-js/napari-display-state.d.ts +76 -0
  326. package/lib/implementations/napari-js/napari-helpers.d.ts +129 -0
  327. package/lib/implementations/napari-js/napari-image-2d-scene.d.ts +162 -0
  328. package/lib/implementations/napari-js/napari-loading-badge.d.ts +4 -3
  329. package/lib/implementations/napari-js/napari-loading-state.d.ts +37 -0
  330. package/lib/implementations/napari-js/napari-region-mesh-pointer.d.ts +32 -0
  331. package/lib/implementations/napari-js/napari-region-overlay.d.ts +68 -71
  332. package/lib/implementations/napari-js/napari-scene.d.ts +126 -0
  333. package/lib/implementations/napari-js/napari-spatial-2d-scene.d.ts +163 -0
  334. package/lib/implementations/napari-js/napari-spatial-3d-scene.d.ts +212 -0
  335. package/lib/implementations/napari-js/napari-spatial-encoding.d.ts +114 -0
  336. package/lib/implementations/napari-js/napari-spatial-hover.d.ts +91 -0
  337. package/lib/implementations/napari-js/napari-spatial-scene.d.ts +118 -0
  338. package/lib/implementations/napari-js/napari-spatial-tiles.d.ts +56 -263
  339. package/lib/implementations/napari-js/napari-spatial-tooltip.d.ts +1 -1
  340. package/lib/implementations/napari-js/napari-surface-scene.d.ts +76 -0
  341. package/lib/implementations/napari-js/napari-tile-client.d.ts +214 -0
  342. package/lib/implementations/napari-js/napari-tool-bridge.d.ts +179 -0
  343. package/lib/implementations/napari-js/napari-visualizer.service.d.ts +169 -883
  344. package/lib/implementations/napari-js/napari-volume-region-meshes.d.ts +66 -0
  345. package/lib/implementations/napari-js/napari-volume-scene.d.ts +148 -0
  346. package/lib/implementations/napari-js/napari-volume-slice-planes.d.ts +43 -0
  347. package/lib/implementations/napari-js/napari-volume-z-handle.d.ts +8 -12
  348. package/lib/implementations/napari-js/region-overlay/overlay-projection.d.ts +59 -0
  349. package/lib/implementations/napari-js/region-overlay/region-edit.d.ts +15 -0
  350. package/lib/implementations/napari-js/region-overlay/region-svg-renderer.d.ts +54 -0
  351. package/lib/implementations/napari-js/spatial-tiles/categorical-lookup.d.ts +26 -0
  352. package/lib/implementations/napari-js/spatial-tiles/cell-layers.d.ts +70 -0
  353. package/lib/implementations/napari-js/spatial-tiles/density-layer.d.ts +61 -0
  354. package/lib/implementations/napari-js/spatial-tiles/layer-groups.d.ts +67 -0
  355. package/lib/implementations/napari-js/spatial-tiles/plan-context.d.ts +38 -0
  356. package/lib/implementations/napari-js/spatial-tiles/transcript-hover.d.ts +71 -0
  357. package/lib/implementations/napari-js/spatial-tiles/transcript-jobs.d.ts +105 -0
  358. package/lib/implementations/napari-js/spatial-tiles/transcript-layers.d.ts +56 -0
  359. package/lib/implementations/osd/display-pipeline.d.ts +38 -9
  360. package/lib/implementations/osd/histogram-sampler.d.ts +22 -12
  361. package/lib/implementations/osd/openseadragon-viewer-options.d.ts +35 -0
  362. package/lib/implementations/osd/openseadragon-visualizer.service.d.ts +78 -354
  363. package/lib/implementations/osd/osd-coordinate-transform.d.ts +2 -1
  364. package/lib/implementations/osd/osd-coords.d.ts +6 -4
  365. package/lib/implementations/osd/osd-export.d.ts +36 -0
  366. package/lib/implementations/osd/osd-lib.d.ts +7 -0
  367. package/lib/implementations/osd/osd-navigator-chrome.d.ts +69 -0
  368. package/lib/implementations/osd/osd-pixel-readback.d.ts +22 -0
  369. package/lib/implementations/osd/osd-region-overlay-draw.d.ts +38 -0
  370. package/lib/implementations/osd/osd-region-overlay.d.ts +46 -51
  371. package/lib/implementations/osd/osd-scale-bar.d.ts +8 -6
  372. package/lib/implementations/osd/osd-tile-source.d.ts +49 -0
  373. package/lib/implementations/osd/osd-viewer-like.d.ts +100 -0
  374. package/lib/implementations/osd/osd-viewer-mount.d.ts +14 -0
  375. package/lib/implementations/osd/osd-viewport.d.ts +77 -0
  376. package/lib/implementations/osd/osd-zoom.d.ts +6 -0
  377. package/lib/implementations/osd/simple-source.d.ts +161 -0
  378. package/lib/implementations/osd/slice-cache.d.ts +12 -3
  379. package/lib/implementations/osd/tile-client.d.ts +11 -14
  380. package/lib/implementations/osd/tile-recolor.d.ts +141 -0
  381. package/lib/implementations/plotly/omics-trace-builders.d.ts +32 -20
  382. package/lib/implementations/plotly/plotly-image-loader.d.ts +49 -0
  383. package/lib/implementations/plotly/plotly-image-recolor.d.ts +75 -0
  384. package/lib/implementations/plotly/plotly-intensity-inset.d.ts +8 -0
  385. package/lib/implementations/plotly/plotly-isosurface-controls.d.ts +38 -0
  386. package/lib/implementations/plotly/plotly-layouts.d.ts +188 -0
  387. package/lib/implementations/plotly/plotly-readback.d.ts +41 -0
  388. package/lib/implementations/plotly/plotly-region-overlay.d.ts +2 -2
  389. package/lib/implementations/plotly/plotly-shape-projection.d.ts +92 -0
  390. package/lib/implementations/plotly/plotly-trace-builders.d.ts +23 -12
  391. package/lib/implementations/plotly/plotly-zoom-controller.d.ts +86 -0
  392. package/lib/implementations/plotly/plotly.service.d.ts +136 -401
  393. package/lib/implementations/region-centroids.d.ts +14 -0
  394. package/lib/implementations/simple-slice-access.service.d.ts +7 -4
  395. package/lib/implementations/spatial-data-http/spatial-data-http.service.d.ts +42 -18
  396. package/lib/implementations/spatial-data-http/spatial-wire.d.ts +34 -9
  397. package/lib/implementations/tile-server/index.d.ts +5 -0
  398. package/lib/implementations/tile-server/native-histogram.d.ts +25 -0
  399. package/lib/implementations/tile-server/poll-descriptor.d.ts +39 -0
  400. package/lib/implementations/tile-server/tile-protocol.d.ts +83 -0
  401. package/lib/implementations/tile-server/transport.d.ts +62 -0
  402. package/lib/intensity/intensity-profile.d.ts +66 -0
  403. package/lib/intensity/intensity-profile.service.d.ts +108 -0
  404. package/lib/intensity-inset/intensity-inset.component.d.ts +58 -0
  405. package/lib/models/bezier.d.ts +0 -5
  406. package/lib/models/class-preset.d.ts +25 -0
  407. package/lib/models/geometry.d.ts +14 -48
  408. package/lib/models/polygon-edit.d.ts +72 -0
  409. package/lib/models/polygon-factory.d.ts +45 -0
  410. package/lib/models/region-clone.d.ts +20 -0
  411. package/lib/models/region-geojson.d.ts +57 -0
  412. package/lib/models/region.d.ts +59 -4
  413. package/lib/models/shape.d.ts +8 -0
  414. package/lib/plot-mode/contribution-host.d.ts +125 -0
  415. package/lib/plot-mode/plot-type-menu.d.ts +60 -0
  416. package/lib/plot-mode/tool-params-model.d.ts +49 -0
  417. package/lib/plot.utilities.d.ts +19 -30
  418. package/lib/processing/processing-image.d.ts +5 -2
  419. package/lib/provide-visualization.d.ts +19 -2
  420. package/lib/region-editor/class-tree/class-tree.component.d.ts +78 -0
  421. package/lib/region-editor/class-tree/class-tree.d.ts +31 -0
  422. package/lib/region-editor/classes-panel/classes-panel.component.d.ts +86 -0
  423. package/lib/region-editor/file-stem.d.ts +7 -0
  424. package/lib/region-editor/manage-classes-dialog/manage-classes-dialog.component.d.ts +45 -0
  425. package/lib/region-editor/mask-export.service.d.ts +54 -0
  426. package/lib/region-editor/mask-raster.d.ts +2 -8
  427. package/lib/region-editor/region-color-dialog/region-color-dialog.component.d.ts +29 -0
  428. package/lib/region-editor/region-editor-help/region-editor-help.component.d.ts +11 -0
  429. package/lib/region-editor/region-editor.component.d.ts +283 -200
  430. package/lib/region-editor/region-metrics.d.ts +34 -0
  431. package/lib/region-editor/region-persistence.service.d.ts +77 -0
  432. package/lib/region-editor/region-table/region-table.component.d.ts +89 -0
  433. package/lib/region-editor/save-mask-dialog/save-mask-dialog.component.d.ts +36 -0
  434. package/lib/region-editor/save-regions-dialog/save-regions-dialog.component.d.ts +37 -0
  435. package/lib/region-ops.service.d.ts +1 -7
  436. package/lib/region-overlay/region-geometry.d.ts +158 -0
  437. package/lib/region-overlay/region-hit-test.d.ts +38 -0
  438. package/lib/region-overlay/region-source-layer.d.ts +96 -0
  439. package/lib/region-overlay/region-style.d.ts +52 -0
  440. package/lib/region-overlay/svg-region-renderer.d.ts +110 -0
  441. package/lib/region-source/http-region-source.d.ts +45 -0
  442. package/lib/region-source/region-source-ops.d.ts +89 -0
  443. package/lib/region-source/region-source-worker.d.ts +7 -0
  444. package/lib/region-source/region-source.d.ts +82 -0
  445. package/lib/region-source/region-tiles.d.ts +289 -0
  446. package/lib/region-source/worker-region-source.d.ts +65 -0
  447. package/lib/render-orchestrator.d.ts +6 -2
  448. package/lib/render-session.d.ts +75 -0
  449. package/lib/routing-visualizer.service.d.ts +248 -59
  450. package/lib/section-pane/section-pane.component.d.ts +47 -0
  451. package/lib/spatial/density-raster.d.ts +6 -0
  452. package/lib/spatial/embedding-compute-coordinator.d.ts +123 -0
  453. package/lib/spatial/embedding-compute.d.ts +21 -2
  454. package/lib/spatial/glyphs.d.ts +16 -0
  455. package/lib/spatial/lod.d.ts +94 -0
  456. package/lib/spatial/spatial-controls.facade.d.ts +64 -0
  457. package/lib/spatial/spatial-density.d.ts +15 -5
  458. package/lib/spatial/spatial-encoding.d.ts +11 -44
  459. package/lib/spatial/spatial-expression.d.ts +40 -22
  460. package/lib/spatial/spatial-framing.d.ts +1 -0
  461. package/lib/spatial/spatial-heatmap.d.ts +2 -0
  462. package/lib/spatial/spatial-hover.d.ts +4 -16
  463. package/lib/spatial/spatial-panel-model.d.ts +135 -0
  464. package/lib/spatial/spatial-selection.d.ts +21 -26
  465. package/lib/spatial/spatial-tile-merge.d.ts +41 -0
  466. package/lib/spatial/spatial-tiles.d.ts +9 -256
  467. package/lib/spatial/stats.d.ts +38 -0
  468. package/lib/spatial/transcript-grouping.d.ts +119 -0
  469. package/lib/spatial-controls/spatial-cells-panel/spatial-cells-panel.component.d.ts +64 -0
  470. package/lib/spatial-controls/spatial-charts/chart-data-model.d.ts +153 -0
  471. package/lib/spatial-controls/spatial-charts/chart-help.d.ts +69 -0
  472. package/lib/spatial-controls/spatial-charts/plotly-chart-host.d.ts +98 -0
  473. package/lib/spatial-controls/spatial-charts/spatial-chart-window/spatial-chart-window.component.d.ts +26 -0
  474. package/lib/spatial-controls/spatial-charts/spatial-charts.component.d.ts +101 -260
  475. package/lib/spatial-controls/spatial-charts/spatial-embedding-controls/spatial-embedding-controls.component.d.ts +43 -0
  476. package/lib/spatial-controls/spatial-charts/spatial-heatmap-controls/spatial-heatmap-controls.component.d.ts +27 -0
  477. package/lib/spatial-controls/spatial-controls.component.d.ts +68 -448
  478. package/lib/spatial-controls/spatial-gene-picker.d.ts +86 -0
  479. package/lib/spatial-controls/spatial-gene-tree/spatial-gene-tree.component.d.ts +102 -0
  480. package/lib/spatial-controls/spatial-groups-panel/spatial-groups-panel.component.d.ts +72 -0
  481. package/lib/spatial-controls/spatial-key/spatial-key.component.d.ts +66 -0
  482. package/lib/spatial-controls/spatial-key/spatial-key.model.d.ts +33 -0
  483. package/lib/spatial-controls/spatial-marker-genes-form/spatial-marker-genes-form.component.d.ts +64 -0
  484. package/lib/spatial-controls/spatial-observations-panel/spatial-observations-panel.component.d.ts +117 -0
  485. package/lib/spatial-controls/spatial-transcripts-panel/spatial-transcripts-panel.component.d.ts +142 -0
  486. package/lib/store/class-color.util.d.ts +39 -2
  487. package/lib/store/class-signatures.d.ts +11 -0
  488. package/lib/store/region-history.d.ts +66 -0
  489. package/lib/store/region-scope-cache.d.ts +65 -0
  490. package/lib/store/region-selection.d.ts +36 -0
  491. package/lib/store/region-source-scope.d.ts +68 -0
  492. package/lib/store/region-store.service.d.ts +312 -116
  493. package/lib/store/visualizer-store.service.d.ts +32 -33
  494. package/lib/toast-outlets.d.ts +4 -3
  495. package/lib/toolbar/brush/brush-tool.service.d.ts +31 -98
  496. package/lib/toolbar/canvas-tools.d.ts +20 -0
  497. package/lib/toolbar/crop/slide-crop.d.ts +10 -4
  498. package/lib/toolbar/plot-type-selector/plot-type-selector.component.d.ts +38 -0
  499. package/lib/toolbar/region-tools/region-tool-buttons.d.ts +21 -0
  500. package/lib/toolbar/region-tools/region-tools.component.d.ts +62 -0
  501. package/lib/toolbar/segmentation/cell-segment-tool.service.d.ts +10 -14
  502. package/lib/toolbar/segmentation/cellpose-segmenter.service.d.ts +12 -2
  503. package/lib/toolbar/segmentation/onnx-sam-session.d.ts +22 -3
  504. package/lib/toolbar/segmentation/pending-calls.d.ts +31 -0
  505. package/lib/toolbar/segmentation/sam-model-registry.d.ts +9 -3
  506. package/lib/toolbar/segmentation/sam-onnx-core.d.ts +18 -5
  507. package/lib/toolbar/segmentation/sam-point-tool.service.d.ts +46 -32
  508. package/lib/toolbar/segmentation/sam-prompt.d.ts +7 -31
  509. package/lib/toolbar/segmentation/sam-session.service.d.ts +74 -0
  510. package/lib/toolbar/segmentation/sam-tool.service.d.ts +23 -30
  511. package/lib/toolbar/segmentation/segmentation-commit.d.ts +8 -0
  512. package/lib/toolbar/segmentation/segmentation-runner.d.ts +52 -0
  513. package/lib/toolbar/segmentation-tools/segmentation-tools.component.d.ts +87 -0
  514. package/lib/toolbar/stack-controls/stack-controls.component.d.ts +51 -0
  515. package/lib/toolbar/tool-kit/async-tool-status.d.ts +21 -0
  516. package/lib/toolbar/tool-kit/canvas-tool-manager.d.ts +36 -0
  517. package/lib/toolbar/tool-kit/canvas-tool.d.ts +86 -0
  518. package/lib/toolbar/tool-kit/frame-pixels.d.ts +45 -0
  519. package/lib/toolbar/tool-kit/mask-stroke-editor.d.ts +125 -0
  520. package/lib/toolbar/tool-kit/matrix-frame.d.ts +40 -0
  521. package/lib/toolbar/tool-kit/tool-overlay.d.ts +60 -0
  522. package/lib/toolbar/tool-kit/undo-gesture.d.ts +17 -0
  523. package/lib/toolbar/tool-slider/tool-slider.component.d.ts +33 -0
  524. package/lib/toolbar/toolbar-help-dialog/toolbar-help-dialog.component.d.ts +24 -0
  525. package/lib/toolbar/toolbar.component.d.ts +55 -84
  526. package/lib/toolbar/vertex-eraser/vertex-eraser-tool.service.d.ts +33 -40
  527. package/lib/toolbar/view-controls/view-controls.component.d.ts +54 -0
  528. package/lib/toolbar/wand/wand-region-grow.d.ts +49 -0
  529. package/lib/toolbar/wand/wand-tool.service.d.ts +39 -124
  530. package/lib/toolbar/wand/wand.service.d.ts +22 -116
  531. package/lib/toolbar/zoom-to-box/zoom-to-box-tool.service.d.ts +17 -37
  532. package/lib/util/mark-for-check.d.ts +11 -0
  533. package/lib/util/supersede.d.ts +53 -0
  534. package/lib/visualization.module.d.ts +18 -39
  535. package/lib/visualizer/floating-drag.directive.d.ts +30 -0
  536. package/lib/visualizer/region-actions.d.ts +54 -0
  537. package/lib/visualizer/region-load.d.ts +46 -0
  538. package/lib/visualizer/spatial-dataset-binder.d.ts +74 -0
  539. package/lib/visualizer/tool-modes.d.ts +49 -0
  540. package/lib/visualizer/viewer-shortcuts.d.ts +71 -0
  541. package/lib/visualizer/visualizer-context-menu.d.ts +55 -0
  542. package/lib/visualizer/volume-sections.d.ts +64 -0
  543. package/lib/visualizer.component.d.ts +232 -447
  544. package/lib/workers/spatial-math-ops.d.ts +65 -0
  545. package/lib/workers/spatial-math-worker.d.ts +7 -0
  546. package/lib/workers/spatial-math.d.ts +74 -0
  547. package/package.json +12 -3
  548. package/src/lib/assets/slice.svg +23 -0
  549. package/src/lib/styles/_viz-icons-rules.scss +73 -0
  550. package/src/lib/styles/viz-icons.scss +14 -0
  551. package/esm2022/lib/implementations/napari-js/napari-axes-labels.mjs +0 -97
  552. package/esm2022/lib/implementations/napari-js/napari-navigator.mjs +0 -195
  553. package/esm2022/lib/implementations/napari-js/napari-scale-bar.mjs +0 -92
  554. package/fesm2022/jax-data-science-sci-image-visualizer-onnx-sam-session-BwP-A11m.mjs +0 -329
  555. package/fesm2022/jax-data-science-sci-image-visualizer-onnx-sam-session-BwP-A11m.mjs.map +0 -1
  556. package/lib/implementations/napari-js/napari-axes-labels.d.ts +0 -49
  557. package/lib/implementations/napari-js/napari-navigator.d.ts +0 -72
  558. package/lib/implementations/napari-js/napari-scale-bar.d.ts +0 -35
  559. package/src/lib/assets/cell-detection.svg +0 -37
  560. package/src/lib/assets/click.svg +0 -1
  561. package/src/lib/assets/colormap-luts.json +0 -1
  562. package/src/lib/assets/edit-selection-white.svg +0 -47
  563. package/src/lib/assets/icons/colormap-earth.png +0 -0
  564. package/src/lib/assets/icons/colormap-placeholder.png +0 -0
  565. package/src/lib/assets/icons/colormap-pubu.png +0 -0
  566. package/src/lib/assets/interactive-segmentation-cursor.svg +0 -1
  567. package/src/lib/assets/picture-segmentation.svg +0 -43
  568. package/src/lib/assets/test/download-379.svg +0 -1
  569. package/src/lib/assets/test/download-98.svg +0 -1
  570. package/src/lib/assets/test/json-1.svg +0 -1
  571. package/src/lib/assets/test/load-53.svg +0 -1
  572. package/src/lib/assets/test/mask-44.svg +0 -1
  573. package/src/lib/assets/test/mask-download-44.svg +0 -15
  574. package/src/lib/assets/test/mask-save-44.svg +0 -11
  575. package/src/lib/assets/test/overlay-1.svg +0 -1
  576. package/src/lib/assets/test/overlay-4.svg +0 -1
  577. package/src/lib/assets/test/region-26.svg +0 -1
  578. package/src/lib/assets/test/save-56.svg +0 -1
  579. 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 { Polygon, Rectangle, Region } from '../../models/region';
4
- import { IImageInfo, IImageMetadata } from '../../contracts/image.contract';
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 { ShapeSelection } from '../../models/shape';
10
- import { WandService, WandOptions } from '../../toolbar/wand/wand.service';
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 { IVisualizer, IntensityProfile, IIsosurfaceControls, IIntensityControls } from '../../contracts/visualizer.contract';
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 IVisualizer {
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 vertexEraserTool;
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's stub advertises only
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
- private shapes;
53
- private previousShapes;
54
- private isRegionSavedOn;
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 when zoomed (so the intensity profile samples the
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
- private stackLoading$;
95
- private stackLoadingProgress$;
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
- /** Bright, well-separated colours cycled as the user adds profile-line ROIs.
99
- * The matching inset trace is drawn in the same colour. */
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
- private wandHost;
127
- private eraserHost;
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, wandTool: WandToolService, brushTool: BrushToolService, samTool: SamToolService, samPointTool: SamPointToolService, cellSegmentTool: CellSegmentToolService, cellSegmenter: ICellSegmenter | null, vertexEraserTool: VertexEraserToolService, zoomToBoxTool: ZoomToBoxToolService, store: VisualizerStore, regionStore: RegionStore);
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 image
138
- * @param imageInfo
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
- * @param inPlace when true, updates the existing plot via Plotly.react
158
- * instead of Plotly.purge + Plotly.newPlot. Used by the multi-tier
159
- * diagram swap (small → large) so the canvas doesn't briefly blank
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
- * Function used to plot an RGB heatmap
187
- * @param plotDiv
188
- * @param urls
189
- * @param images
190
- * @param trueImgSize
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 plotRGBHeatmap;
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
- /** Min/max intensity over every voxel of the loaded frames (RGB → luminance),
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
- * Render the floating intensity-profile inset chart into `divId` — one line
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
- * Region shapes (filtered/redrawn for the current file). The profile-line ROIs
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 intensity-profile line as a neutral Region
258
- * (tagged `kind: 'profile'`). It is a horizontal open 2-point polyline spanning
259
- * the image width, staggered vertically so successive lines stay distinct, in
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
- * Supply pixel frames for intensity sampling (used by the OSD/image backend,
277
- * whose cached frames may be empty). Optionally also sets the data/pixel ratios.
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
- * Populate the sampling cache for the intensity profiles when OpenSeadragon is
282
- * the active backend (the Image plot type). In OSD mode Plotly never rendered,
283
- * so `cachedImageFrames`/`trueImgSize` are unset — fetch the current slice's
284
- * preview (the same pixels the heatmap would sample) so the line ROIs have
285
- * pixel data and a placement extent. Re-emits the profiles once loaded.
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
- setWandMode(active: boolean, options?: WandOptions): void;
329
- setWandOptions(options: WandOptions): void;
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
- * Make the shared store authoritative for the current dict working-set: convert
368
- * `this.shapes` to neutral regions and replace the store's list (the store
369
- * mints ids, applies class colours, syncs its per-image cache and emits the
370
- * region-update event). Store-minted ids are written back onto the dicts so the
371
- * two representations stay aligned. Profile-line ROIs are ordinary regions
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
- applyShapesChange(): void;
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
- private triggerZoom;
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. Called from `plot()` and from the router
409
- * before any backend renders.
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
- /** Test/dev hook — drop the entire per-image cache (logout / project switch). */
413
- clearRegionsByImageKey(): void;
414
- /**
415
- * Get all the selected regions as polygons. Open polylines (closed === false)
416
- * are excluded — they're annotation-only and cannot be used as filled regions
417
- * for image processing. Delegates to the shared store.
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
- width: number;
488
- height: number;
489
- channels: number;
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
- getColormapOptions(): any;
538
- setColormap(colormap: any): void;
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. No-op when no Plotly plot is mounted (OSD owns the div). */
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
- importRegions(geoJsonStr: string): Region[];
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, null, null, { optional: true; }, 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
  }