@ohif/app 3.9.0-beta.2 → 3.9.0-beta.21

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 (46) hide show
  1. package/dist/{117.bundle.a80b1511ef4b302fb7cc.js → 117.bundle.772ce244eee25d9b7316.js} +50 -15
  2. package/dist/{121.bundle.a6063e0272df61cefccc.js → 121.bundle.b582314ec0024fdf2d15.js} +1 -0
  3. package/dist/{164.bundle.1da1cadb56951caef1d6.js → 164.bundle.3221590f5e6855086889.js} +318 -41
  4. package/dist/{236.bundle.4ca7987e1d57f60ec13a.js → 236.bundle.d3a631d79ee8952e3c60.js} +388 -55
  5. package/dist/{188.bundle.b31173cb165eb21c3ec6.js → 243.bundle.866dc990219240efa81f.js} +8 -8
  6. package/dist/{325.bundle.47f5b8a085837ee6b512.js → 325.bundle.d8bf863ddebb832dcaab.js} +10 -11
  7. package/dist/{342.bundle.340982440de15f540a89.js → 342.bundle.67c49f2e52829a5696a4.js} +7 -0
  8. package/dist/{473.bundle.6cd4be953853f35b29c3.js → 367.bundle.6a0746aeca702ae6eba6.js} +279 -29
  9. package/dist/{806.bundle.50e039eb624382ee1fce.js → 370.bundle.baa389d217c390b0e92b.js} +81 -10
  10. package/dist/{206.bundle.e98e6ba9bfd9f36dc508.js → 390.bundle.504391bda56219cc9ef9.js} +37 -26
  11. package/dist/{448.bundle.94a6da9fac68fc69f8c2.js → 448.bundle.67539d1552db51aaca85.js} +2 -2
  12. package/dist/{483.bundle.a353efc5a5dd563c903c.js → 483.bundle.016de3c3ec209d9fa42a.js} +16 -3
  13. package/dist/{487.bundle.71a2893d94d214741e13.js → 487.bundle.3f0e64e16189f92fcebc.js} +2 -2
  14. package/dist/{35.bundle.0168d78bfad0cb784112.js → 501.bundle.7d5003758fa3ffbb344b.js} +750 -247
  15. package/dist/{530.bundle.207b38c15c4c01e4db0e.js → 530.bundle.17b9a34fefff133e5379.js} +3 -3
  16. package/dist/{544.bundle.b005b8c8b9b08aaa3324.js → 544.bundle.4d1fb477b572f50f4220.js} +3 -3
  17. package/dist/{321.bundle.07e853e559665d6e15b6.js → 550.bundle.41e6a1eacc49db2358c5.js} +50 -19
  18. package/dist/{574.bundle.88b619217339b5e93d3e.js → 574.bundle.0bcd9d70f4b1eea48082.js} +35 -32
  19. package/dist/{41.bundle.faaf3b05d1083e3c8831.js → 682.bundle.066197792e6a0d01b669.js} +26 -6
  20. package/dist/{699.bundle.8210579412d62beafa91.js → 699.bundle.428f20dd60662f1e5edd.js} +32 -3
  21. package/dist/{669.bundle.84745782e36f25eb05bc.js → 721.bundle.d21827d733e8811e0b18.js} +73 -73
  22. package/dist/{722.bundle.2547630541b670f10d6e.js → 722.bundle.1242e0348afc63ca4f5e.js} +10 -4
  23. package/dist/{724.bundle.519141a0c4d0d1a3192a.js → 776.bundle.981d8227b59f97f11dd8.js} +17 -12
  24. package/dist/{862.bundle.4a0bd82b803ba158018f.js → 862.bundle.7a102f04ef4d12686894.js} +1 -1
  25. package/dist/{889.bundle.9fbab4f0bbf643306879.js → 889.bundle.ed8937ba0c5455ed894d.js} +8 -8
  26. package/dist/{905.bundle.7e940707e10096970ca1.js → 905.bundle.b101088a20887c27945d.js} +2 -2
  27. package/dist/{907.bundle.f5aa0414d0f77e575a1f.js → 907.bundle.e8d22a858051cd255c9c.js} +2 -2
  28. package/dist/{94.bundle.ecaaba845625d93bad6b.js → 94.bundle.b4f45b237188a8550a35.js} +38 -8
  29. package/dist/{961.bundle.ff7da8afd7d8495d0bbe.js → 961.bundle.b86b71c712fa83e526d3.js} +2 -2
  30. package/dist/{7.bundle.3a17fe8266b2149334a6.js → 981.bundle.7b03f5a200c7dbcbaf1d.js} +10 -9
  31. package/dist/{594.bundle.01b124740b2b3f8a6d20.js → 989.bundle.e81da55a6954a12e5ea1.js} +5 -5
  32. package/dist/{633.bundle.ff1a1d0bdb0d1ef143af.js → 998.bundle.37015da90e590043cda0.js} +7 -7
  33. package/dist/app-config.js +5 -1
  34. package/dist/{app.bundle.c53b289734d5f7178a39.js → app.bundle.a6bfec031243c17f92e9.js} +686 -555
  35. package/dist/app.bundle.css +1 -1
  36. package/dist/cornerstoneDICOMImageLoader.min.js +1 -1
  37. package/dist/cornerstoneDICOMImageLoader.min.js.map +1 -1
  38. package/dist/google.js +1 -0
  39. package/dist/index.html +1 -1
  40. package/dist/{polySeg.bundle.1799686b019040500219.js → polySeg.bundle.b0392069f29e128b4efa.js} +3 -3
  41. package/dist/{suv-peak-worker.bundle.25f8b85eab9ec06da48d.js → suv-peak-worker.bundle.f823d84fae4ce6865f9a.js} +3 -3
  42. package/dist/sw.js +1 -1
  43. package/package.json +20 -19
  44. /package/dist/{321.css → 550.css} +0 -0
  45. /package/dist/{783.bundle.86c38ee55f4d01b111ca.js → 783.bundle.c5b7e2433ecb9d8e2541.js} +0 -0
  46. /package/dist/{633.css → 998.css} +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,102 @@ class AnnotationFrameRange {
3313
3330
  }
3314
3331
 
3315
3332
 
3333
+ /***/ }),
3334
+
3335
+ /***/ 25781:
3336
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3337
+
3338
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3339
+ /* harmony export */ x: () => (/* binding */ getClosestImageIdForStackViewport)
3340
+ /* harmony export */ });
3341
+ /* unused harmony export annotationHydration */
3342
+ /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(92136);
3343
+ /* harmony import */ var _stateManagement__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(95778);
3344
+ /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44753);
3345
+
3346
+
3347
+
3348
+ function annotationHydration(viewport, toolName, worldPoints, options) {
3349
+ const viewReference = viewport.getViewReference();
3350
+ const { viewPlaneNormal, FrameOfReferenceUID } = viewReference;
3351
+ const annotation = {
3352
+ annotationUID: options?.annotationUID || utilities.uuidv4(),
3353
+ data: {
3354
+ handles: {
3355
+ points: worldPoints,
3356
+ },
3357
+ },
3358
+ highlighted: false,
3359
+ autoGenerated: false,
3360
+ invalidated: false,
3361
+ isLocked: false,
3362
+ isVisible: true,
3363
+ metadata: {
3364
+ toolName,
3365
+ viewPlaneNormal,
3366
+ FrameOfReferenceUID,
3367
+ referencedImageId: getReferencedImageId(viewport, worldPoints[0], viewPlaneNormal),
3368
+ ...options,
3369
+ },
3370
+ };
3371
+ addAnnotation(annotation, viewport.element);
3372
+ return annotation;
3373
+ }
3374
+ function getReferencedImageId(viewport, worldPos, viewPlaneNormal) {
3375
+ let referencedImageId;
3376
+ if (viewport instanceof StackViewport) {
3377
+ referencedImageId = getClosestImageIdForStackViewport(viewport, worldPos, viewPlaneNormal);
3378
+ }
3379
+ else if (viewport instanceof BaseVolumeViewport) {
3380
+ const targetId = getTargetId(viewport);
3381
+ const volumeId = utilities.getVolumeId(targetId);
3382
+ const imageVolume = cache.getVolume(volumeId);
3383
+ referencedImageId = utilities.getClosestImageId(imageVolume, worldPos, viewPlaneNormal);
3384
+ }
3385
+ else {
3386
+ throw new Error('getReferencedImageId: viewport must be a StackViewport or BaseVolumeViewport');
3387
+ }
3388
+ return referencedImageId;
3389
+ }
3390
+ function getTargetId(viewport) {
3391
+ const targetId = viewport.getReferenceId?.();
3392
+ if (targetId) {
3393
+ return targetId;
3394
+ }
3395
+ if (viewport instanceof BaseVolumeViewport) {
3396
+ return `volumeId:${getTargetVolumeId(viewport)}`;
3397
+ }
3398
+ throw new Error('getTargetId: viewport must have a getTargetId method');
3399
+ }
3400
+ function getTargetVolumeId(viewport) {
3401
+ const actorEntries = viewport.getActors();
3402
+ if (!actorEntries) {
3403
+ return;
3404
+ }
3405
+ return actorEntries.find((actorEntry) => actorEntry.actor.getClassName() === 'vtkVolume')?.uid;
3406
+ }
3407
+ function getClosestImageIdForStackViewport(viewport, worldPos, viewPlaneNormal) {
3408
+ const imageIds = viewport.getImageIds();
3409
+ if (!imageIds || !imageIds.length) {
3410
+ return;
3411
+ }
3412
+ const distanceImagePairs = imageIds.map((imageId) => {
3413
+ const { imagePositionPatient } = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.metaData.get('imagePlaneModule', imageId);
3414
+ const distance = calculateDistanceToImage(worldPos, imagePositionPatient, viewPlaneNormal);
3415
+ return { imageId, distance };
3416
+ });
3417
+ distanceImagePairs.sort((a, b) => a.distance - b.distance);
3418
+ return distanceImagePairs[0].imageId;
3419
+ }
3420
+ function calculateDistanceToImage(worldPos, ImagePositionPatient, viewPlaneNormal) {
3421
+ const dir = gl_matrix__WEBPACK_IMPORTED_MODULE_2__/* .vec3.create */ .eR.create();
3422
+ gl_matrix__WEBPACK_IMPORTED_MODULE_2__/* .vec3.sub */ .eR.sub(dir, worldPos, ImagePositionPatient);
3423
+ const dot = gl_matrix__WEBPACK_IMPORTED_MODULE_2__/* .vec3.dot */ .eR.dot(dir, viewPlaneNormal);
3424
+ return Math.abs(dot);
3425
+ }
3426
+
3427
+
3428
+
3316
3429
  /***/ }),
3317
3430
 
3318
3431
  /***/ 42290:
@@ -3795,6 +3908,9 @@ function _createCinePlayContext(viewport, playClipOptions) {
3795
3908
  /***/ 88484:
3796
3909
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3797
3910
 
3911
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3912
+ /* harmony export */ Ay: () => (__WEBPACK_DEFAULT_EXPORT__)
3913
+ /* harmony export */ });
3798
3914
  /* unused harmony exports clip, clipToBox */
3799
3915
  function clip(val, low, high) {
3800
3916
  return Math.min(Math.max(low, val), high);
@@ -3803,7 +3919,7 @@ function clipToBox(point, box) {
3803
3919
  point.x = clip(point.x, 0, box.width);
3804
3920
  point.y = clip(point.y, 0, box.height);
3805
3921
  }
3806
- /* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = ((/* unused pure expression or super */ null && (clip)));
3922
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (clip);
3807
3923
 
3808
3924
 
3809
3925
  /***/ }),
@@ -5159,6 +5275,7 @@ function getViewportForAnnotation(annotation) {
5159
5275
 
5160
5276
  // EXPORTS
5161
5277
  __webpack_require__.d(__webpack_exports__, {
5278
+ clip: () => (/* reexport */ clip/* default */.Ay),
5162
5279
  debounce: () => (/* reexport */ debounce/* default */.A),
5163
5280
  getCalibratedLengthUnitsAndScale: () => (/* reexport */ getCalibratedUnits/* getCalibratedLengthUnitsAndScale */.Op),
5164
5281
  math: () => (/* reexport */ math),
@@ -5172,7 +5289,7 @@ __webpack_require__.d(__webpack_exports__, {
5172
5289
  triggerAnnotationRenderForViewportIds: () => (/* reexport */ triggerAnnotationRenderForViewportIds/* default */.A)
5173
5290
  });
5174
5291
 
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
5292
+ // UNUSED EXPORTS: annotationFrameRange, annotationHydration, boundingBox, calibrateImageSpacing, cine, contourSegmentation, contours, drawing, dynamicVolume, getAnnotationNearPoint, getAnnotationNearPointOnEnabledElement, getCalibratedAspect, getCalibratedProbeUnitsAndValue, getClosestImageIdForStackViewport, getSphereBoundsInfo, getViewportForAnnotation, isObject, jumpToSlice, orientation, planar, planarFreehandROITool, pointInSurroundingSphereCallback, rectangleROITool, segmentation, stackContextPrefetch, stackPrefetch, touch, triggerAnnotationRender, triggerEvent, viewport, viewportFilters, voi
5176
5293
 
5177
5294
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/index.js + 28 modules
5178
5295
  var esm = __webpack_require__(92136);
@@ -5212,6 +5329,8 @@ var annotationFrameRange = __webpack_require__(41209);
5212
5329
  var pointInSurroundingSphereCallback = __webpack_require__(5093);
5213
5330
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/getViewportForAnnotation.js
5214
5331
  var getViewportForAnnotation = __webpack_require__(39490);
5332
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/annotationHydration.js
5333
+ var annotationHydration = __webpack_require__(25781);
5215
5334
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/index.js
5216
5335
  var contours = __webpack_require__(75534);
5217
5336
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/segmentation/index.js
@@ -5251,8 +5370,8 @@ var touch = __webpack_require__(54868);
5251
5370
  var dynamicVolume = __webpack_require__(16390);
5252
5371
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/polyData/utils.js
5253
5372
  var utils = __webpack_require__(46514);
5254
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/voi/index.js
5255
- var voi = __webpack_require__(10413);
5373
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/voi/index.js + 4 modules
5374
+ var voi = __webpack_require__(14149);
5256
5375
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contourSegmentation/index.js
5257
5376
  var contourSegmentation = __webpack_require__(7259);
5258
5377
  ;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/index.js
@@ -5291,6 +5410,7 @@ var contourSegmentation = __webpack_require__(7259);
5291
5410
 
5292
5411
 
5293
5412
 
5413
+
5294
5414
 
5295
5415
 
5296
5416
  const roundNumber = esm.utilities.roundNumber;
@@ -5383,6 +5503,8 @@ __webpack_require__.d(__webpack_exports__, {
5383
5503
 
5384
5504
  // UNUSED EXPORTS: Calculator
5385
5505
 
5506
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/index.js + 28 modules
5507
+ var esm = __webpack_require__(92136);
5386
5508
  ;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/math/basic/Calculator.js
5387
5509
  class Calculator {
5388
5510
  }
@@ -5390,55 +5512,73 @@ class Calculator {
5390
5512
 
5391
5513
  ;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/math/basic/BasicStatsCalculator.js
5392
5514
 
5515
+
5516
+ const { PointsManager } = esm.utilities;
5393
5517
  class BasicStatsCalculator extends basic_Calculator {
5394
5518
  static { this.max = [-Infinity]; }
5519
+ static { this.min = [Infinity]; }
5395
5520
  static { this.sum = [0]; }
5396
- static { this.sumSquares = [0]; }
5397
- static { this.squaredDiffSum = [0]; }
5398
5521
  static { this.count = 0; }
5399
- static { this.statsCallback = ({ value: newValue }) => {
5522
+ static { this.runMean = [0]; }
5523
+ static { this.m2 = [0]; }
5524
+ static { this.pointsInShape = PointsManager.create3(1024); }
5525
+ static statsInit(options) {
5526
+ if (options.noPointsCollection) {
5527
+ BasicStatsCalculator.pointsInShape = null;
5528
+ }
5529
+ }
5530
+ static { this.statsCallback = ({ value: newValue, pointLPS = null }) => {
5400
5531
  if (Array.isArray(newValue) &&
5401
5532
  newValue.length > 1 &&
5402
5533
  this.max.length === 1) {
5403
5534
  this.max.push(this.max[0], this.max[0]);
5535
+ this.min.push(this.min[0], this.min[0]);
5404
5536
  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]);
5537
+ this.runMean.push(0, 0);
5538
+ this.m2.push(this.m2[0], this.m2[0]);
5407
5539
  }
5540
+ this.pointsInShape?.push(pointLPS);
5408
5541
  const newArray = Array.isArray(newValue) ? newValue : [newValue];
5409
5542
  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)));
5543
+ this.max.map((it, idx) => {
5544
+ const value = newArray[idx];
5545
+ const delta = value - this.runMean[idx];
5546
+ this.sum[idx] += value;
5547
+ this.runMean[idx] += delta / this.count;
5548
+ const delta2 = value - this.runMean[idx];
5549
+ this.m2[idx] += delta * delta2;
5550
+ this.min[idx] = Math.min(this.min[idx], value);
5551
+ this.max[idx] = Math.max(it, value);
5552
+ });
5414
5553
  }; }
5415
- static { this.getStatistics = () => {
5554
+ static { this.getStatistics = (options) => {
5416
5555
  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));
5556
+ const stdDev = this.m2.map((squaredDiffSum) => Math.sqrt(squaredDiffSum / this.count));
5557
+ const unit = options?.unit || null;
5419
5558
  const named = {
5420
5559
  max: {
5421
5560
  name: 'max',
5422
5561
  label: 'Max Pixel',
5423
5562
  value: singleArrayAsNumber(this.max),
5424
- unit: null,
5563
+ unit,
5564
+ },
5565
+ min: {
5566
+ name: 'min',
5567
+ label: 'Min Pixel',
5568
+ value: singleArrayAsNumber(this.min),
5569
+ unit,
5425
5570
  },
5426
5571
  mean: {
5427
5572
  name: 'mean',
5428
5573
  label: 'Mean Pixel',
5429
5574
  value: singleArrayAsNumber(mean),
5430
- unit: null,
5575
+ unit,
5431
5576
  },
5432
5577
  stdDev: {
5433
5578
  name: 'stdDev',
5434
5579
  label: 'Standard Deviation',
5435
5580
  value: singleArrayAsNumber(stdDev),
5436
- unit: null,
5437
- },
5438
- stdDevWithSumSquare: {
5439
- name: 'stdDevWithSumSquare',
5440
- value: singleArrayAsNumber(stdDevWithSumSquare),
5441
- unit: null,
5581
+ unit,
5442
5582
  },
5443
5583
  count: {
5444
5584
  name: 'count',
@@ -5446,14 +5586,17 @@ class BasicStatsCalculator extends basic_Calculator {
5446
5586
  value: this.count,
5447
5587
  unit: null,
5448
5588
  },
5589
+ pointsInShape: this.pointsInShape,
5449
5590
  array: [],
5450
5591
  };
5451
- named.array.push(named.max, named.mean, named.stdDev, named.stdDevWithSumSquare, named.count);
5592
+ named.array.push(named.max, named.mean, named.stdDev, named.stdDev, named.count);
5452
5593
  this.max = [-Infinity];
5594
+ this.min = [Infinity];
5453
5595
  this.sum = [0];
5454
- this.sumSquares = [0];
5455
- this.squaredDiffSum = [0];
5596
+ this.m2 = [0];
5597
+ this.runMean = [0];
5456
5598
  this.count = 0;
5599
+ this.pointsInShape = PointsManager.create3(1024);
5457
5600
  return named;
5458
5601
  }; }
5459
5602
  }
@@ -10157,10 +10300,144 @@ var ColorbarRangeTextPosition;
10157
10300
 
10158
10301
  /***/ }),
10159
10302
 
10160
- /***/ 10413:
10161
- /***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {
10303
+ /***/ 14149:
10304
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
10305
+
10306
+
10307
+ // EXPORTS
10308
+ __webpack_require__.d(__webpack_exports__, {
10309
+ windowLevel: () => (/* reexport */ windowlevel_namespaceObject)
10310
+ });
10311
+
10312
+ // UNUSED EXPORTS: colorbar
10313
+
10314
+ // NAMESPACE OBJECT: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/voi/windowlevel/index.js
10315
+ var windowlevel_namespaceObject = {};
10316
+ __webpack_require__.r(windowlevel_namespaceObject);
10317
+ __webpack_require__.d(windowlevel_namespaceObject, {
10318
+ calculateMinMaxMean: () => (calculateMinMaxMean),
10319
+ extractWindowLevelRegionToolData: () => (extractWindowLevelRegionToolData),
10320
+ getLuminanceFromRegion: () => (getLuminanceFromRegion)
10321
+ });
10322
+
10323
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/voi/colorbar/index.js
10324
+ var colorbar = __webpack_require__(64690);
10325
+ ;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/voi/windowlevel/getLuminanceFromRegion.js
10326
+ function getLuminanceFromRegion(imageData, x, y, width, height) {
10327
+ const luminance = [];
10328
+ let index = 0;
10329
+ const pixelData = imageData.scalarData;
10330
+ let spIndex, row, column;
10331
+ if (imageData.color) {
10332
+ for (row = 0; row < height; row++) {
10333
+ for (column = 0; column < width; column++) {
10334
+ spIndex = ((row + y) * imageData.columns + (column + x)) * 4;
10335
+ const red = pixelData[spIndex];
10336
+ const green = pixelData[spIndex + 1];
10337
+ const blue = pixelData[spIndex + 2];
10338
+ luminance[index++] = 0.2126 * red + 0.7152 * green + 0.0722 * blue;
10339
+ }
10340
+ }
10341
+ }
10342
+ else {
10343
+ for (row = 0; row < height; row++) {
10344
+ for (column = 0; column < width; column++) {
10345
+ spIndex = (row + y) * imageData.columns + (column + x);
10346
+ luminance[index++] = pixelData[spIndex];
10347
+ }
10348
+ }
10349
+ }
10350
+ return luminance;
10351
+ }
10352
+
10353
+
10354
+ ;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/voi/windowlevel/calculateMinMaxMean.js
10355
+ function calculateMinMaxMean(pixelLuminance, globalMin, globalMax) {
10356
+ const numPixels = pixelLuminance.length;
10357
+ let min = globalMax;
10358
+ let max = globalMin;
10359
+ let sum = 0;
10360
+ if (numPixels < 2) {
10361
+ return {
10362
+ min,
10363
+ max,
10364
+ mean: (globalMin + globalMax) / 2,
10365
+ };
10366
+ }
10367
+ for (let index = 0; index < numPixels; index++) {
10368
+ const spv = pixelLuminance[index];
10369
+ min = Math.min(min, spv);
10370
+ max = Math.max(max, spv);
10371
+ sum += spv;
10372
+ }
10373
+ return {
10374
+ min,
10375
+ max,
10376
+ mean: sum / numPixels,
10377
+ };
10378
+ }
10379
+
10380
+
10381
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/index.js + 28 modules
10382
+ var esm = __webpack_require__(92136);
10383
+ ;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/voi/windowlevel/extractWindowLevelRegionToolData.js
10384
+
10385
+ function extractWindowLevelRegionToolData(viewport) {
10386
+ if (viewport instanceof esm.VolumeViewport) {
10387
+ return extractImageDataVolume(viewport);
10388
+ }
10389
+ if (viewport instanceof esm.StackViewport) {
10390
+ return extractImageDataStack(viewport);
10391
+ }
10392
+ throw new Error('Viewport not supported');
10393
+ }
10394
+ function extractImageDataVolume(viewport) {
10395
+ const { scalarData, width, height } = esm.utilities.getCurrentVolumeViewportSlice(viewport);
10396
+ const { min: minPixelValue, max: maxPixelValue } = esm.utilities.getMinMax(scalarData);
10397
+ const volumeId = viewport.getVolumeId();
10398
+ const volume = esm.cache.getVolume(volumeId);
10399
+ const { metadata, cornerstoneImageMetaData } = volume;
10400
+ const { Rows: rows, Columns: columns } = metadata;
10401
+ const { color } = cornerstoneImageMetaData;
10402
+ return {
10403
+ scalarData,
10404
+ width,
10405
+ height,
10406
+ minPixelValue,
10407
+ maxPixelValue,
10408
+ rows,
10409
+ columns,
10410
+ color,
10411
+ };
10412
+ }
10413
+ function extractImageDataStack(viewport) {
10414
+ const imageData = viewport.getImageData();
10415
+ const { scalarData } = imageData;
10416
+ const { min: minPixelValue, max: maxPixelValue } = esm.utilities.getMinMax(scalarData);
10417
+ const width = imageData.dimensions[0];
10418
+ const height = imageData.dimensions[1];
10419
+ const { rows, columns, color } = viewport.getCornerstoneImage();
10420
+ return {
10421
+ scalarData,
10422
+ width,
10423
+ height,
10424
+ minPixelValue,
10425
+ maxPixelValue,
10426
+ rows,
10427
+ columns,
10428
+ color,
10429
+ };
10430
+ }
10431
+
10432
+
10433
+ ;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/voi/windowlevel/index.js
10434
+
10435
+
10436
+
10437
+
10438
+
10439
+ ;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/voi/index.js
10162
10440
 
10163
- /* harmony import */ var _colorbar__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(64690);
10164
10441
 
10165
10442
 
10166
10443