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