@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
@@ -0,0 +1,44 @@
1
+ /**
2
+ * The sections shown beside a split volume view: the planes x = const and y = const through the
3
+ * stack, each as an image cut from the volume with the regions' outlines cut by the same plane.
4
+ *
5
+ * Section coordinates `(u, v)` (see `geometry/section`): through x, u is the slice (slice k spans
6
+ * [k, k + 1)) and v the image y; through y, u is the image x and v the slice.
7
+ */
8
+ export type SectionAxis = 'x' | 'y';
9
+ /** A class's outlines in a section, as interleaved `u, v`. */
10
+ export interface SectionRegions {
11
+ label: string;
12
+ /** `#rrggbb`. */
13
+ color: string;
14
+ /** Closed outlines, holes included (even-odd). */
15
+ rings: Float64Array[];
16
+ /** Open lines (a layer boundary across the slices); one point where it crosses one slice only. */
17
+ lines: Float64Array[];
18
+ }
19
+ export interface SectionView {
20
+ axis: SectionAxis;
21
+ /** Where the plane is: image x (through x) or y (through y), px. */
22
+ at: number;
23
+ /** The section's image, RGBA row by row, spanning [0, size[0]] × [0, size[1]]. */
24
+ image: {
25
+ width: number;
26
+ height: number;
27
+ data: Uint8ClampedArray;
28
+ };
29
+ /** Section units across (u) and down (v). */
30
+ size: [number, number];
31
+ /** The volume's world units per section unit across and down: draws it in its proportions. */
32
+ scale: [number, number];
33
+ regions: SectionRegions[];
34
+ /** The other two planes, across (a u) and down (a v); null where there is none. */
35
+ crosshair: {
36
+ u: number | null;
37
+ v: number | null;
38
+ };
39
+ }
40
+ /** Both sections; null until the split volume view has a volume to cut. */
41
+ export interface SectionViews {
42
+ x: SectionView | null;
43
+ y: SectionView | null;
44
+ }
@@ -25,6 +25,10 @@ export interface SemanticRegion {
25
25
  /** Area in pixels, holes already subtracted. */
26
26
  area: number;
27
27
  }
28
+ /**
29
+ * The result of one {@link ISemanticSegmenter} run: the class layers found, in the pixel
30
+ * frame of the `width × height` image that was segmented.
31
+ */
28
32
  export interface SemanticSegmentation {
29
33
  regions: SemanticRegion[];
30
34
  /** Total pixels assigned to each class, indexed by class id. */
@@ -43,6 +47,7 @@ export interface SemanticSegmentation {
43
47
  */
44
48
  unassignedFraction: number;
45
49
  }
50
+ /** Options for one {@link ISemanticSegmenter} run. */
46
51
  export interface SemanticSegmentOptions {
47
52
  /** Which registered model to run. Defaults to the registry's default. */
48
53
  modelId?: string;
@@ -90,6 +95,7 @@ export interface SemanticSegmentProgress {
90
95
  /** Human-readable phase, e.g. 'Segmenting patch 3/8…'. */
91
96
  onStatus?: (status: string) => void;
92
97
  }
98
+ /** A segmenter that assigns every pixel a class and returns the class regions. */
93
99
  export interface ISemanticSegmenter {
94
100
  /** Assign every pixel a class and return the resulting regions. */
95
101
  segmentSemantic(image: {
@@ -99,6 +99,7 @@ export interface ContinuousColumnMeta extends SpatialColumnMetaBase {
99
99
  min?: number;
100
100
  max?: number;
101
101
  }
102
+ /** Descriptor of one per-observation column, discriminated by `kind`. */
102
103
  export type SpatialColumnMeta = CategoricalColumnMeta | ContinuousColumnMeta;
103
104
  /**
104
105
  * Code meaning "this observation has no category" (unassigned / filtered out /
@@ -120,8 +121,11 @@ export interface ContinuousColumn {
120
121
  /** Length = {@link SpatialObservations.count}. */
121
122
  values: Float32Array;
122
123
  }
124
+ /** A loaded column with its values, discriminated by `meta.kind`. */
123
125
  export type SpatialColumn = CategoricalColumn | ContinuousColumn;
126
+ /** Narrow a loaded column to a categorical one. */
124
127
  export declare function isCategoricalColumn(c: SpatialColumn): c is CategoricalColumn;
128
+ /** Narrow a loaded column to a continuous one. */
125
129
  export declare function isContinuousColumn(c: SpatialColumn): c is ContinuousColumn;
126
130
  /**
127
131
  * The feature (gene) matrix, described but never delivered whole. Vectors come
@@ -182,11 +186,6 @@ export interface SpatialImageRef {
182
186
  mppX?: number;
183
187
  mppY?: number;
184
188
  }
185
- /**
186
- * A spatial-omics dataset: everything cheap enough to hold resident. Column and
187
- * feature *values*, and polygon *geometry*, are fetched through
188
- * {@link SpatialDataPort} as they are displayed.
189
- */
190
189
  /**
191
190
  * A precomputed low-dimensional embedding over the SAME observations — UMAP, t-SNE, PCA.
192
191
  *
@@ -370,7 +369,6 @@ export interface SpatialTranscriptTile {
370
369
  /** Index into the `genes` list the tile was requested with. */
371
370
  gene: Uint16Array;
372
371
  }
373
- /** Transcript totals for an estimate of how many markers a selection would draw. */
374
372
  /** The per-gene levels: each level's bin and tile size, on the all-gene pyramid's grid. */
375
373
  export interface SpatialTranscriptGeneBinsMeta {
376
374
  origin: [number, number];
@@ -399,6 +397,7 @@ export interface SpatialMarkerGenes {
399
397
  }[];
400
398
  }[];
401
399
  }
400
+ /** Transcript totals for an estimate of how many markers a selection would draw. */
402
401
  export interface SpatialTranscriptCounts {
403
402
  /** Total transcripts per requested gene, over the whole dataset. */
404
403
  counts: Record<string, number>;
@@ -413,6 +412,11 @@ export interface SpatialDensityRaster {
413
412
  genes: string[];
414
413
  values: Float32Array;
415
414
  }
415
+ /**
416
+ * A spatial-omics dataset: everything cheap enough to hold resident. Column and
417
+ * feature *values*, and polygon *geometry*, are fetched through
418
+ * {@link SpatialDataPort} as they are displayed.
419
+ */
416
420
  export interface SpatialDataset {
417
421
  /** Stable id — the key the port's lazy accessors are scoped to. */
418
422
  id: string;
@@ -473,6 +477,15 @@ export interface SpatialVolumeMeta {
473
477
  /** World size of one voxel per axis, in the observations' units. */
474
478
  voxelSize: [number, number, number];
475
479
  }
480
+ /**
481
+ * A selection over a dataset's N observations: `mask[i] === 1` when observation `i` is
482
+ * selected, and `count` the number selected. Pure data, so it lives with the dataset
483
+ * contract; the selection logic that builds one is in `spatial/spatial-selection.ts`.
484
+ */
485
+ export interface SpatialSelectionMask {
486
+ mask: Uint8Array;
487
+ count: number;
488
+ }
476
489
  /** Look a column's descriptor up by name. */
477
490
  export declare function findColumnMeta(dataset: SpatialDataset, name: string): SpatialColumnMeta | undefined;
478
491
  export {};
@@ -88,6 +88,7 @@ export interface SelectParamSpec {
88
88
  }[];
89
89
  tooltip?: string;
90
90
  }
91
+ /** One parameter a dialog tool asks for, discriminated by `type`. */
91
92
  export type ToolParamSpec = NumberParamSpec | BooleanParamSpec | SelectParamSpec;
92
93
  /** One selectable checkpoint. */
93
94
  export interface ToolModelOption {
@@ -1,15 +1,15 @@
1
1
  import { InjectionToken } from '@angular/core';
2
+ import type { SectionAxis, SectionViews } from './section-view.contract';
2
3
  import { Observable } from 'rxjs';
3
4
  import { Image } from 'image-js';
4
5
  import { IImageInfo, IImageMetadata } from './image.contract';
5
- import { Region } from '../models/region';
6
+ import { Polygon, Region } from '../models/region';
6
7
  import { PlotType, PlotTypeDescriptor } from './plot-type';
7
8
  import { ViewerCapabilities } from './capabilities.contract';
8
9
  import { IRegionOverlay } from './region-overlay.contract';
9
10
  import { IHistogram } from './channel-histogram-api.contract';
10
- import { ColormapNode, IWandOptions, IBrushOptions, SpatialViewState, SpatialColorBy } from './display-types';
11
- import { CategoricalColumnMeta, SpatialDataset, SpatialEmbedding, SpatialMarkerGenes, SpatialTranscriptCounts } from './spatial-dataset.contract';
12
- import { SpatialSelectionMask } from '../spatial/spatial-selection';
11
+ import { CanvasToolOptions, ColormapNode, IWandOptions, IBrushOptions, SpatialViewState, SpatialColorBy } from './display-types';
12
+ import { CategoricalColumnMeta, SpatialDataset, SpatialEmbedding, SpatialMarkerGenes, SpatialSelectionMask, SpatialTranscriptCounts } from './spatial-dataset.contract';
13
13
  import type { PlotModeViewport } from './plot-type-contribution.contract';
14
14
  /**
15
15
  * Backend-neutral visualization contract. Plotly is one implementation;
@@ -19,10 +19,6 @@ import type { PlotModeViewport } from './plot-type-contribution.contract';
19
19
  *
20
20
  * Split into role interfaces so a consumer can depend only on the slice it
21
21
  * uses, then composed into `IVisualizer`.
22
- *
23
- * Types are intentionally permissive (`any` where the current Plotly service
24
- * is untyped) so `PlotlyService` satisfies the contract without a typing
25
- * rewrite — tightening is a follow-up, not part of standing the interface up.
26
22
  */
27
23
  /** Pixel readback shape returned by `getDisplayedPixelData`. */
28
24
  export interface PixelData {
@@ -45,37 +41,51 @@ export interface IntensityProfile {
45
41
  /** Colour of the line ROI — the inset trace is drawn in the same colour. */
46
42
  color?: string;
47
43
  }
44
+ /**
45
+ * What `IDataRenderer.load()` resolves to. Backend-specific beyond `filename`,
46
+ * which names the image the handle was loaded for: the host compares it with the
47
+ * image it asked for, to drop a handle a newer request has overtaken. Pass the
48
+ * handle on to `plot()` unchanged.
49
+ */
50
+ export interface LoadedImage {
51
+ readonly filename: string | undefined;
52
+ }
48
53
  /**
49
54
  * The render/viewport role: load data, render it (image or plot), and handle
50
55
  * zoom, stack navigation, and pixel readback.
51
56
  */
52
57
  export interface IDataRenderer {
53
- load(imageInfo: IImageInfo, zIndex: number): Promise<any>;
54
- /** `imageLoaded` is the backend-specific handle returned by `load()` —
55
- * treat it as opaque and pass it straight through. */
58
+ /** Fetch what {@link plot} needs for this image/slice. `signal` aborts when the
59
+ * host no longer wants the result (a newer image, Cancel, teardown); a backend
60
+ * may stop its network work then. Optional, and ignored by backends that do
61
+ * not support it yet. */
62
+ load(imageInfo: IImageInfo, zIndex: number, signal?: AbortSignal): Promise<LoadedImage>;
63
+ /** `imageLoaded` is the {@link LoadedImage} handle returned by `load()` (or null
64
+ * for a draw with no image) — pass it straight through. Resolves false when the
65
+ * backend could not draw (no plot target, no WebGPU, …). */
56
66
  plot(plotDiv: string, imageLoaded: unknown, imageInfo: IImageInfo, screenHeight: number, plotType: PlotType, inPlace?: boolean): Promise<boolean>;
57
67
  /** @deprecated Plotly-specific re-render; the OSD backend no-ops it. The host
58
68
  * re-drives `plot()` from its image stream instead. */
59
69
  reloadAndPlot(): void;
60
70
  reset(): void;
61
71
  relayout(trueImageSize?: number[]): void;
62
- /** @deprecated Plotly-specific (axis reset); the OSD backend no-ops it. Gate
63
- * on {@link ViewerCapabilities} before calling. */
72
+ /**
73
+ * Fit the whole image (or scene) into the view — every backend does: Plotly
74
+ * autoranges its axes, OpenSeadragon goes home, napari-js fits its camera. The
75
+ * backend then emits on {@link getAutoscaleEvent}.
76
+ */
77
+ fitToView(): void;
78
+ /** Reset the view to the image extent. Same intent as {@link fitToView}; kept for
79
+ * callers of the original name. */
64
80
  resetAxes(): void;
65
- /** @deprecated Plotly-specific (autoscale); the OSD backend no-ops it. Gate
66
- * on {@link ViewerCapabilities} before calling. */
81
+ /** @deprecated Use {@link fitToView} — the same operation under its backend-neutral name. */
67
82
  autoscale(): void;
68
83
  zoomIn(): void;
69
84
  zoomOut(): void;
70
85
  setDragMode(mode: string | false): void;
71
- /** Show/hide the overview navigator (the minimap). OpenSeadragon only — Plotly
72
- * no-ops it (it has no navigator). Applied when the viewer is (re)created, and
73
- * toggled live when one is already mounted. */
86
+ /** @deprecated Use `getOsdViewOptions().setNavigatorVisible()` on `IVisualizer`. */
74
87
  setNavigatorVisible(visible: boolean): void;
75
- /** Image smoothing (bilinear interpolation). `false` = nearest-neighbour, so
76
- * zooming past 1:1 shows crisp pixel blocks (pixel-level inspection).
77
- * OpenSeadragon only — Plotly no-ops it. Applied at viewer creation and live
78
- * (with a redraw) when one is mounted. */
88
+ /** @deprecated Use `getOsdViewOptions().setImageSmoothingEnabled()` on `IVisualizer`. */
79
89
  setImageSmoothingEnabled(enabled: boolean): void;
80
90
  setShowStack(showstack: boolean): void;
81
91
  setZIndex(zIndex: number): void;
@@ -113,17 +123,17 @@ export interface IDataRenderer {
113
123
  } | null;
114
124
  downloadImage(): void;
115
125
  setPlotType(plotType: PlotType): void;
116
- /** Set the napari 3D decimate factor (1 = full … 8 = ⅛). Optional — only the napari-js WebGPU
117
- * backend honors it; changing it re-loads the current 3D plot at the coarser/finer sampling. */
126
+ /** @deprecated Use `getVolumeResolution()?.set()` on `IVisualizer`. */
118
127
  setResolutionScale?(scale: number): void;
119
- /** The current napari 3D decimate factor (to initialize the Resolution control). Optional. */
128
+ /** @deprecated Use `getVolumeResolution()?.get()` on `IVisualizer` (this returns 1 without one). */
120
129
  getResolutionScale?(): number;
121
- /** @deprecated Use `getSurface3dControls()` — 3D scene controls only exist on
122
- * a backend that renders 3D plot types; this method silently no-ops on OSD. */
130
+ /** @deprecated Use `getSurface3dControls()?.setSurfaceDragMode()` — 3D scene controls
131
+ * only exist on a backend that renders 3D plot types; this silently no-ops on OSD. */
123
132
  setSurfaceDragMode(mode: string): void;
124
133
  /** @deprecated Use `getSurface3dControls()` — see {@link setSurfaceDragMode}. */
125
134
  resetSurfaceCamera(): void;
126
- getAutoscaleEvent(): Observable<any>;
135
+ /** Emits whenever the backend fits the view ({@link fitToView}). */
136
+ getAutoscaleEvent(): Observable<unknown>;
127
137
  /** Plot types this backend advertises (drives the UI selector). */
128
138
  getPlotTypeDescriptors(): PlotTypeDescriptor[];
129
139
  /** Intensity along the line ROIs; emits the full set as any line is added,
@@ -139,8 +149,10 @@ export interface IRegionStore {
139
149
  setRegions(regions: Region[], showRegionLabel?: boolean, isRegionSaveOn?: boolean, fillColor?: string, append?: boolean): void;
140
150
  /** Framework-neutral accessor — the canonical way to read current regions. */
141
151
  getRegions(): Region[];
142
- getRegionPolygons(): any[];
143
- getRegionUpdateEvent(): Observable<any[]>;
152
+ /** The current regions as polygons (rectangles expanded), for server requests. */
153
+ getRegionPolygons(): Polygon[];
154
+ /** Emits the region set whenever it changes. */
155
+ getRegionUpdateEvent(): Observable<Region[]>;
144
156
  setSelectedShapeIndices(indices: number[]): void;
145
157
  getSelectedShapeIndices$(): Observable<number[]>;
146
158
  /** Select a specific region (by identity), highlighting it on whichever
@@ -153,9 +165,6 @@ export interface IRegionStore {
153
165
  getFillColor(): string;
154
166
  getClassificationColors(): Map<string, string>;
155
167
  setClassificationColor(label: string, color: string): void;
156
- plotPreviousShapes(): void;
157
- setPreviousShapes(shapes: any[]): void;
158
- getPreviousShapes(): any[];
159
168
  /** Undo the most recent region action (jit-ui#85). Restores the region set to
160
169
  * the state before that action; up to a small fixed depth (10) is retained,
161
170
  * so it can be invoked up to 10 times in a row. No-op when nothing is left to
@@ -203,16 +212,29 @@ export interface IRegionStore {
203
212
  * Keyed by zero-based slice index; regions tagged with their z. */
204
213
  getStackSaveSlices(): Map<number, Region[]>;
205
214
  }
206
- /** On-canvas tool modes (wand, brush, vertex eraser, zoom-to-box). */
215
+ /** On-canvas tool modes (wand, brush, vertex eraser, zoom-to-box, SAM point). */
207
216
  export interface IToolController {
217
+ /**
218
+ * Arm one on-canvas tool (`CanvasToolId`) with its options — the wand's
219
+ * {@link IWandOptions}, the brush's {@link IBrushOptions} (`size` is the
220
+ * matrix-pixel diameter of the painted disc), the eraser's `{ radius }` —
221
+ * and disarm the one that was armed. `null`, or any id that is not a canvas
222
+ * tool (a region draw mode such as `'drawrect'`, `'pan'`), disarms only.
223
+ * Arming the armed tool again applies the options and keeps its work in
224
+ * progress.
225
+ */
226
+ setActiveTool(id: string | null, options?: CanvasToolOptions): void;
227
+ /** @deprecated Use `setActiveTool('wand', options)` / `setActiveTool(null)`. */
208
228
  setWandMode(active: boolean, options?: IWandOptions): void;
209
229
  setWandOptions(options: IWandOptions): void;
210
230
  clearActiveWandRegion(): void;
211
- /** Brush region tool. `size` (matrix-pixel diameter) sizes the painted disc. */
231
+ /** @deprecated Use `setActiveTool('brush', options)` / `setActiveTool(null)`. */
212
232
  setBrushMode(active: boolean, options?: IBrushOptions): void;
213
233
  setBrushOptions(options: IBrushOptions): void;
234
+ /** @deprecated Use `setActiveTool('eraseVertex', { radius })` / `setActiveTool(null)`. */
214
235
  setVertexEraserMode(active: boolean): void;
215
236
  setVertexEraserRadius(radius: number): void;
237
+ /** @deprecated Use `setActiveTool('zoomToBox')` / `setActiveTool(null)`. */
216
238
  setZoomToBoxMode(active: boolean): void;
217
239
  /** Box-prompted SAM segmentation: segment every rectangle region into masks.
218
240
  * Returns the number of mask regions added. (jit-ui#90) */
@@ -222,7 +244,8 @@ export interface IToolController {
222
244
  segmentRectanglesCellpose(): Promise<number>;
223
245
  /** Choose the registered SAM model the segment tools use (jit-ui#90 P1). */
224
246
  setSamModel(id: string): void;
225
- /** Toggle the interactive SAM point-prompt tool (click = +point, Shift = -). */
247
+ /** Toggle the interactive SAM point-prompt tool (click = +point, Shift = -).
248
+ * @deprecated Use `setActiveTool('samPoint')` / `setActiveTool(null)`. */
226
249
  setSamPointMode(active: boolean): void;
227
250
  /** Finalise / discard the in-progress SAM point object. */
228
251
  commitSamPoints(): void;
@@ -398,28 +421,19 @@ export interface IDisplayOptions {
398
421
  setColormap(colormap: ColormapNode): void;
399
422
  getColormapOptions(): ColormapNode[];
400
423
  getReverseScale(): Observable<boolean>;
401
- setReverseScale(reverscale: any): void;
402
- setImageMeta(imageMeta: IImageMetadata[]): void;
424
+ setReverseScale(reverse: boolean): void;
425
+ /** Publish the current image's metadata. `imageKey` (its file name) lets the
426
+ * channel state survive a re-plot of the same image but not a switch to another. */
427
+ setImageMeta(imageMeta: IImageMetadata[], imageKey?: string): void;
403
428
  getImageMeta(): Observable<IImageMetadata[]>;
404
429
  }
405
430
  /**
406
- * Intensity-profile sampling (PlotType.LINE). The sampling *source* lives in the
407
- * Plotly backend (it owns pixel readback); OpenSeadragon contributes only the
408
- * viewport-change signal that drives re-sampling at the current zoom. Each
409
- * backend implements the part it owns and no-ops the rest — mirroring the
410
- * deprecated no-op pattern on {@link IDataRenderer} — so the contract is uniform
411
- * and a consumer can depend on `IVisualizer` alone (no concrete-type reach-in).
431
+ * The part of intensity sampling a rendering backend owns: where its view settled.
432
+ * What `IViewerBackend.getIntensitySampling()` returns.
412
433
  */
413
- export interface IIntensitySampling {
414
- /** Populate the intensity-sampling cache for the current image/slice so the
415
- * line-ROI profiles have pixel data. Real on Plotly; no-op on OSD. */
416
- ensureIntensitySampling(imageInfo: IImageInfo, zIndex: number): Promise<void>;
417
- /** Re-sample the profiles from a fresh crop of the given image-pixel ROI at
418
- * display resolution. Real on Plotly; no-op on OSD. */
419
- refreshIntensitySamplingForRoi(x: number, y: number, width: number, height: number, zIndex: number): void;
434
+ export interface IIntensityViewportSource {
420
435
  /** Visible-region changes (image-pixel coords), emitted when the view settles,
421
- * so the inset can re-sample at the current zoom. Real on OSD; empty on Plotly
422
- * (its high-def zoom updates the sampling cache inline instead). */
436
+ * so the inset can re-sample at the current zoom. */
423
437
  getViewportChange$(): Observable<{
424
438
  x: number;
425
439
  y: number;
@@ -427,12 +441,65 @@ export interface IIntensitySampling {
427
441
  height: number;
428
442
  }>;
429
443
  }
430
- /** Composite contract a visualization backend implements. */
444
+ /**
445
+ * Intensity-profile sampling (the line ROIs' inset), from `IVisualizer.getIntensitySampling()`.
446
+ * The sampling itself is backend-neutral (the library's IntensityProfileService
447
+ * samples whatever image is on screen); the viewport-change signal comes from the
448
+ * backend that draws the image (OpenSeadragon and napari-js report it; Plotly
449
+ * re-samples its high-def zoom crops inline instead).
450
+ */
451
+ export interface IIntensitySampling extends IIntensityViewportSource {
452
+ /** Load the current image/slice's pixels so the line-ROI profiles have data
453
+ * (a backend with no frames of its own: OpenSeadragon, napari-js). */
454
+ ensureIntensitySampling(imageInfo: IImageInfo, zIndex: number): Promise<void>;
455
+ /** Re-sample the profiles from a fresh crop of the given image-pixel ROI at
456
+ * display resolution. */
457
+ refreshIntensitySamplingForRoi(x: number, y: number, width: number, height: number, zIndex: number): void;
458
+ }
459
+ /**
460
+ * The 2D view options of a tiled image viewer: the overview navigator and image
461
+ * smoothing. OpenSeadragon's, mirrored by napari-js's 2D views; Plotly has neither.
462
+ * Capability-gated: `IViewerBackend.getOsdViewOptions()` is null on a backend
463
+ * without them.
464
+ */
465
+ export interface IOsdViewOptions {
466
+ /** Show/hide the overview navigator (the minimap). Applied when the viewer is
467
+ * (re)created, and toggled live when one is already mounted. */
468
+ setNavigatorVisible(visible: boolean): void;
469
+ /** Image smoothing (bilinear interpolation). `false` = nearest-neighbour, so
470
+ * zooming past 1:1 shows crisp pixel blocks (pixel-level inspection). Applied
471
+ * at viewer creation and live (with a redraw) when one is mounted. */
472
+ setImageSmoothingEnabled(enabled: boolean): void;
473
+ }
474
+ /**
475
+ * The 3D decimate factor of a volume renderer (napari-js WebGPU): 1 = full
476
+ * resolution … 8 = ⅛ per axis. Capability-gated: null on a backend without one.
477
+ */
478
+ export interface IVolumeResolution {
479
+ /** The current factor (to initialize the Resolution control). */
480
+ get(): number;
481
+ /** Set the factor (rounded, at least 1). Takes effect on the next (re)load —
482
+ * the host re-plots after calling it, since it changes the fetched data. */
483
+ set(scale: number): void;
484
+ }
485
+ /**
486
+ * The host-facing composite contract, implemented by the router (`VISUALIZER`). A
487
+ * rendering backend implements {@link IViewerBackend} instead.
488
+ */
431
489
  export interface IVisualizer extends IDataRenderer, IRegionStore, IToolController, IDisplayOptions, IIntensitySampling {
432
490
  readonly capabilities: ViewerCapabilities;
433
491
  /** This backend's region renderer. May be null until a plot is mounted
434
492
  * (OpenSeadragon). Drives region draw/select modes uniformly. */
435
493
  getRegionOverlay(): IRegionOverlay | null;
494
+ /** Split a volume view: the displayed slice, with every region tool, in the div `div` beside
495
+ * the 3D view; null closes it. Resolves whether the slice shows. Optional: the router's. */
496
+ setSliceEditor?(div: string | null): Promise<boolean>;
497
+ /** The slice editor's sections through x and y (nulls while it is closed). Optional: the router's. */
498
+ getSectionViews$?(): Observable<SectionViews>;
499
+ /** Move the slice editor's section plane through `axis` to `at` (image px). */
500
+ setSectionPlane?(axis: SectionAxis, at: number): void;
501
+ /** The slice picked by dragging the z plane in the volume (the host shows it). */
502
+ getSliceDrag$?(): Observable<number>;
436
503
  /** Isosurface controls when this backend advertises `ViewerFeature.Isosurface`,
437
504
  * else null — so consumers gate on the returned object, not a no-op method. */
438
505
  getIsosurfaceControls(): IIsosurfaceControls | null;
@@ -443,6 +510,26 @@ export interface IVisualizer extends IDataRenderer, IRegionStore, IToolControlle
443
510
  * the capability-gated replacement for the deprecated top-level
444
511
  * `setSurfaceDragMode`/`resetSurfaceCamera`. */
445
512
  getSurface3dControls(): ISurface3dControls | null;
513
+ /** The navigator / image-smoothing options. Never null on the router: a setting
514
+ * applies to every backend that has them (OpenSeadragon, napari-js), so it can
515
+ * be set before the first render and survives a backend switch. */
516
+ getOsdViewOptions(): IOsdViewOptions;
517
+ /** The 3D decimate factor of the backend on screen, or null when it has none
518
+ * (only napari-js renders volumes). */
519
+ getVolumeResolution(): IVolumeResolution | null;
520
+ /** Intensity-profile sampling, whichever backend is on screen. */
521
+ getIntensitySampling(): IIntensitySampling;
522
+ /** @deprecated Use `getIntensitySampling().ensureIntensitySampling()`. */
523
+ ensureIntensitySampling(imageInfo: IImageInfo, zIndex: number): Promise<void>;
524
+ /** @deprecated Use `getIntensitySampling().refreshIntensitySamplingForRoi()`. */
525
+ refreshIntensitySamplingForRoi(x: number, y: number, width: number, height: number, zIndex: number): void;
526
+ /** @deprecated Use `getIntensitySampling().getViewportChange$()`. */
527
+ getViewportChange$(): Observable<{
528
+ x: number;
529
+ y: number;
530
+ width: number;
531
+ height: number;
532
+ }>;
446
533
  /** Spatial-omics controls when a `SPATIAL_DATA_PORT` is bound, else null.
447
534
  * Optional: only the routing service implements it, since the state is shared
448
535
  * rather than owned by any one backend. */
@@ -464,8 +551,98 @@ export interface IVisualizer extends IDataRenderer, IRegionStore, IToolControlle
464
551
  /** Export the underlying image data as a data-preserving multi-band TIFF
465
552
  * (native bit depth). No-op on backends that can't provide it. */
466
553
  exportData(): void;
554
+ /**
555
+ * The view is going away (the `<visualizer>` is destroyed): drop what is bound to
556
+ * it — the on-screen viewer, its render loop and view subscriptions — so nothing
557
+ * outlives the view. Service-lifetime state (stores, the backends' own store
558
+ * subscriptions) is untouched, so a later view on the same chain renders normally.
559
+ */
560
+ detach(): void;
561
+ /** @deprecated Use {@link detach}, which this delegates to. */
467
562
  unsubscribe(): void;
468
563
  }
564
+ /**
565
+ * What a rendering backend implements (Plotly, OpenSeadragon, napari-js): rendering,
566
+ * the viewport, pixel readback, export, loading state and its on-canvas tools, plus
567
+ * capability-gated getters for what only some backends have.
568
+ *
569
+ * It is the backend-facing half of {@link IVisualizer}. Region and display state are
570
+ * not here: they live in the shared `RegionStore` / `VisualizerStore`, which the router
571
+ * serves to hosts directly; a backend draws them by subscribing to the stores' events.
572
+ * Hosts keep depending on `IVisualizer` (the router's composite), never on a backend.
573
+ */
574
+ export interface IViewerBackend extends IToolController {
575
+ readonly capabilities: ViewerCapabilities;
576
+ load(imageInfo: IImageInfo, zIndex: number, signal?: AbortSignal): Promise<LoadedImage>;
577
+ plot(plotDiv: string, imageLoaded: unknown, imageInfo: IImageInfo, screenHeight: number, plotType: PlotType, inPlace?: boolean): Promise<boolean>;
578
+ reset(): void;
579
+ relayout(trueImageSize?: number[]): void;
580
+ /** The view is going away: release what is bound to it. */
581
+ detach(): void;
582
+ /** Stop streaming frames (volume assembly / surface preload). Optional: only
583
+ * backends that stream a z-stack do work here. */
584
+ cancelLoading?(): void;
585
+ zoomIn(): void;
586
+ zoomOut(): void;
587
+ setDragMode(mode: string | false): void;
588
+ fitToView(): void;
589
+ /** @see IDataRenderer.resetAxes */
590
+ resetAxes(): void;
591
+ setZIndex(zIndex: number): void;
592
+ setShowStack(showstack: boolean): void;
593
+ /** Emits whenever the backend fits the view. */
594
+ getAutoscaleEvent(): Observable<unknown>;
595
+ isStackLoading(): Observable<boolean>;
596
+ getStackLoadingProgress(): Observable<number>;
597
+ getTrueImageSize(): {
598
+ width: number;
599
+ height: number;
600
+ } | null;
601
+ getCurrentImage(): Promise<Image | null>;
602
+ getDisplayedPixelData(): PixelData | null;
603
+ getDisplayedSourceRect(): {
604
+ x: number;
605
+ y: number;
606
+ width: number;
607
+ height: number;
608
+ } | null;
609
+ getHistogram(channelIndex: number, bins: number): IHistogram | null;
610
+ getHistogram$(channelIndex: number, bins: number): Observable<IHistogram | null>;
611
+ downloadImage(): void;
612
+ exportComposite(): void;
613
+ exportData(): void;
614
+ getRegionOverlay(): IRegionOverlay | null;
615
+ getIsosurfaceControls(): IIsosurfaceControls | null;
616
+ getSurface3dControls(): ISurface3dControls | null;
617
+ getIntensityControls(): IIntensityControls | null;
618
+ getPlotModeViewport?(): PlotModeViewport | null;
619
+ /** Navigator / image smoothing, or null when the backend has neither (Plotly). */
620
+ getOsdViewOptions(): IOsdViewOptions | null;
621
+ /** The 3D decimate factor, or null when the backend renders no volumes. */
622
+ getVolumeResolution(): IVolumeResolution | null;
623
+ /** Where the view settled, for the intensity inset's re-sampling; null when the
624
+ * backend re-samples on its own (Plotly's high-def zoom). The sampling itself is
625
+ * the router's (IntensityProfileService). */
626
+ getIntensitySampling(): IIntensityViewportSource | null;
627
+ }
628
+ /**
629
+ * What a mounted `<visualizer>` hands its host through
630
+ * `ImageStatePort.setDiagram()` — a small, typed surface rather than the component
631
+ * itself, whose every public member would otherwise be de-facto API. Cleared
632
+ * (`setDiagram(null)`) when the visualizer is destroyed. Hosts that can inject
633
+ * {@link VISUALIZER} / `REGION_EDITOR_API` directly need not use it at all.
634
+ */
635
+ export interface VisualizerHandle {
636
+ /** The visualizer chain this `<visualizer>` renders through. */
637
+ readonly visualizer: IVisualizer;
638
+ /** @deprecated Use {@link visualizer}. Kept for hosts that read the component's
639
+ * former `plotService` field off the registered object. */
640
+ readonly plotService: IVisualizer;
641
+ /** Whether any region (annotation or intensity line) exists on the current image. */
642
+ hasRegions(): boolean;
643
+ /** The current regions as polygons, for a server request (crop / processing). */
644
+ getRegionPolygons(): Polygon[];
645
+ }
469
646
  /**
470
647
  * DI token for the active visualization backend. Bind it (`useExisting`) to the
471
648
  * `RoutingVisualizerService`, which selects Plotly vs OpenSeadragon per plot
@@ -21,5 +21,14 @@ export interface VizConfig {
21
21
  * are unaffected.
22
22
  */
23
23
  useNapariRenderer?: boolean;
24
+ /**
25
+ * An image's ROI GeoJSON (`roiJsonStr`, or a slice's `roiJsonStrs[z]`) at least this many
26
+ * characters long loads as a tiled region source rather than as regions: drawn from the tiles
27
+ * in view at the zoom's level of detail (OpenSeadragon and napari; Plotly does not draw it),
28
+ * each feature joining the regions when it is selected or edited. Default 1 000 000; 0 makes
29
+ * every ROI file a source, `Infinity` none.
30
+ */
31
+ regionSourceMinChars?: number;
24
32
  }
33
+ /** DI token for the host's {@link VizConfig}. Required by the router. */
25
34
  export declare const VIZ_CONFIG: InjectionToken<VizConfig>;
@@ -0,0 +1,24 @@
1
+ import { Polygon } from '../models/region';
2
+ /**
3
+ * Trace EVERY 4-connected blob in `mask` (sized w*h) whose area is at least
4
+ * `minSize` pixels, returning one Polygon per blob translated via
5
+ * (originX, originY), ordered largest-first (ties in raster order). A blob's
6
+ * interior rings enclosing at least `minHoleSize` pixels become its
7
+ * {@link Polygon.holes}. An erase that cuts a region in two therefore yields
8
+ * both pieces, and a donut keeps its hole.
9
+ *
10
+ * The mask is labelled once and each blob traced inside its own bounding box
11
+ * (RT-16), so the cost is O(w·h + Σ bbox areas).
12
+ */
13
+ export declare function maskToPolygons(mask: Uint8Array, w: number, h: number, originX: number, originY: number, minSize?: number, minHoleSize?: number): Polygon[];
14
+ /**
15
+ * Trace each instance in an integer label map (0 = background) into polygons —
16
+ * used to turn a cellpose-style segmentation into region outlines. Pieces with
17
+ * area below `minSize` are skipped (and holes below it dropped); a label made of
18
+ * several blobs yields one polygon per blob. Ordered by label, then largest
19
+ * piece first. Coords are translated via originX/originY (not clamped).
20
+ *
21
+ * One labelling pass finds every label's pieces; each is traced inside its own
22
+ * bounding box (RT-16), instead of rescanning the whole map per label.
23
+ */
24
+ export declare function labelsToPolygons(labels: Uint32Array, w: number, h: number, originX: number, originY: number, minSize?: number): Polygon[];
@@ -0,0 +1,22 @@
1
+ /**
2
+ * The sheet through open polylines traced on a stack of slices (a retinal layer boundary on each
3
+ * B-scan, say): each line joined to its counterpart on the next slice that has lines by a strip of
4
+ * triangles. Slices without lines in between are bridged straight across.
5
+ *
6
+ * Pure: usable from workers.
7
+ */
8
+ import type { Mesh } from 'napari-js/geometry';
9
+ /** A class's open polylines on one slice: interleaved `x, y` image pixels. */
10
+ export interface SliceLines {
11
+ z: number;
12
+ lines: readonly ArrayLike<number>[];
13
+ }
14
+ /**
15
+ * The sheet through `slices`' lines, in image pixels (x, y) and slice indices (z: slice k's line at
16
+ * z = k). Every line is resampled at the same number of points, evenly along its length (about one
17
+ * per `step` px of the longest), so a line shared by the strips above and below it is one row of
18
+ * vertices. Lines are matched between neighbouring slices closest first, each at most once, and only
19
+ * when their boxes overlap; a line without a match ends the sheet there. Empty without two slices
20
+ * with lines.
21
+ */
22
+ export declare function loftLines(slices: readonly SliceLines[], step?: number): Mesh;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Where to put a label inside a polygon: its pole of inaccessibility, the inside point farthest
3
+ * from every edge (Garcia-Castellanos & Lombardo's grid search, as in Mapbox's polylabel). Unlike
4
+ * the centroid it is always inside, also for a U-shaped or ring-shaped region.
5
+ *
6
+ * Pure: usable from workers.
7
+ */
8
+ /** A polygon as interleaved `x, y` rings: the exterior first, then its holes. */
9
+ export type FlatRings = readonly ArrayLike<number>[];
10
+ /** The pole of inaccessibility `[x, y]` and its distance to the nearest edge. */
11
+ export interface LabelPoint {
12
+ x: number;
13
+ y: number;
14
+ /** Distance from the point to the nearest edge: how much room a label has around it. */
15
+ distance: number;
16
+ }
17
+ /**
18
+ * The pole of inaccessibility of `rings`, to within `precision` (default: 1/100 of the shorter
19
+ * side of the exterior's box, at least 0.5). Null for an exterior with fewer than three vertices.
20
+ */
21
+ export declare function polylabel(rings: FlatRings, precision?: number): LabelPoint | null;
22
+ /** Distance from (x, y) to the nearest edge of `rings`, positive inside (even-odd), negative outside. */
23
+ export declare function signedDistance(x: number, y: number, rings: FlatRings): number;