@jax-data-science/sci-image-visualizer 0.3.1 → 0.3.3

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.
@@ -141,3 +141,23 @@ export type Bounds = Rectangle | Polygon | {
141
141
  xpoints?: number[];
142
142
  ypoints?: number[];
143
143
  };
144
+ /**
145
+ * Rebuild a plain-object `bounds` as the class instance the renderers expect
146
+ * (jit-ui#124).
147
+ *
148
+ * Regions that arrive as JSON — a host's server response, a `structuredClone`,
149
+ * anything that has been through `JSON.parse` — carry a `bounds` that has the
150
+ * right *fields* but not the right *prototype*. The renderers disagree about
151
+ * whether that is acceptable: `Region.getShape()` (Plotly) and the napari
152
+ * overlay duck-type the bounds, while the OpenSeadragon overlay discriminates
153
+ * with `bounds instanceof Rectangle`. So a JSON region drew in Heatmap mode and
154
+ * silently vanished in Image mode. `instanceof` also gates the store's own
155
+ * geometry de-duplication, `moveRegion`, and the GeoJSON export — a JSON region
156
+ * is undraggable and absent from a save in *every* mode.
157
+ *
158
+ * Rather than duck-type ~20 call sites, the store normalizes here on the way in,
159
+ * so everything downstream can keep relying on `instanceof`. Values that are
160
+ * already instances are returned **by reference**, untouched: overlays and tools
161
+ * hold onto the bounds they created and mutate them in place during a drag.
162
+ */
163
+ export declare function hydrateBounds(bounds: any): Rectangle | Polygon | MultiPolygon | null | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jax-data-science/sci-image-visualizer",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "Browser-based scientific image visualization for Angular — gigapixel whole-slide (OpenSeadragon), 2D/3D (Plotly) and WebGPU (napari-js) rendering, with region/annotation editing and in-browser SAM segmentation.",
5
5
  "keywords": [
6
6
  "angular",
@@ -34,9 +34,9 @@
34
34
  "access": "public"
35
35
  },
36
36
  "dependencies": {
37
- "cellpose-js": "^0.5.0",
37
+ "cellpose-js": "^0.6.0",
38
38
  "fast-png": "^6.4.0",
39
- "napari-js": "^0.11.0",
39
+ "napari-js": "^0.11.1",
40
40
  "openseadragon": "^6.0.2",
41
41
  "plotly.js-dist-min": "^3.0.1",
42
42
  "tslib": "^2.3.0"