med-viewer-sdk 0.1.9 → 0.1.11

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.
@@ -6,7 +6,7 @@ import { ColorAdjustPlugin, type ColorAdjustOptions } from "./ColorAdjustPlugin"
6
6
  import { SelectionPlugin, type SelectionOptions } from "./SelectionPlugin";
7
7
  import { ScalebarPlugin, type ScalebarOptions } from "./Scalebar";
8
8
  import { MagnificationPlugin, type MagnificationOptions } from "./Magnification";
9
- import { Locale } from "./i18n";
9
+ import { Locale } from "../i18n/i18n";
10
10
  /**
11
11
  * 引擎配置接口
12
12
  */
@@ -22,6 +22,27 @@ export interface MedEngineOptions {
22
22
  magnification?: boolean | MagnificationOptions;
23
23
  };
24
24
  }
25
+ export interface AiBoxRectLabel {
26
+ label: string;
27
+ value: string;
28
+ style?: {
29
+ color: string;
30
+ fontSize: number;
31
+ [key: string]: any;
32
+ };
33
+ }
34
+ export interface AiBoxRect {
35
+ x: number;
36
+ y: number;
37
+ width: number;
38
+ height: number;
39
+ style: {
40
+ border: string;
41
+ fontSize: number;
42
+ [key: string]: any;
43
+ };
44
+ labels: Array<AiBoxRectLabel>;
45
+ }
25
46
  /**
26
47
  * 医学影像核心引擎
27
48
  * 职责:初始化 OpenSeadragon,管理插件生命周期
@@ -35,6 +56,7 @@ export declare class MedViewerEngine {
35
56
  scalebar: ScalebarPlugin | null;
36
57
  magnification: MagnificationPlugin | null;
37
58
  private options;
59
+ private events;
38
60
  constructor(options: MedEngineOptions);
39
61
  /**
40
62
  * 内部插件初始化逻辑
@@ -45,6 +67,13 @@ export declare class MedViewerEngine {
45
67
  * 真正挂载 Annotorious 的私有方法
46
68
  */
47
69
  private mountAnnotorious;
70
+ loadAIMarks(aiBoxes?: AiBoxRect[], showLabel?: boolean): void;
71
+ updateAIMarks(aiBoxes?: AiBoxRect[], showLabel?: boolean): void;
72
+ clearAIMarks(): void;
73
+ addHandler(event: string, handler: Function): void;
74
+ addOnceHandler(event: string, handler: Function): void;
75
+ removeHandler(event: string, handler: Function): void;
76
+ private emit;
48
77
  /**
49
78
  * 销毁引擎与所有插件
50
79
  */
@@ -1,6 +1,18 @@
1
1
  import OpenSeadragon from "openseadragon";
2
- export type MagnificationType = "LD" | "OSD";
3
- export type MagnificationPosition = "TOP_LEFT" | "TOP_CENTER" | "TOP_RIGHT" | "BOTTOM_LEFT" | "BOTTOM_CENTER" | "BOTTOM_RIGHT" | "MIDDLE_LEFT" | "MIDDLE_RIGHT";
2
+ export declare enum MagnificationPosition {
3
+ TOP_LEFT = "TOP_LEFT",
4
+ TOP_CENTER = "TOP_CENTER",
5
+ TOP_RIGHT = "TOP_RIGHT",
6
+ BOTTOM_LEFT = "BOTTOM_LEFT",
7
+ BOTTOM_CENTER = "BOTTOM_CENTER",
8
+ BOTTOM_RIGHT = "BOTTOM_RIGHT",
9
+ MIDDLE_LEFT = "MIDDLE_LEFT",
10
+ MIDDLE_RIGHT = "MIDDLE_RIGHT"
11
+ }
12
+ export declare enum MagnificationType {
13
+ LD = "LD",
14
+ OSD = "OSD"
15
+ }
4
16
  export interface MagnificationOptions {
5
17
  type?: MagnificationType;
6
18
  position?: MagnificationPosition;
@@ -1,5 +1,14 @@
1
1
  import type { MedViewerEngine } from "./Engine";
2
- export type ToolbarPosition = "TOP_LEFT" | "TOP_CENTER" | "TOP_RIGHT" | "BOTTOM_LEFT" | "BOTTOM_CENTER" | "BOTTOM_RIGHT" | "MIDDLE_LEFT" | "MIDDLE_RIGHT";
2
+ export declare enum ToolbarPosition {
3
+ TOP_LEFT = "TOP_LEFT",
4
+ TOP_CENTER = "TOP_CENTER",
5
+ TOP_RIGHT = "TOP_RIGHT",
6
+ BOTTOM_LEFT = "BOTTOM_LEFT",
7
+ BOTTOM_CENTER = "BOTTOM_CENTER",
8
+ BOTTOM_RIGHT = "BOTTOM_RIGHT",
9
+ MIDDLE_LEFT = "MIDDLE_LEFT",
10
+ MIDDLE_RIGHT = "MIDDLE_RIGHT"
11
+ }
3
12
  export interface ToolbarButton {
4
13
  id: string;
5
14
  label?: string;
@@ -1,8 +1,8 @@
1
1
  import { MedViewerEngine, type MedEngineOptions } from "./core/Engine";
2
2
  import { type ScalebarOptions, ScalebarType, ScalebarLocation } from "./core/Scalebar";
3
3
  import { AnnoAnnotator } from "./core/AnnoAnnotator";
4
- import { MedToolbar, type ToolbarOptions } from "./core/Toolbar";
4
+ import { MedToolbar, ToolbarPosition, type ToolbarOptions } from "./core/Toolbar";
5
5
  import { SelectionPlugin, type SelectionOptions } from "./core/SelectionPlugin";
6
6
  import { ColorAdjustPlugin, type ColorAdjustOptions } from "./core/ColorAdjustPlugin";
7
- import { MagnificationPlugin, type MagnificationOptions } from "./core/Magnification";
8
- export { MedViewerEngine, type MedEngineOptions, AnnoAnnotator, MedToolbar, type ToolbarOptions, SelectionPlugin, type SelectionOptions, ColorAdjustPlugin, type ColorAdjustOptions, MagnificationPlugin, type MagnificationOptions, type ScalebarOptions, ScalebarType, ScalebarLocation, };
7
+ import { MagnificationPlugin, MagnificationPosition, MagnificationType, type MagnificationOptions } from "./core/Magnification";
8
+ export { MedViewerEngine, type MedEngineOptions, AnnoAnnotator, MedToolbar, ToolbarPosition, type ToolbarOptions, SelectionPlugin, type SelectionOptions, ColorAdjustPlugin, type ColorAdjustOptions, MagnificationPlugin, MagnificationPosition, MagnificationType, type MagnificationOptions, type ScalebarOptions, ScalebarType, ScalebarLocation, };