@ohif/app 3.9.0-beta.11 → 3.9.0-beta.13

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 (37) hide show
  1. package/dist/{117.bundle.a80b1511ef4b302fb7cc.js → 117.bundle.58f96ac1d52fd08db5c2.js} +49 -15
  2. package/dist/{164.bundle.1da1cadb56951caef1d6.js → 164.bundle.db5eee347be4e24f6fdd.js} +315 -41
  3. package/dist/{236.bundle.4ca7987e1d57f60ec13a.js → 236.bundle.d93b7e3b3edcae50a4e6.js} +376 -52
  4. package/dist/{342.bundle.340982440de15f540a89.js → 342.bundle.2409ae0f84411b7636b4.js} +7 -0
  5. package/dist/{473.bundle.6cd4be953853f35b29c3.js → 367.bundle.da5db5b510b537e43888.js} +278 -29
  6. package/dist/{806.bundle.50e039eb624382ee1fce.js → 370.bundle.d6c1741f388bb129bcd3.js} +77 -9
  7. package/dist/{390.bundle.4fb18436fcd8c75bfab9.js → 390.bundle.371ffd001d46432557f2.js} +2 -2
  8. package/dist/{483.bundle.a353efc5a5dd563c903c.js → 483.bundle.67e9abdcf23262c94606.js} +16 -3
  9. package/dist/{35.bundle.0168d78bfad0cb784112.js → 501.bundle.d5262ba2d61a134e80f9.js} +739 -244
  10. package/dist/{550.bundle.76c529a79ade359c0af7.js → 550.bundle.c211a9405c0fea8b70c0.js} +17 -3
  11. package/dist/{682.bundle.f786c869b632dadc55d3.js → 682.bundle.b6b1c4ac23044234ac45.js} +15 -0
  12. package/dist/{722.bundle.2547630541b670f10d6e.js → 722.bundle.1242e0348afc63ca4f5e.js} +10 -4
  13. package/dist/{889.bundle.60a917f43d3d3aebd378.js → 889.bundle.1330adb8267685a46d93.js} +1 -1
  14. package/dist/{app.bundle.f2e1810071777956e5da.js → app.bundle.ec91a0b1e64f293deb56.js} +410 -213
  15. package/dist/index.html +1 -1
  16. package/dist/{polySeg.bundle.1799686b019040500219.js → polySeg.bundle.2925f79e406ec5679295.js} +3 -3
  17. package/dist/{suv-peak-worker.bundle.25f8b85eab9ec06da48d.js → suv-peak-worker.bundle.3c25dca2297e395980e0.js} +3 -3
  18. package/dist/sw.js +1 -1
  19. package/package.json +18 -18
  20. /package/dist/{243.bundle.f701d3acde1d3750fda2.js → 243.bundle.967be75d489294523b3c.js} +0 -0
  21. /package/dist/{325.bundle.242d9efe2ed15a5a334e.js → 325.bundle.5ad1d2b00a173b94db4f.js} +0 -0
  22. /package/dist/{448.bundle.97cfffdf73a6f7410119.js → 448.bundle.a9c52da5cc80e95b8aa6.js} +0 -0
  23. /package/dist/{487.bundle.3146b9a2006ff92246f9.js → 487.bundle.60f830551ffe12e1b0ea.js} +0 -0
  24. /package/dist/{544.bundle.e8227e98860e39636a00.js → 544.bundle.4d1fb477b572f50f4220.js} +0 -0
  25. /package/dist/{574.bundle.72bd5061ccd504235419.js → 574.bundle.99b6357e6e4d26b7fb93.js} +0 -0
  26. /package/dist/{699.bundle.d8fd228d9425a584b6d1.js → 699.bundle.4a2e2eba13fbf59c342b.js} +0 -0
  27. /package/dist/{721.bundle.1070ac1c9bc6aa07e964.js → 721.bundle.8665593de62d3b1a7591.js} +0 -0
  28. /package/dist/{776.bundle.505d83008d54340ddcee.js → 776.bundle.92ce65b42f134be08692.js} +0 -0
  29. /package/dist/{783.bundle.f0eabf38cc6f986f2b96.js → 783.bundle.8dc730b68ab8cb38cd97.js} +0 -0
  30. /package/dist/{862.bundle.55dde21bab4c841b6259.js → 862.bundle.c31fa820e70e82c2a293.js} +0 -0
  31. /package/dist/{905.bundle.da4b814f42846a91663c.js → 905.bundle.2dde70fc1344fa48bd66.js} +0 -0
  32. /package/dist/{907.bundle.f3edaafebee9db2e2736.js → 907.bundle.fc4fefa34c7824db5052.js} +0 -0
  33. /package/dist/{94.bundle.2486a958cb879d59aa7d.js → 94.bundle.4a669af14ef899c48703.js} +0 -0
  34. /package/dist/{961.bundle.5711180f24fad3da4096.js → 961.bundle.ba3863c5abde7acf1cad.js} +0 -0
  35. /package/dist/{981.bundle.b5bcd103ff48bc8817e6.js → 981.bundle.df1bb0b77b46672b1836.js} +0 -0
  36. /package/dist/{989.bundle.130439d9d862e47a9200.js → 989.bundle.d68c5a2715533cce2c68.js} +0 -0
  37. /package/dist/{998.bundle.d9191b5ca5bde4305742.js → 998.bundle.ac704321d1f10e659f6f.js} +0 -0
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- (globalThis["webpackChunk"] = globalThis["webpackChunk"] || []).push([[164,473],{
2
+ (globalThis["webpackChunk"] = globalThis["webpackChunk"] || []).push([[164,367],{
3
3
 
4
4
  /***/ 25271:
5
5
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
@@ -549,7 +549,7 @@ __webpack_require__.r(__webpack_exports__);
549
549
  /* harmony import */ var _cache__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(13320);
550
550
  /* harmony import */ var _enums_Events__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(11731);
551
551
  /* harmony import */ var _eventTarget__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(51884);
552
- /* harmony import */ var _utilities__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(35678);
552
+ /* harmony import */ var _utilities__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(20228);
553
553
  /* harmony import */ var _requestPool_imageLoadPoolManager__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(775);
554
554
  /* harmony import */ var ___WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(92136);
555
555
 
@@ -818,7 +818,7 @@ __webpack_require__.r(__webpack_exports__);
818
818
  /* harmony import */ var _utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(13292);
819
819
  /* harmony import */ var lodash_clonedeep__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(48463);
820
820
  /* harmony import */ var lodash_clonedeep__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(lodash_clonedeep__WEBPACK_IMPORTED_MODULE_8__);
821
- /* harmony import */ var _utilities__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(35678);
821
+ /* harmony import */ var _utilities__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(20228);
822
822
  /* harmony import */ var _init__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(71702);
823
823
  /* harmony import */ var _utilities_cacheUtils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(51631);
824
824
 
@@ -1115,8 +1115,22 @@ function generateVolumeScalarData(targetBuffer, scalarLength) {
1115
1115
  }
1116
1116
  let volumeScalarData;
1117
1117
  if (targetBuffer?.sharedArrayBuffer) {
1118
- const buffer = new SharedArrayBuffer(numBytes);
1119
- volumeScalarData = new TypedArrayConstructor(buffer);
1118
+ switch (targetBuffer.type) {
1119
+ case 'Float32Array':
1120
+ volumeScalarData = (0,_utilities__WEBPACK_IMPORTED_MODULE_9__.createFloat32SharedArray)(scalarLength);
1121
+ break;
1122
+ case 'Uint8Array':
1123
+ volumeScalarData = (0,_utilities__WEBPACK_IMPORTED_MODULE_9__.createUint8SharedArray)(scalarLength);
1124
+ break;
1125
+ case 'Uint16Array':
1126
+ volumeScalarData = (0,_utilities__WEBPACK_IMPORTED_MODULE_9__.createUint16SharedArray)(scalarLength);
1127
+ break;
1128
+ case 'Int16Array':
1129
+ volumeScalarData = (0,_utilities__WEBPACK_IMPORTED_MODULE_9__.createUint16SharedArray)(scalarLength);
1130
+ break;
1131
+ default:
1132
+ throw new Error('generateVolumeScalarData: SharedArrayBuffer is not supported for the specified target buffer type');
1133
+ }
1120
1134
  }
1121
1135
  else {
1122
1136
  volumeScalarData = new TypedArrayConstructor(scalarLength);
@@ -1203,7 +1217,7 @@ imageLoadPoolManager.setMaxSimultaneousRequests(_enums_RequestType__WEBPACK_IMPO
1203
1217
  /* harmony export */ R: () => (/* binding */ RequestPoolManager)
1204
1218
  /* harmony export */ });
1205
1219
  /* harmony import */ var _enums_RequestType__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15453);
1206
- /* harmony import */ var _utilities__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(35678);
1220
+ /* harmony import */ var _utilities__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20228);
1207
1221
 
1208
1222
 
1209
1223
  class RequestPoolManager {
@@ -1554,7 +1568,7 @@ class CentralizedWorkerManager {
1554
1568
  /* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(61738);
1555
1569
  /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(55965);
1556
1570
  /* harmony import */ var _synchronizers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(42375);
1557
- /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2746);
1571
+ /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(49574);
1558
1572
  /* harmony import */ var _utilities__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(74119);
1559
1573
  /* harmony import */ var _cursors__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(32916);
1560
1574
  /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(40969);
@@ -1636,7 +1650,7 @@ class CentralizedWorkerManager {
1636
1650
  /* harmony import */ var _stateManagement_annotation_annotationLocking__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(48428);
1637
1651
  /* harmony import */ var _stateManagement_annotation_annotationVisibility__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(21009);
1638
1652
  /* harmony import */ var _stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(54177);
1639
- /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(2746);
1653
+ /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(49574);
1640
1654
  /* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(61738);
1641
1655
  /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(84901);
1642
1656
  /* harmony import */ var _utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(90252);
@@ -2630,7 +2644,7 @@ __webpack_require__.d(__webpack_exports__, {
2630
2644
  t0: () => (/* reexport */ SegmentationDisplayTool/* default */.A)
2631
2645
  });
2632
2646
 
2633
- // UNUSED EXPORTS: AngleTool, AnnotationDisplayTool, ArrowAnnotateTool, BaseTool, BidirectionalTool, BrushTool, CircleROIStartEndThresholdTool, CircleROITool, CircleScissorsTool, CobbAngleTool, CrosshairsTool, DragProbeTool, EllipticalROITool, EraserTool, KeyImageTool, LengthTool, LivewireContourSegmentationTool, LivewireContourTool, MIPJumpToClickTool, MagnifyTool, OrientationMarkerTool, OverlayGridTool, PaintFillTool, PanTool, PlanarRotateTool, ProbeTool, RectangleROIStartEndThresholdTool, RectangleROIThresholdTool, RectangleROITool, RectangleScissorsTool, ReferenceCursors, ReferenceLines, ReferenceLinesTool, ScaleOverlayTool, SculptorTool, SegmentSelectTool, SegmentationIntersectionTool, SphereScissorsTool, SplineContourSegmentationTool, SplineROITool, StackScrollMouseWheelTool, StackScrollTool, TrackballRotateTool, UltrasoundDirectionalTool, VolumeRotateMouseWheelTool, WindowLevelTool, ZoomTool
2647
+ // UNUSED EXPORTS: AngleTool, AnnotationDisplayTool, ArrowAnnotateTool, BaseTool, BidirectionalTool, BrushTool, CircleROIStartEndThresholdTool, CircleROITool, CircleScissorsTool, CobbAngleTool, CrosshairsTool, DragProbeTool, EllipticalROITool, EraserTool, KeyImageTool, LengthTool, LivewireContourSegmentationTool, LivewireContourTool, MIPJumpToClickTool, MagnifyTool, OrientationMarkerTool, OverlayGridTool, PaintFillTool, PanTool, PlanarRotateTool, ProbeTool, RectangleROIStartEndThresholdTool, RectangleROIThresholdTool, RectangleROITool, RectangleScissorsTool, ReferenceCursors, ReferenceLines, ReferenceLinesTool, ScaleOverlayTool, SculptorTool, SegmentSelectTool, SegmentationIntersectionTool, SphereScissorsTool, SplineContourSegmentationTool, SplineROITool, StackScrollMouseWheelTool, StackScrollTool, TrackballRotateTool, UltrasoundDirectionalTool, VolumeRotateMouseWheelTool, WindowLevelRegionTool, WindowLevelTool, ZoomTool
2634
2648
 
2635
2649
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/tools/base/index.js
2636
2650
  var base = __webpack_require__(96214);
@@ -2640,6 +2654,8 @@ var PanTool = __webpack_require__(25294);
2640
2654
  var TrackballRotateTool = __webpack_require__(15924);
2641
2655
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/tools/WindowLevelTool.js
2642
2656
  var WindowLevelTool = __webpack_require__(455);
2657
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/tools/WindowLevelRegionTool.js
2658
+ var WindowLevelRegionTool = __webpack_require__(60747);
2643
2659
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/tools/StackScrollTool.js
2644
2660
  var StackScrollTool = __webpack_require__(20132);
2645
2661
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/tools/PlanarRotateTool.js
@@ -2722,8 +2738,8 @@ var esm = __webpack_require__(92136);
2722
2738
  var stateManagement = __webpack_require__(95778);
2723
2739
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/annotation/annotationLocking.js
2724
2740
  var annotationLocking = __webpack_require__(48428);
2725
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/drawingSvg/index.js + 17 modules
2726
- var drawingSvg = __webpack_require__(2746);
2741
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/drawingSvg/index.js + 18 modules
2742
+ var drawingSvg = __webpack_require__(49574);
2727
2743
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/viewportFilters/index.js + 4 modules
2728
2744
  var viewportFilters = __webpack_require__(90252);
2729
2745
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/cursors/elementCursor.js
@@ -3259,6 +3275,7 @@ var SegmentSelectTool = __webpack_require__(34041);
3259
3275
 
3260
3276
 
3261
3277
 
3278
+
3262
3279
 
3263
3280
 
3264
3281
  /***/ }),
@@ -3313,6 +3330,99 @@ class AnnotationFrameRange {
3313
3330
  }
3314
3331
 
3315
3332
 
3333
+ /***/ }),
3334
+
3335
+ /***/ 25781:
3336
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3337
+
3338
+ /* unused harmony export annotationHydration */
3339
+ /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(92136);
3340
+ /* harmony import */ var _stateManagement__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(95778);
3341
+ /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44753);
3342
+
3343
+
3344
+
3345
+ function annotationHydration(viewport, toolName, worldPoints, options) {
3346
+ const viewReference = viewport.getViewReference();
3347
+ const { viewPlaneNormal, FrameOfReferenceUID } = viewReference;
3348
+ const annotation = {
3349
+ annotationUID: options?.annotationUID || utilities.uuidv4(),
3350
+ data: {
3351
+ handles: {
3352
+ points: worldPoints,
3353
+ },
3354
+ },
3355
+ highlighted: false,
3356
+ autoGenerated: false,
3357
+ invalidated: false,
3358
+ isLocked: false,
3359
+ isVisible: true,
3360
+ metadata: {
3361
+ toolName,
3362
+ viewPlaneNormal,
3363
+ FrameOfReferenceUID,
3364
+ referencedImageId: getReferencedImageId(viewport, worldPoints[0], viewPlaneNormal),
3365
+ ...options,
3366
+ },
3367
+ };
3368
+ addAnnotation(annotation, viewport.element);
3369
+ return annotation;
3370
+ }
3371
+ function getReferencedImageId(viewport, worldPos, viewPlaneNormal) {
3372
+ let referencedImageId;
3373
+ if (viewport instanceof StackViewport) {
3374
+ referencedImageId = getClosestImageIdForStackViewport(viewport, worldPos, viewPlaneNormal);
3375
+ }
3376
+ else if (viewport instanceof BaseVolumeViewport) {
3377
+ const targetId = getTargetId(viewport);
3378
+ const volumeId = utilities.getVolumeId(targetId);
3379
+ const imageVolume = cache.getVolume(volumeId);
3380
+ referencedImageId = utilities.getClosestImageId(imageVolume, worldPos, viewPlaneNormal);
3381
+ }
3382
+ else {
3383
+ throw new Error('getReferencedImageId: viewport must be a StackViewport or BaseVolumeViewport');
3384
+ }
3385
+ return referencedImageId;
3386
+ }
3387
+ function getTargetId(viewport) {
3388
+ const targetId = viewport.getReferenceId?.();
3389
+ if (targetId) {
3390
+ return targetId;
3391
+ }
3392
+ if (viewport instanceof BaseVolumeViewport) {
3393
+ return `volumeId:${getTargetVolumeId(viewport)}`;
3394
+ }
3395
+ throw new Error('getTargetId: viewport must have a getTargetId method');
3396
+ }
3397
+ function getTargetVolumeId(viewport) {
3398
+ const actorEntries = viewport.getActors();
3399
+ if (!actorEntries) {
3400
+ return;
3401
+ }
3402
+ return actorEntries.find((actorEntry) => actorEntry.actor.getClassName() === 'vtkVolume')?.uid;
3403
+ }
3404
+ function getClosestImageIdForStackViewport(viewport, worldPos, viewPlaneNormal) {
3405
+ const imageIds = viewport.getImageIds();
3406
+ if (!imageIds || !imageIds.length) {
3407
+ return;
3408
+ }
3409
+ const distanceImagePairs = imageIds.map((imageId) => {
3410
+ const { imagePositionPatient } = metaData.get('imagePlaneModule', imageId);
3411
+ const distance = calculateDistanceToImage(worldPos, imagePositionPatient, viewPlaneNormal);
3412
+ return { imageId, distance };
3413
+ });
3414
+ distanceImagePairs.sort((a, b) => a.distance - b.distance);
3415
+ return distanceImagePairs[0].imageId;
3416
+ }
3417
+ function calculateDistanceToImage(worldPos, ImagePositionPatient, viewPlaneNormal) {
3418
+ const dir = vec3.create();
3419
+ vec3.sub(dir, worldPos, ImagePositionPatient);
3420
+ const dot = vec3.dot(dir, viewPlaneNormal);
3421
+ return Math.abs(dot);
3422
+ }
3423
+
3424
+
3425
+
3316
3426
  /***/ }),
3317
3427
 
3318
3428
  /***/ 42290:
@@ -3795,6 +3905,9 @@ function _createCinePlayContext(viewport, playClipOptions) {
3795
3905
  /***/ 88484:
3796
3906
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3797
3907
 
3908
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3909
+ /* harmony export */ Ay: () => (__WEBPACK_DEFAULT_EXPORT__)
3910
+ /* harmony export */ });
3798
3911
  /* unused harmony exports clip, clipToBox */
3799
3912
  function clip(val, low, high) {
3800
3913
  return Math.min(Math.max(low, val), high);
@@ -3803,7 +3916,7 @@ function clipToBox(point, box) {
3803
3916
  point.x = clip(point.x, 0, box.width);
3804
3917
  point.y = clip(point.y, 0, box.height);
3805
3918
  }
3806
- /* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = ((/* unused pure expression or super */ null && (clip)));
3919
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (clip);
3807
3920
 
3808
3921
 
3809
3922
  /***/ }),
@@ -5159,6 +5272,7 @@ function getViewportForAnnotation(annotation) {
5159
5272
 
5160
5273
  // EXPORTS
5161
5274
  __webpack_require__.d(__webpack_exports__, {
5275
+ clip: () => (/* reexport */ clip/* default */.Ay),
5162
5276
  debounce: () => (/* reexport */ debounce/* default */.A),
5163
5277
  getCalibratedLengthUnitsAndScale: () => (/* reexport */ getCalibratedUnits/* getCalibratedLengthUnitsAndScale */.Op),
5164
5278
  math: () => (/* reexport */ math),
@@ -5172,7 +5286,7 @@ __webpack_require__.d(__webpack_exports__, {
5172
5286
  triggerAnnotationRenderForViewportIds: () => (/* reexport */ triggerAnnotationRenderForViewportIds/* default */.A)
5173
5287
  });
5174
5288
 
5175
- // UNUSED EXPORTS: annotationFrameRange, boundingBox, calibrateImageSpacing, cine, clip, contourSegmentation, contours, drawing, dynamicVolume, getAnnotationNearPoint, getAnnotationNearPointOnEnabledElement, getCalibratedAspect, getCalibratedProbeUnitsAndValue, getSphereBoundsInfo, getViewportForAnnotation, isObject, jumpToSlice, orientation, planar, planarFreehandROITool, pointInSurroundingSphereCallback, rectangleROITool, segmentation, stackContextPrefetch, stackPrefetch, touch, triggerAnnotationRender, triggerEvent, viewport, viewportFilters, voi
5289
+ // UNUSED EXPORTS: annotationFrameRange, annotationHydration, boundingBox, calibrateImageSpacing, cine, contourSegmentation, contours, drawing, dynamicVolume, getAnnotationNearPoint, getAnnotationNearPointOnEnabledElement, getCalibratedAspect, getCalibratedProbeUnitsAndValue, getSphereBoundsInfo, getViewportForAnnotation, isObject, jumpToSlice, orientation, planar, planarFreehandROITool, pointInSurroundingSphereCallback, rectangleROITool, segmentation, stackContextPrefetch, stackPrefetch, touch, triggerAnnotationRender, triggerEvent, viewport, viewportFilters, voi
5176
5290
 
5177
5291
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/index.js + 28 modules
5178
5292
  var esm = __webpack_require__(92136);
@@ -5212,6 +5326,8 @@ var annotationFrameRange = __webpack_require__(41209);
5212
5326
  var pointInSurroundingSphereCallback = __webpack_require__(5093);
5213
5327
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/getViewportForAnnotation.js
5214
5328
  var getViewportForAnnotation = __webpack_require__(39490);
5329
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/annotationHydration.js
5330
+ var annotationHydration = __webpack_require__(25781);
5215
5331
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/index.js
5216
5332
  var contours = __webpack_require__(75534);
5217
5333
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/segmentation/index.js
@@ -5251,8 +5367,8 @@ var touch = __webpack_require__(54868);
5251
5367
  var dynamicVolume = __webpack_require__(16390);
5252
5368
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/polyData/utils.js
5253
5369
  var utils = __webpack_require__(46514);
5254
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/voi/index.js
5255
- var voi = __webpack_require__(10413);
5370
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/voi/index.js + 4 modules
5371
+ var voi = __webpack_require__(14149);
5256
5372
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contourSegmentation/index.js
5257
5373
  var contourSegmentation = __webpack_require__(7259);
5258
5374
  ;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/index.js
@@ -5291,6 +5407,7 @@ var contourSegmentation = __webpack_require__(7259);
5291
5407
 
5292
5408
 
5293
5409
 
5410
+
5294
5411
 
5295
5412
 
5296
5413
  const roundNumber = esm.utilities.roundNumber;
@@ -5383,6 +5500,8 @@ __webpack_require__.d(__webpack_exports__, {
5383
5500
 
5384
5501
  // UNUSED EXPORTS: Calculator
5385
5502
 
5503
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/index.js + 28 modules
5504
+ var esm = __webpack_require__(92136);
5386
5505
  ;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/math/basic/Calculator.js
5387
5506
  class Calculator {
5388
5507
  }
@@ -5390,55 +5509,73 @@ class Calculator {
5390
5509
 
5391
5510
  ;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/math/basic/BasicStatsCalculator.js
5392
5511
 
5512
+
5513
+ const { PointsManager } = esm.utilities;
5393
5514
  class BasicStatsCalculator extends basic_Calculator {
5394
5515
  static { this.max = [-Infinity]; }
5516
+ static { this.min = [Infinity]; }
5395
5517
  static { this.sum = [0]; }
5396
- static { this.sumSquares = [0]; }
5397
- static { this.squaredDiffSum = [0]; }
5398
5518
  static { this.count = 0; }
5399
- static { this.statsCallback = ({ value: newValue }) => {
5519
+ static { this.runMean = [0]; }
5520
+ static { this.m2 = [0]; }
5521
+ static { this.pointsInShape = PointsManager.create3(1024); }
5522
+ static statsInit(options) {
5523
+ if (options.noPointsCollection) {
5524
+ BasicStatsCalculator.pointsInShape = null;
5525
+ }
5526
+ }
5527
+ static { this.statsCallback = ({ value: newValue, pointLPS = null }) => {
5400
5528
  if (Array.isArray(newValue) &&
5401
5529
  newValue.length > 1 &&
5402
5530
  this.max.length === 1) {
5403
5531
  this.max.push(this.max[0], this.max[0]);
5532
+ this.min.push(this.min[0], this.min[0]);
5404
5533
  this.sum.push(this.sum[0], this.sum[0]);
5405
- this.sumSquares.push(this.sumSquares[0], this.sumSquares[0]);
5406
- this.squaredDiffSum.push(this.squaredDiffSum[0], this.squaredDiffSum[0]);
5534
+ this.runMean.push(0, 0);
5535
+ this.m2.push(this.m2[0], this.m2[0]);
5407
5536
  }
5537
+ this.pointsInShape?.push(pointLPS);
5408
5538
  const newArray = Array.isArray(newValue) ? newValue : [newValue];
5409
5539
  this.count += 1;
5410
- this.max.forEach((it, idx) => (this.max[idx] = Math.max(it, newArray[idx])));
5411
- this.sum.map((it, idx) => (this.sum[idx] += newArray[idx]));
5412
- this.sumSquares.map((it, idx) => (this.sumSquares[idx] += newArray[idx] ** 2));
5413
- this.squaredDiffSum.map((it, idx) => (this.squaredDiffSum[idx] += Math.pow(newArray[idx] - this.sum[idx] / this.count, 2)));
5540
+ this.max.map((it, idx) => {
5541
+ const value = newArray[idx];
5542
+ const delta = value - this.runMean[idx];
5543
+ this.sum[idx] += value;
5544
+ this.runMean[idx] += delta / this.count;
5545
+ const delta2 = value - this.runMean[idx];
5546
+ this.m2[idx] += delta * delta2;
5547
+ this.min[idx] = Math.min(this.min[idx], value);
5548
+ this.max[idx] = Math.max(it, value);
5549
+ });
5414
5550
  }; }
5415
- static { this.getStatistics = () => {
5551
+ static { this.getStatistics = (options) => {
5416
5552
  const mean = this.sum.map((sum) => sum / this.count);
5417
- const stdDev = this.squaredDiffSum.map((squaredDiffSum) => Math.sqrt(squaredDiffSum / this.count));
5418
- const stdDevWithSumSquare = this.sumSquares.map((it, idx) => Math.sqrt(this.sumSquares[idx] / this.count - mean[idx] ** 2));
5553
+ const stdDev = this.m2.map((squaredDiffSum) => Math.sqrt(squaredDiffSum / this.count));
5554
+ const unit = options?.unit || null;
5419
5555
  const named = {
5420
5556
  max: {
5421
5557
  name: 'max',
5422
5558
  label: 'Max Pixel',
5423
5559
  value: singleArrayAsNumber(this.max),
5424
- unit: null,
5560
+ unit,
5561
+ },
5562
+ min: {
5563
+ name: 'min',
5564
+ label: 'Min Pixel',
5565
+ value: singleArrayAsNumber(this.min),
5566
+ unit,
5425
5567
  },
5426
5568
  mean: {
5427
5569
  name: 'mean',
5428
5570
  label: 'Mean Pixel',
5429
5571
  value: singleArrayAsNumber(mean),
5430
- unit: null,
5572
+ unit,
5431
5573
  },
5432
5574
  stdDev: {
5433
5575
  name: 'stdDev',
5434
5576
  label: 'Standard Deviation',
5435
5577
  value: singleArrayAsNumber(stdDev),
5436
- unit: null,
5437
- },
5438
- stdDevWithSumSquare: {
5439
- name: 'stdDevWithSumSquare',
5440
- value: singleArrayAsNumber(stdDevWithSumSquare),
5441
- unit: null,
5578
+ unit,
5442
5579
  },
5443
5580
  count: {
5444
5581
  name: 'count',
@@ -5446,14 +5583,17 @@ class BasicStatsCalculator extends basic_Calculator {
5446
5583
  value: this.count,
5447
5584
  unit: null,
5448
5585
  },
5586
+ pointsInShape: this.pointsInShape,
5449
5587
  array: [],
5450
5588
  };
5451
- named.array.push(named.max, named.mean, named.stdDev, named.stdDevWithSumSquare, named.count);
5589
+ named.array.push(named.max, named.mean, named.stdDev, named.stdDev, named.count);
5452
5590
  this.max = [-Infinity];
5591
+ this.min = [Infinity];
5453
5592
  this.sum = [0];
5454
- this.sumSquares = [0];
5455
- this.squaredDiffSum = [0];
5593
+ this.m2 = [0];
5594
+ this.runMean = [0];
5456
5595
  this.count = 0;
5596
+ this.pointsInShape = PointsManager.create3(1024);
5457
5597
  return named;
5458
5598
  }; }
5459
5599
  }
@@ -10157,10 +10297,144 @@ var ColorbarRangeTextPosition;
10157
10297
 
10158
10298
  /***/ }),
10159
10299
 
10160
- /***/ 10413:
10161
- /***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {
10300
+ /***/ 14149:
10301
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
10302
+
10303
+
10304
+ // EXPORTS
10305
+ __webpack_require__.d(__webpack_exports__, {
10306
+ windowLevel: () => (/* reexport */ windowlevel_namespaceObject)
10307
+ });
10308
+
10309
+ // UNUSED EXPORTS: colorbar
10310
+
10311
+ // NAMESPACE OBJECT: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/voi/windowlevel/index.js
10312
+ var windowlevel_namespaceObject = {};
10313
+ __webpack_require__.r(windowlevel_namespaceObject);
10314
+ __webpack_require__.d(windowlevel_namespaceObject, {
10315
+ calculateMinMaxMean: () => (calculateMinMaxMean),
10316
+ extractWindowLevelRegionToolData: () => (extractWindowLevelRegionToolData),
10317
+ getLuminanceFromRegion: () => (getLuminanceFromRegion)
10318
+ });
10319
+
10320
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/voi/colorbar/index.js
10321
+ var colorbar = __webpack_require__(64690);
10322
+ ;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/voi/windowlevel/getLuminanceFromRegion.js
10323
+ function getLuminanceFromRegion(imageData, x, y, width, height) {
10324
+ const luminance = [];
10325
+ let index = 0;
10326
+ const pixelData = imageData.scalarData;
10327
+ let spIndex, row, column;
10328
+ if (imageData.color) {
10329
+ for (row = 0; row < height; row++) {
10330
+ for (column = 0; column < width; column++) {
10331
+ spIndex = ((row + y) * imageData.columns + (column + x)) * 4;
10332
+ const red = pixelData[spIndex];
10333
+ const green = pixelData[spIndex + 1];
10334
+ const blue = pixelData[spIndex + 2];
10335
+ luminance[index++] = 0.2126 * red + 0.7152 * green + 0.0722 * blue;
10336
+ }
10337
+ }
10338
+ }
10339
+ else {
10340
+ for (row = 0; row < height; row++) {
10341
+ for (column = 0; column < width; column++) {
10342
+ spIndex = (row + y) * imageData.columns + (column + x);
10343
+ luminance[index++] = pixelData[spIndex];
10344
+ }
10345
+ }
10346
+ }
10347
+ return luminance;
10348
+ }
10349
+
10350
+
10351
+ ;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/voi/windowlevel/calculateMinMaxMean.js
10352
+ function calculateMinMaxMean(pixelLuminance, globalMin, globalMax) {
10353
+ const numPixels = pixelLuminance.length;
10354
+ let min = globalMax;
10355
+ let max = globalMin;
10356
+ let sum = 0;
10357
+ if (numPixels < 2) {
10358
+ return {
10359
+ min,
10360
+ max,
10361
+ mean: (globalMin + globalMax) / 2,
10362
+ };
10363
+ }
10364
+ for (let index = 0; index < numPixels; index++) {
10365
+ const spv = pixelLuminance[index];
10366
+ min = Math.min(min, spv);
10367
+ max = Math.max(max, spv);
10368
+ sum += spv;
10369
+ }
10370
+ return {
10371
+ min,
10372
+ max,
10373
+ mean: sum / numPixels,
10374
+ };
10375
+ }
10376
+
10377
+
10378
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/index.js + 28 modules
10379
+ var esm = __webpack_require__(92136);
10380
+ ;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/voi/windowlevel/extractWindowLevelRegionToolData.js
10381
+
10382
+ function extractWindowLevelRegionToolData(viewport) {
10383
+ if (viewport instanceof esm.VolumeViewport) {
10384
+ return extractImageDataVolume(viewport);
10385
+ }
10386
+ if (viewport instanceof esm.StackViewport) {
10387
+ return extractImageDataStack(viewport);
10388
+ }
10389
+ throw new Error('Viewport not supported');
10390
+ }
10391
+ function extractImageDataVolume(viewport) {
10392
+ const { scalarData, width, height } = esm.utilities.getCurrentVolumeViewportSlice(viewport);
10393
+ const { min: minPixelValue, max: maxPixelValue } = esm.utilities.getMinMax(scalarData);
10394
+ const volumeId = viewport.getVolumeId();
10395
+ const volume = esm.cache.getVolume(volumeId);
10396
+ const { metadata, cornerstoneImageMetaData } = volume;
10397
+ const { Rows: rows, Columns: columns } = metadata;
10398
+ const { color } = cornerstoneImageMetaData;
10399
+ return {
10400
+ scalarData,
10401
+ width,
10402
+ height,
10403
+ minPixelValue,
10404
+ maxPixelValue,
10405
+ rows,
10406
+ columns,
10407
+ color,
10408
+ };
10409
+ }
10410
+ function extractImageDataStack(viewport) {
10411
+ const imageData = viewport.getImageData();
10412
+ const { scalarData } = imageData;
10413
+ const { min: minPixelValue, max: maxPixelValue } = esm.utilities.getMinMax(scalarData);
10414
+ const width = imageData.dimensions[0];
10415
+ const height = imageData.dimensions[1];
10416
+ const { rows, columns, color } = viewport.getCornerstoneImage();
10417
+ return {
10418
+ scalarData,
10419
+ width,
10420
+ height,
10421
+ minPixelValue,
10422
+ maxPixelValue,
10423
+ rows,
10424
+ columns,
10425
+ color,
10426
+ };
10427
+ }
10428
+
10429
+
10430
+ ;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/voi/windowlevel/index.js
10431
+
10432
+
10433
+
10434
+
10435
+
10436
+ ;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/voi/index.js
10162
10437
 
10163
- /* harmony import */ var _colorbar__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(64690);
10164
10438
 
10165
10439
 
10166
10440