med-viewer-sdk 0.1.15 → 0.1.16
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/dist/med-viewer-sdk.mjs
CHANGED
|
@@ -16293,6 +16293,9 @@ class MedViewerEngine {
|
|
|
16293
16293
|
}
|
|
16294
16294
|
loadAIMarks(aiBoxes = [], showLabel = false) {
|
|
16295
16295
|
this.clearAIMarks();
|
|
16296
|
+
const tiledImage = this.viewer.world.getItemAt(0);
|
|
16297
|
+
if (!tiledImage)
|
|
16298
|
+
return;
|
|
16296
16299
|
aiBoxes.forEach((box) => {
|
|
16297
16300
|
var elt = document.createElement("div");
|
|
16298
16301
|
elt.classList.add("ld-ai-box");
|
|
@@ -16317,15 +16320,13 @@ class MedViewerEngine {
|
|
|
16317
16320
|
});
|
|
16318
16321
|
elt.appendChild(text);
|
|
16319
16322
|
}
|
|
16320
|
-
const
|
|
16321
|
-
const
|
|
16322
|
-
const x2 = box.x / size.x;
|
|
16323
|
-
const y2 = box.y / size.y;
|
|
16324
|
-
const w2 = box.width / size.x;
|
|
16325
|
-
const h2 = box.height / size.y;
|
|
16323
|
+
const imageRect = new OpenSeadragon.Rect(box.x, box.y, box.width, box.height);
|
|
16324
|
+
const viewportRect = this.viewer.viewport.imageToViewportRectangle(imageRect);
|
|
16326
16325
|
this.viewer.addOverlay({
|
|
16327
16326
|
element: elt,
|
|
16328
|
-
location:
|
|
16327
|
+
location: viewportRect,
|
|
16328
|
+
// 如果你希望标注在缩放时不变得过大或过小,可以使用 placement
|
|
16329
|
+
checkResize: true
|
|
16329
16330
|
});
|
|
16330
16331
|
});
|
|
16331
16332
|
}
|