open-plant 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -1
- package/README.md +20 -2
- package/dist/assets/roi-clip-worker-DdVYCepx.js +2 -0
- package/dist/assets/roi-clip-worker-DdVYCepx.js.map +1 -0
- package/dist/index.cjs +7 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1336 -1265
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.ts +9 -9
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/react/draw-layer.d.ts +10 -1
- package/dist/types/react/draw-layer.d.ts.map +1 -1
- package/dist/types/react/wsi-viewer-canvas.d.ts +24 -3
- package/dist/types/react/wsi-viewer-canvas.d.ts.map +1 -1
- package/dist/types/wsi/point-clip-worker-client.d.ts +5 -0
- package/dist/types/wsi/point-clip-worker-client.d.ts.map +1 -1
- package/dist/types/wsi/point-clip-worker-protocol.d.ts +17 -2
- package/dist/types/wsi/point-clip-worker-protocol.d.ts.map +1 -1
- package/dist/types/wsi/point-clip.d.ts +1 -0
- package/dist/types/wsi/point-clip.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/assets/roi-clip-worker-i1SE1Dpa.js +0 -2
- package/dist/assets/roi-clip-worker-i1SE1Dpa.js.map +0 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
export { M1TileRenderer } from "./core/m1-tile-renderer";
|
|
2
2
|
export type { ViewState } from "./core/ortho-camera";
|
|
3
3
|
export type { Bounds, TileDefinition } from "./core/types";
|
|
4
|
-
export type {
|
|
4
|
+
export type { DrawBounds, DrawCoordinate, DrawIntent, DrawOverlayShape, DrawProjector, DrawRegion, DrawResult, DrawTool, PatchDrawResult, RegionLabelStyle, RegionStrokeStyle, RegionStrokeStyleResolver, RegionStyleContext, StampDrawTool, StampOptions, } from "./react/draw-layer";
|
|
5
5
|
export { closeRing, createCircle, createRectangle, DrawLayer, } from "./react/draw-layer";
|
|
6
6
|
export type { OverviewMapOptions, OverviewMapPosition } from "./react/overview-map";
|
|
7
7
|
export { OverviewMap } from "./react/overview-map";
|
|
8
8
|
export { TileViewerCanvas } from "./react/tile-viewer-canvas";
|
|
9
|
-
export type { PointClipStatsEvent, PointerWorldMoveEvent, RegionClickEvent, RegionHoverEvent, WsiViewerCanvasProps, } from "./react/wsi-viewer-canvas";
|
|
9
|
+
export type { PointClipStatsEvent, PointerWorldMoveEvent, RegionClickEvent, RegionHoverEvent, WsiCustomLayer, WsiCustomLayerContext, WsiViewerCanvasProps, } from "./react/wsi-viewer-canvas";
|
|
10
10
|
export { WsiViewerCanvas } from "./react/wsi-viewer-canvas";
|
|
11
11
|
export { DEFAULT_POINT_COLOR } from "./wsi/constants";
|
|
12
12
|
export { normalizeImageInfo, toTileUrl } from "./wsi/image-info";
|
|
13
|
+
export type { RoiCoordinate, RoiPolygon } from "./wsi/point-clip";
|
|
14
|
+
export { filterPointDataByPolygons, filterPointIndicesByPolygons } from "./wsi/point-clip";
|
|
13
15
|
export type { HybridPointClipOptions, HybridPointClipResult, } from "./wsi/point-clip-hybrid";
|
|
14
16
|
export { filterPointDataByPolygonsHybrid } from "./wsi/point-clip-hybrid";
|
|
15
|
-
export type {
|
|
16
|
-
export {
|
|
17
|
+
export type { PointClipIndexResult, PointClipMode, PointClipResult, PointClipResultMeta, } from "./wsi/point-clip-worker-client";
|
|
18
|
+
export { filterPointDataByPolygonsInWorker, filterPointIndicesByPolygonsInWorker, terminateRoiClipWorker, } from "./wsi/point-clip-worker-client";
|
|
19
|
+
export type { RoiClipWorkerDataRequest, RoiClipWorkerFailure, RoiClipWorkerIndexRequest, RoiClipWorkerIndexSuccess, RoiClipWorkerRequest, RoiClipWorkerResponse, RoiClipWorkerSuccess, } from "./wsi/point-clip-worker-protocol";
|
|
17
20
|
export type { RoiPointGroup, RoiPointGroupOptions, RoiPointGroupStats, RoiTermCount, } from "./wsi/roi-term-stats";
|
|
18
21
|
export { computeRoiPointGroups } from "./wsi/roi-term-stats";
|
|
19
|
-
export type {
|
|
20
|
-
export {
|
|
21
|
-
export type { RoiClipWorkerFailure, RoiClipWorkerRequest, RoiClipWorkerResponse, RoiClipWorkerSuccess, } from "./wsi/point-clip-worker-protocol";
|
|
22
|
+
export type { ScheduledTile, TileBounds, TileSchedulerOptions, TileSchedulerSnapshot, } from "./wsi/tile-scheduler";
|
|
23
|
+
export { TileScheduler } from "./wsi/tile-scheduler";
|
|
22
24
|
export type { TermPalette, WsiCoordinate, WsiImageSource, WsiPointData, WsiRegion, WsiRenderStats, WsiTerm, WsiViewState, } from "./wsi/types";
|
|
23
25
|
export { buildTermPalette, calcScaleLength, calcScaleResolution, clamp, hexToRgba, isSameViewState, toBearerToken, } from "./wsi/utils";
|
|
24
26
|
export type { WebGpuCapabilities } from "./wsi/webgpu";
|
|
25
27
|
export { getWebGpuCapabilities, prefilterPointsByBoundsWebGpu } from "./wsi/webgpu";
|
|
26
|
-
export type { ScheduledTile, TileBounds, TileSchedulerOptions, TileSchedulerSnapshot, } from "./wsi/tile-scheduler";
|
|
27
|
-
export { TileScheduler } from "./wsi/tile-scheduler";
|
|
28
28
|
export type { WsiTileErrorEvent, WsiTileRendererOptions, WsiTileSchedulerConfig, } from "./wsi/wsi-tile-renderer";
|
|
29
29
|
export { WsiTileRenderer } from "./wsi/wsi-tile-renderer";
|
|
30
30
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,YAAY,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC3D,YAAY,EACV,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["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ACV,oBAAoB,EACpB,aAAa,EACb,eAAe,EACf,mBAAmB,GACpB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,iCAAiC,EACjC,oCAAoC,EACpC,sBAAsB,GACvB,MAAM,gCAAgC,CAAC;AACxC,YAAY,EACV,wBAAwB,EACxB,oBAAoB,EACpB,yBAAyB,EACzB,yBAAyB,EACzB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,kCAAkC,CAAC;AAC1C,YAAY,EACV,aAAa,EACb,oBAAoB,EACpB,kBAAkB,EAClB,YAAY,GACb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,YAAY,EACV,aAAa,EACb,UAAU,EACV,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,YAAY,EACV,WAAW,EACX,aAAa,EACb,cAAc,EACd,YAAY,EACZ,SAAS,EACT,cAAc,EACd,OAAO,EACP,YAAY,GACb,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,KAAK,EACL,SAAS,EACT,eAAe,EACf,aAAa,GACd,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,6BAA6B,EAAE,MAAM,cAAc,CAAC;AACpF,YAAY,EACV,iBAAiB,EACjB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -3,12 +3,18 @@ export type StampDrawTool = "stamp-rectangle" | "stamp-circle" | "stamp-rectangl
|
|
|
3
3
|
export type DrawTool = "cursor" | "freehand" | "rectangle" | "circular" | StampDrawTool;
|
|
4
4
|
export type DrawCoordinate = [number, number];
|
|
5
5
|
export type DrawBounds = [number, number, number, number];
|
|
6
|
+
export type DrawIntent = "roi" | "patch";
|
|
6
7
|
export interface DrawResult {
|
|
7
8
|
tool: Exclude<DrawTool, "cursor">;
|
|
9
|
+
intent: DrawIntent;
|
|
8
10
|
coordinates: DrawCoordinate[];
|
|
9
11
|
bbox: DrawBounds;
|
|
10
12
|
areaPx: number;
|
|
11
13
|
}
|
|
14
|
+
export type PatchDrawResult = DrawResult & {
|
|
15
|
+
tool: "stamp-rectangle-4096px";
|
|
16
|
+
intent: "patch";
|
|
17
|
+
};
|
|
12
18
|
export interface DrawRegion {
|
|
13
19
|
id?: string | number;
|
|
14
20
|
coordinates: DrawCoordinate[];
|
|
@@ -74,13 +80,16 @@ export interface DrawLayerProps {
|
|
|
74
80
|
stampOptions?: StampOptions;
|
|
75
81
|
projectorRef: RefObject<DrawProjector | null>;
|
|
76
82
|
onDrawComplete?: (result: DrawResult) => void;
|
|
83
|
+
onPatchComplete?: (result: PatchDrawResult) => void;
|
|
77
84
|
enabled?: boolean;
|
|
78
85
|
viewStateSignal?: unknown;
|
|
79
86
|
persistedRegions?: DrawRegion[];
|
|
87
|
+
patchRegions?: DrawRegion[];
|
|
80
88
|
persistedPolygons?: DrawCoordinate[][];
|
|
81
89
|
regionStrokeStyle?: Partial<RegionStrokeStyle>;
|
|
82
90
|
regionStrokeHoverStyle?: Partial<RegionStrokeStyle>;
|
|
83
91
|
regionStrokeActiveStyle?: Partial<RegionStrokeStyle>;
|
|
92
|
+
patchStrokeStyle?: Partial<RegionStrokeStyle>;
|
|
84
93
|
resolveRegionStrokeStyle?: RegionStrokeStyleResolver;
|
|
85
94
|
overlayShapes?: DrawOverlayShape[];
|
|
86
95
|
hoveredRegionId?: string | number | null;
|
|
@@ -93,5 +102,5 @@ export interface DrawLayerProps {
|
|
|
93
102
|
export declare function closeRing(coords: DrawCoordinate[]): DrawCoordinate[];
|
|
94
103
|
export declare function createRectangle(start: DrawCoordinate | null, end: DrawCoordinate | null): DrawCoordinate[];
|
|
95
104
|
export declare function createCircle(start: DrawCoordinate | null, end: DrawCoordinate | null, sides?: number): DrawCoordinate[];
|
|
96
|
-
export declare function DrawLayer({ tool, imageWidth, imageHeight, imageMpp, imageZoom, stampOptions, projectorRef, onDrawComplete, enabled, viewStateSignal, persistedRegions, persistedPolygons, regionStrokeStyle, regionStrokeHoverStyle, regionStrokeActiveStyle, resolveRegionStrokeStyle, overlayShapes, hoveredRegionId, activeRegionId, regionLabelStyle, invalidateRef, className, style, }: DrawLayerProps): React.ReactElement;
|
|
105
|
+
export declare function DrawLayer({ tool, imageWidth, imageHeight, imageMpp, imageZoom, stampOptions, projectorRef, onDrawComplete, onPatchComplete, enabled, viewStateSignal, persistedRegions, patchRegions, persistedPolygons, regionStrokeStyle, regionStrokeHoverStyle, regionStrokeActiveStyle, patchStrokeStyle, resolveRegionStrokeStyle, overlayShapes, hoveredRegionId, activeRegionId, regionLabelStyle, invalidateRef, className, style, }: DrawLayerProps): React.ReactElement;
|
|
97
106
|
//# sourceMappingURL=draw-layer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"draw-layer.d.ts","sourceRoot":"","sources":["../../../src/react/draw-layer.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"draw-layer.d.ts","sourceRoot":"","sources":["../../../src/react/draw-layer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,gBAAgB,EAA0C,KAAK,SAAS,EAA2C,MAAM,OAAO,CAAC;AAGnK,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAAG,cAAc,GAAG,wBAAwB,GAAG,sBAAsB,GAAG,mBAAmB,GAAG,yBAAyB,CAAC;AAErK,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,WAAW,GAAG,UAAU,GAAG,aAAa,CAAC;AAExF,MAAM,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,MAA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AAS,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,cAAc,EAAE,CAapE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,EAAE,GAAG,EAAE,cAAc,GAAG,IAAI,GAAG,cAAc,EAAE,CAS1G;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,EAAE,GAAG,EAAE,cAAc,GAAG,IAAI,EAAE,KAAK,SAAe,GAAG,cAAc,EAAE,CAe7H;AAsND,wBAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,UAAU,EACV,WAAW,EACX,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,eAAe,EACf,OAAO,EACP,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,sBAAsB,EACtB,uBAAuB,EACvB,gBAAgB,EAChB,wBAAwB,EACxB,aAAa,EACb,eAAsB,EACtB,cAAqB,EACrB,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,KAAK,GACN,EAAE,cAAc,GAAG,KAAK,CAAC,YAAY,CAqjBrC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type CSSProperties } from "react";
|
|
1
|
+
import { type CSSProperties, type ReactNode } from "react";
|
|
2
2
|
import { type PointClipMode } from "../wsi/point-clip-worker-client";
|
|
3
3
|
import { type RoiPointGroupStats } from "../wsi/roi-term-stats";
|
|
4
4
|
import type { WsiImageSource, WsiPointData, WsiRegion, WsiRenderStats, WsiViewState } from "../wsi/types";
|
|
5
5
|
import { type WsiTileErrorEvent } from "../wsi/wsi-tile-renderer";
|
|
6
|
-
import type { DrawCoordinate, DrawOverlayShape, DrawResult, DrawTool, RegionLabelStyle, RegionStrokeStyle, RegionStrokeStyleResolver, StampOptions } from "./draw-layer";
|
|
6
|
+
import type { DrawCoordinate, DrawOverlayShape, DrawResult, DrawTool, PatchDrawResult, RegionLabelStyle, RegionStrokeStyle, RegionStrokeStyleResolver, StampOptions } from "./draw-layer";
|
|
7
7
|
import { type OverviewMapOptions } from "./overview-map";
|
|
8
8
|
export interface RegionHoverEvent {
|
|
9
9
|
region: WsiRegion | null;
|
|
@@ -33,6 +33,23 @@ export interface PointerWorldMoveEvent {
|
|
|
33
33
|
clientY: number;
|
|
34
34
|
insideImage: boolean;
|
|
35
35
|
}
|
|
36
|
+
export interface WsiCustomLayerContext {
|
|
37
|
+
source: WsiImageSource;
|
|
38
|
+
viewState: WsiViewState;
|
|
39
|
+
drawTool: DrawTool;
|
|
40
|
+
interactionLock: boolean;
|
|
41
|
+
worldToScreen: (worldX: number, worldY: number) => DrawCoordinate | null;
|
|
42
|
+
screenToWorld: (clientX: number, clientY: number) => DrawCoordinate | null;
|
|
43
|
+
requestRedraw: () => void;
|
|
44
|
+
}
|
|
45
|
+
export interface WsiCustomLayer {
|
|
46
|
+
id?: string | number;
|
|
47
|
+
zIndex?: number;
|
|
48
|
+
pointerEvents?: CSSProperties["pointerEvents"];
|
|
49
|
+
className?: string;
|
|
50
|
+
style?: CSSProperties;
|
|
51
|
+
render: (context: WsiCustomLayerContext) => ReactNode;
|
|
52
|
+
}
|
|
36
53
|
export interface WsiViewerCanvasProps {
|
|
37
54
|
source: WsiImageSource | null;
|
|
38
55
|
viewState?: Partial<WsiViewState> | null;
|
|
@@ -62,18 +79,22 @@ export interface WsiViewerCanvasProps {
|
|
|
62
79
|
regionStrokeStyle?: Partial<RegionStrokeStyle>;
|
|
63
80
|
regionStrokeHoverStyle?: Partial<RegionStrokeStyle>;
|
|
64
81
|
regionStrokeActiveStyle?: Partial<RegionStrokeStyle>;
|
|
82
|
+
patchStrokeStyle?: Partial<RegionStrokeStyle>;
|
|
65
83
|
resolveRegionStrokeStyle?: RegionStrokeStyleResolver;
|
|
66
84
|
overlayShapes?: DrawOverlayShape[];
|
|
85
|
+
customLayers?: WsiCustomLayer[];
|
|
86
|
+
patchRegions?: WsiRegion[];
|
|
67
87
|
regionLabelStyle?: Partial<RegionLabelStyle>;
|
|
68
88
|
onPointerWorldMove?: (event: PointerWorldMoveEvent) => void;
|
|
69
89
|
onRegionHover?: (event: RegionHoverEvent) => void;
|
|
70
90
|
onRegionClick?: (event: RegionClickEvent) => void;
|
|
71
91
|
onActiveRegionChange?: (regionId: string | number | null) => void;
|
|
72
92
|
onDrawComplete?: (result: DrawResult) => void;
|
|
93
|
+
onPatchComplete?: (result: PatchDrawResult) => void;
|
|
73
94
|
showOverviewMap?: boolean;
|
|
74
95
|
overviewMapOptions?: Partial<OverviewMapOptions>;
|
|
75
96
|
className?: string;
|
|
76
97
|
style?: CSSProperties;
|
|
77
98
|
}
|
|
78
|
-
export declare function WsiViewerCanvas({ source, viewState, onViewStateChange, onStats, onTileError, onContextLost, onContextRestored, debugOverlay, debugOverlayStyle, fitNonce, rotationResetNonce, authToken, ctrlDragRotate, pointData, pointPalette, roiRegions, roiPolygons, clipPointsToRois, clipMode, onClipStats, onRoiPointGroups, roiPaletteIndexToTermId, interactionLock, drawTool, stampOptions, regionStrokeStyle, regionStrokeHoverStyle, regionStrokeActiveStyle, resolveRegionStrokeStyle, overlayShapes, regionLabelStyle, onPointerWorldMove, onRegionHover, onRegionClick, onActiveRegionChange, onDrawComplete, showOverviewMap, overviewMapOptions, className, style, }: WsiViewerCanvasProps): React.ReactElement;
|
|
99
|
+
export declare function WsiViewerCanvas({ source, viewState, onViewStateChange, onStats, onTileError, onContextLost, onContextRestored, debugOverlay, debugOverlayStyle, fitNonce, rotationResetNonce, authToken, ctrlDragRotate, pointData, pointPalette, roiRegions, roiPolygons, clipPointsToRois, clipMode, onClipStats, onRoiPointGroups, roiPaletteIndexToTermId, interactionLock, drawTool, stampOptions, regionStrokeStyle, regionStrokeHoverStyle, regionStrokeActiveStyle, patchStrokeStyle, resolveRegionStrokeStyle, overlayShapes, customLayers, patchRegions, regionLabelStyle, onPointerWorldMove, onRegionHover, onRegionClick, onActiveRegionChange, onDrawComplete, onPatchComplete, showOverviewMap, overviewMapOptions, className, style, }: WsiViewerCanvasProps): React.ReactElement;
|
|
79
100
|
//# sourceMappingURL=wsi-viewer-canvas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wsi-viewer-canvas.d.ts","sourceRoot":"","sources":["../../../src/react/wsi-viewer-canvas.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,
|
|
1
|
+
{"version":3,"file":"wsi-viewer-canvas.d.ts","sourceRoot":"","sources":["../../../src/react/wsi-viewer-canvas.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAsC,KAAK,SAAS,EAA6F,MAAM,OAAO,CAAC;AAG1L,OAAO,EAAqC,KAAK,aAAa,EAAE,MAAM,iCAAiC,CAAC;AACxG,OAAO,EAAyB,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AACvF,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC1G,OAAO,EAAE,KAAK,iBAAiB,EAAmB,MAAM,0BAA0B,CAAC;AACnF,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,UAAU,EAAE,QAAQ,EAAE,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE1L,OAAO,EAAe,KAAK,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAUtE,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,SAAS,GAAG,IAAI,CAAC;IACzB,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,cAAc,GAAG,IAAI,CAAC;CACnC;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,SAAS,CAAC;IAClB,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;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jB,QAAY,EACZ,kBAAsB,EACtB,SAAc,EACd,cAAqB,EACrB,SAAgB,EAChB,YAAmB,EACnB,UAAU,EACV,WAAW,EACX,gBAAwB,EACxB,QAAmB,EACnB,WAAW,EACX,gBAAgB,EAChB,uBAAuB,EACvB,eAAuB,EACvB,QAAmB,EACnB,YAAY,EACZ,iBAAiB,EACjB,sBAAsB,EACtB,uBAAuB,EACvB,gBAAgB,EAChB,wBAAwB,EACxB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,oBAAoB,EACpB,cAAc,EACd,eAAe,EACf,eAAuB,EACvB,kBAAkB,EAClB,SAAS,EACT,KAAK,GACN,EAAE,oBAAoB,GAAG,KAAK,CAAC,YAAY,CA+mB3C"}
|
|
@@ -9,6 +9,11 @@ export interface PointClipResult {
|
|
|
9
9
|
data: WsiPointData | null;
|
|
10
10
|
meta: PointClipResultMeta;
|
|
11
11
|
}
|
|
12
|
+
export interface PointClipIndexResult {
|
|
13
|
+
indices: Uint32Array;
|
|
14
|
+
meta: PointClipResultMeta;
|
|
15
|
+
}
|
|
12
16
|
export declare function terminateRoiClipWorker(): void;
|
|
13
17
|
export declare function filterPointDataByPolygonsInWorker(pointData: WsiPointData | null | undefined, polygons: RoiPolygon[] | null | undefined): Promise<PointClipResult>;
|
|
18
|
+
export declare function filterPointIndicesByPolygonsInWorker(pointData: WsiPointData | null | undefined, polygons: RoiPolygon[] | null | undefined): Promise<PointClipIndexResult>;
|
|
14
19
|
//# sourceMappingURL=point-clip-worker-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"point-clip-worker-client.d.ts","sourceRoot":"","sources":["../../../src/wsi/point-clip-worker-client.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"point-clip-worker-client.d.ts","sourceRoot":"","sources":["../../../src/wsi/point-clip-worker-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2D,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAExG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,QAAQ,GAAG,eAAe,CAAC;AAEhE,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,aAAa,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,YAAY,GAAG,IAAI,CAAC;IAC1B,IAAI,EAAE,mBAAmB,CAAC;CAC3B;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,WAAW,CAAC;IACrB,IAAI,EAAE,mBAAmB,CAAC;CAC3B;AA+GD,wBAAgB,sBAAsB,IAAI,IAAI,CAU7C;AAED,wBAAsB,iCAAiC,CAAC,SAAS,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAAC,eAAe,CAAC,CAmCvK;AAED,wBAAsB,oCAAoC,CAAC,SAAS,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAiC/K"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RoiPolygon } from "./point-clip";
|
|
2
|
-
export interface
|
|
2
|
+
export interface RoiClipWorkerDataRequest {
|
|
3
3
|
type: "roi-clip-request";
|
|
4
4
|
id: number;
|
|
5
5
|
count: number;
|
|
@@ -7,6 +7,13 @@ export interface RoiClipWorkerRequest {
|
|
|
7
7
|
paletteIndices: ArrayBuffer;
|
|
8
8
|
polygons: RoiPolygon[];
|
|
9
9
|
}
|
|
10
|
+
export interface RoiClipWorkerIndexRequest {
|
|
11
|
+
type: "roi-clip-index-request";
|
|
12
|
+
id: number;
|
|
13
|
+
count: number;
|
|
14
|
+
positions: ArrayBuffer;
|
|
15
|
+
polygons: RoiPolygon[];
|
|
16
|
+
}
|
|
10
17
|
export interface RoiClipWorkerSuccess {
|
|
11
18
|
type: "roi-clip-success";
|
|
12
19
|
id: number;
|
|
@@ -15,10 +22,18 @@ export interface RoiClipWorkerSuccess {
|
|
|
15
22
|
paletteIndices: ArrayBuffer;
|
|
16
23
|
durationMs: number;
|
|
17
24
|
}
|
|
25
|
+
export interface RoiClipWorkerIndexSuccess {
|
|
26
|
+
type: "roi-clip-index-success";
|
|
27
|
+
id: number;
|
|
28
|
+
count: number;
|
|
29
|
+
indices: ArrayBuffer;
|
|
30
|
+
durationMs: number;
|
|
31
|
+
}
|
|
18
32
|
export interface RoiClipWorkerFailure {
|
|
19
33
|
type: "roi-clip-failure";
|
|
20
34
|
id: number;
|
|
21
35
|
error: string;
|
|
22
36
|
}
|
|
23
|
-
export type
|
|
37
|
+
export type RoiClipWorkerRequest = RoiClipWorkerDataRequest | RoiClipWorkerIndexRequest;
|
|
38
|
+
export type RoiClipWorkerResponse = RoiClipWorkerSuccess | RoiClipWorkerIndexSuccess | RoiClipWorkerFailure;
|
|
24
39
|
//# sourceMappingURL=point-clip-worker-protocol.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"point-clip-worker-protocol.d.ts","sourceRoot":"","sources":["../../../src/wsi/point-clip-worker-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"point-clip-worker-protocol.d.ts","sourceRoot":"","sources":["../../../src/wsi/point-clip-worker-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,kBAAkB,CAAC;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,WAAW,CAAC;IACvB,cAAc,EAAE,WAAW,CAAC;IAC5B,QAAQ,EAAE,UAAU,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,wBAAwB,CAAC;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,WAAW,CAAC;IACvB,QAAQ,EAAE,UAAU,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,kBAAkB,CAAC;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,WAAW,CAAC;IACvB,cAAc,EAAE,WAAW,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,wBAAwB,CAAC;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,WAAW,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,kBAAkB,CAAC;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,oBAAoB,GAAG,wBAAwB,GAAG,yBAAyB,CAAC;AACxF,MAAM,MAAM,qBAAqB,GAC7B,oBAAoB,GACpB,yBAAyB,GACzB,oBAAoB,CAAC"}
|
|
@@ -2,4 +2,5 @@ import type { WsiPointData } from "./types";
|
|
|
2
2
|
export type RoiCoordinate = [number, number];
|
|
3
3
|
export type RoiPolygon = RoiCoordinate[];
|
|
4
4
|
export declare function filterPointDataByPolygons(pointData: WsiPointData | null | undefined, polygons: RoiPolygon[] | null | undefined): WsiPointData | null;
|
|
5
|
+
export declare function filterPointIndicesByPolygons(pointData: WsiPointData | null | undefined, polygons: RoiPolygon[] | null | undefined): Uint32Array;
|
|
5
6
|
//# sourceMappingURL=point-clip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"point-clip.d.ts","sourceRoot":"","sources":["../../../src/wsi/point-clip.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC7C,MAAM,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"point-clip.d.ts","sourceRoot":"","sources":["../../../src/wsi/point-clip.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC7C,MAAM,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;AAqFzC,wBAAgB,yBAAyB,CACxC,SAAS,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS,EAC1C,QAAQ,EAAE,UAAU,EAAE,GAAG,IAAI,GAAG,SAAS,GACvC,YAAY,GAAG,IAAI,CAqCrB;AAED,wBAAgB,4BAA4B,CAC3C,SAAS,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS,EAC1C,QAAQ,EAAE,UAAU,EAAE,GAAG,IAAI,GAAG,SAAS,GACvC,WAAW,CA4Bb"}
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
(function(){"use strict";function p(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function h(t){if(!Array.isArray(t)||t.length<3)return[];const n=t.map(([i,r])=>[i,r]),e=n[0],o=n[n.length-1];return!e||!o?[]:((e[0]!==o[0]||e[1]!==o[1])&&n.push([e[0],e[1]]),n)}function w(t){const n=[];for(const e of t??[]){const o=h(e);if(o.length<4)continue;let i=1/0,r=1/0,s=-1/0,c=-1/0;for(const[f,a]of o)f<i&&(i=f),f>s&&(s=f),a<r&&(r=a),a>c&&(c=a);!Number.isFinite(i)||!Number.isFinite(r)||n.push({ring:o,minX:i,minY:r,maxX:s,maxY:c})}return n}function g(t,n,e){let o=!1;for(let i=0,r=e.length-1;i<e.length;r=i,i+=1){const s=e[i][0],c=e[i][1],f=e[r][0],a=e[r][1];c>n!=a>n&&t<(f-s)*(n-c)/(a-c||Number.EPSILON)+s&&(o=!o)}return o}function x(t,n,e){for(const o of e)if(!(t<o.minX||t>o.maxX||n<o.minY||n>o.maxY)&&g(t,n,o.ring))return!0;return!1}function I(t){if(t instanceof Error)return t.message;try{return String(t)}catch{return"unknown worker error"}}const y=self;function M(t){const n=p(),e=Math.max(0,Math.floor(t.count)),o=new Float32Array(t.positions),i=new Uint16Array(t.paletteIndices),r=Math.floor(o.length/2),s=Math.max(0,Math.min(e,r,i.length)),c=w(t.polygons??[]);if(s===0||c.length===0)return{type:"roi-clip-success",id:t.id,count:0,positions:new Float32Array(0).buffer,paletteIndices:new Uint16Array(0).buffer,durationMs:p()-n};const f=new Float32Array(s*2),a=new Uint16Array(s);let u=0;for(let l=0;l<s;l+=1){const d=o[l*2],m=o[l*2+1];x(d,m,c)&&(f[u*2]=d,f[u*2+1]=m,a[u]=i[l],u+=1)}const A=f.slice(0,u*2),b=a.slice(0,u);return{type:"roi-clip-success",id:t.id,count:u,positions:A.buffer,paletteIndices:b.buffer,durationMs:p()-n}}y.addEventListener("message",t=>{const n=t.data;if(!(!n||n.type!=="roi-clip-request"))try{const e=M(n);y.postMessage(e,[e.positions,e.paletteIndices])}catch(e){const o={type:"roi-clip-failure",id:n.id,error:I(e)};y.postMessage(o)}})})();
|
|
2
|
-
//# sourceMappingURL=roi-clip-worker-i1SE1Dpa.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"roi-clip-worker-i1SE1Dpa.js","sources":["../src/workers/roi-clip-worker.ts"],"sourcesContent":["import type { RoiCoordinate, RoiPolygon } from \"../wsi/point-clip\";\nimport type { RoiClipWorkerRequest, RoiClipWorkerResponse, RoiClipWorkerSuccess } from \"../wsi/point-clip-worker-protocol\";\n\ninterface PreparedPolygon {\n ring: RoiPolygon;\n minX: number;\n minY: number;\n maxX: number;\n maxY: number;\n}\n\nfunction nowMs(): number {\n if (typeof performance !== \"undefined\" && typeof performance.now === \"function\") {\n return performance.now();\n }\n return Date.now();\n}\n\nfunction closeRing(coords: RoiPolygon): RoiPolygon {\n if (!Array.isArray(coords) || coords.length < 3) return [];\n const out = coords.map(([x, y]) => [x, y] as RoiCoordinate);\n const first = out[0];\n const last = out[out.length - 1];\n if (!first || !last) return [];\n if (first[0] !== last[0] || first[1] !== last[1]) {\n out.push([first[0], first[1]]);\n }\n return out;\n}\n\nfunction preparePolygons(polygons: RoiPolygon[]): PreparedPolygon[] {\n const prepared: PreparedPolygon[] = [];\n for (const poly of polygons ?? []) {\n const ring = closeRing(poly);\n if (ring.length < 4) continue;\n let minX = Infinity;\n let minY = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n for (const [x, y] of ring) {\n if (x < minX) minX = x;\n if (x > maxX) maxX = x;\n if (y < minY) minY = y;\n if (y > maxY) maxY = y;\n }\n if (!Number.isFinite(minX) || !Number.isFinite(minY)) continue;\n prepared.push({ ring, minX, minY, maxX, maxY });\n }\n return prepared;\n}\n\nfunction isInsideRing(x: number, y: number, ring: RoiPolygon): boolean {\n let inside = false;\n for (let i = 0, j = ring.length - 1; i < ring.length; j = i, i += 1) {\n const xi = ring[i][0];\n const yi = ring[i][1];\n const xj = ring[j][0];\n const yj = ring[j][1];\n const intersect = yi > y !== yj > y && x < ((xj - xi) * (y - yi)) / (yj - yi || Number.EPSILON) + xi;\n if (intersect) inside = !inside;\n }\n return inside;\n}\n\nfunction isInsideAnyPolygon(x: number, y: number, polygons: PreparedPolygon[]): boolean {\n for (const poly of polygons) {\n if (x < poly.minX || x > poly.maxX || y < poly.minY || y > poly.maxY) {\n continue;\n }\n if (isInsideRing(x, y, poly.ring)) {\n return true;\n }\n }\n return false;\n}\n\nfunction toErrorMessage(error: unknown): string {\n if (error instanceof Error) return error.message;\n try {\n return String(error);\n } catch {\n return \"unknown worker error\";\n }\n}\n\ninterface WorkerScope {\n postMessage(message: unknown, transfer?: Transferable[]): void;\n addEventListener(type: \"message\", listener: (event: MessageEvent<RoiClipWorkerRequest>) => void): void;\n}\n\nconst workerScope = self as unknown as WorkerScope;\n\nfunction handleRequest(msg: RoiClipWorkerRequest): RoiClipWorkerSuccess {\n const start = nowMs();\n const count = Math.max(0, Math.floor(msg.count));\n const positions = new Float32Array(msg.positions);\n const terms = new Uint16Array(msg.paletteIndices);\n\n const maxCountByPositions = Math.floor(positions.length / 2);\n const safeCount = Math.max(0, Math.min(count, maxCountByPositions, terms.length));\n const prepared = preparePolygons(msg.polygons ?? []);\n\n if (safeCount === 0 || prepared.length === 0) {\n return {\n type: \"roi-clip-success\",\n id: msg.id,\n count: 0,\n positions: new Float32Array(0).buffer,\n paletteIndices: new Uint16Array(0).buffer,\n durationMs: nowMs() - start,\n };\n }\n\n const nextPositions = new Float32Array(safeCount * 2);\n const nextTerms = new Uint16Array(safeCount);\n let cursor = 0;\n\n for (let i = 0; i < safeCount; i += 1) {\n const x = positions[i * 2];\n const y = positions[i * 2 + 1];\n if (!isInsideAnyPolygon(x, y, prepared)) continue;\n nextPositions[cursor * 2] = x;\n nextPositions[cursor * 2 + 1] = y;\n nextTerms[cursor] = terms[i];\n cursor += 1;\n }\n\n const outPositions = nextPositions.slice(0, cursor * 2);\n const outTerms = nextTerms.slice(0, cursor);\n\n return {\n type: \"roi-clip-success\",\n id: msg.id,\n count: cursor,\n positions: outPositions.buffer,\n paletteIndices: outTerms.buffer,\n durationMs: nowMs() - start,\n };\n}\n\nworkerScope.addEventListener(\"message\", (event: MessageEvent<RoiClipWorkerRequest>) => {\n const data = event.data;\n if (!data || data.type !== \"roi-clip-request\") return;\n\n try {\n const response = handleRequest(data);\n workerScope.postMessage(response, [response.positions, response.paletteIndices]);\n } catch (error) {\n const fail: RoiClipWorkerResponse = {\n type: \"roi-clip-failure\",\n id: data.id,\n error: toErrorMessage(error),\n };\n workerScope.postMessage(fail);\n }\n});\n"],"names":["nowMs","closeRing","coords","out","x","y","first","last","preparePolygons","polygons","prepared","poly","ring","minX","minY","maxX","maxY","isInsideRing","inside","j","xi","yi","xj","yj","isInsideAnyPolygon","toErrorMessage","error","workerScope","handleRequest","msg","start","count","positions","terms","maxCountByPositions","safeCount","nextPositions","nextTerms","cursor","i","outPositions","outTerms","event","data","response","fail"],"mappings":"yBAWA,SAASA,GAAgB,CACvB,OAAI,OAAO,YAAgB,KAAe,OAAO,YAAY,KAAQ,WAC5D,YAAY,IAAA,EAEd,KAAK,IAAA,CACd,CAEA,SAASC,EAAUC,EAAgC,CACjD,GAAI,CAAC,MAAM,QAAQA,CAAM,GAAKA,EAAO,OAAS,EAAG,MAAO,CAAA,EACxD,MAAMC,EAAMD,EAAO,IAAI,CAAC,CAACE,EAAGC,CAAC,IAAM,CAACD,EAAGC,CAAC,CAAkB,EACpDC,EAAQH,EAAI,CAAC,EACbI,EAAOJ,EAAIA,EAAI,OAAS,CAAC,EAC/B,MAAI,CAACG,GAAS,CAACC,EAAa,CAAA,IACxBD,EAAM,CAAC,IAAMC,EAAK,CAAC,GAAKD,EAAM,CAAC,IAAMC,EAAK,CAAC,IAC7CJ,EAAI,KAAK,CAACG,EAAM,CAAC,EAAGA,EAAM,CAAC,CAAC,CAAC,EAExBH,EACT,CAEA,SAASK,EAAgBC,EAA2C,CAClE,MAAMC,EAA8B,CAAA,EACpC,UAAWC,KAAQF,GAAY,GAAI,CACjC,MAAMG,EAAOX,EAAUU,CAAI,EAC3B,GAAIC,EAAK,OAAS,EAAG,SACrB,IAAIC,EAAO,IACPC,EAAO,IACPC,EAAO,KACPC,EAAO,KACX,SAAW,CAACZ,EAAGC,CAAC,IAAKO,EACfR,EAAIS,IAAMA,EAAOT,GACjBA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