@ohif/app 3.9.0-beta.4 → 3.9.0-beta.41

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 (233) hide show
  1. package/dist/{117.bundle.a80b1511ef4b302fb7cc.js → 117.bundle.1f7b56504d506e7259e3.js} +66 -69
  2. package/dist/{889.bundle.6df37a2db81b97f4a76a.js → 121.bundle.e65afd9bfd1a425d0050.js} +40 -12
  3. package/dist/{998.bundle.f2ba5b6c1aa0caa6d672.js → 129.bundle.0be30c39fe5d8557b083.js} +40 -25
  4. package/dist/{574.bundle.72bd5061ccd504235419.js → 139.bundle.09e5af0a9ae8a285af77.js} +25 -37
  5. package/dist/{989.bundle.bf32dc457ea9abccca09.js → 14.bundle.cfafff5ce33c8fe9e536.js} +5 -5
  6. package/dist/{783.bundle.1f650e1ef1b10d19870f.js → 140.bundle.ebaef33bd84b37213744.js} +2 -2
  7. package/dist/{164.bundle.1da1cadb56951caef1d6.js → 164.bundle.2b23bfbcb23497d7c87a.js} +548 -301
  8. package/dist/{544.bundle.e8227e98860e39636a00.js → 172.bundle.e0ee762bee7496d6491e.js} +16 -30
  9. package/dist/{487.bundle.a517b1d6cd2d82b9a7ea.js → 194.bundle.9044099acbadc4c02d04.js} +5 -5
  10. package/dist/{699.bundle.f62694527f6dfe417f81.js → 211.bundle.318a1dde2daf28c0ca7e.js} +43 -5
  11. package/dist/{776.bundle.91747df457143051f872.js → 218.bundle.e00a7676e115e4bd4f0f.js} +10 -12
  12. package/dist/{236.bundle.4ca7987e1d57f60ec13a.js → 236.bundle.34db90a140e37d34fd71.js} +544 -221
  13. package/dist/{530.bundle.17b9a34fefff133e5379.js → 265.bundle.b32a0cc143efa80ee3cc.js} +8 -12
  14. package/dist/{862.bundle.55dde21bab4c841b6259.js → 323.bundle.955cc8f5eb5c01295118.js} +5 -9
  15. package/dist/{342.bundle.340982440de15f540a89.js → 342.bundle.fcb2038060a062129d34.js} +7 -0
  16. package/dist/{550.bundle.4f728d9ab7a8c7685abd.js → 363.bundle.e7332abbff673d8a79e4.js} +234 -150
  17. package/dist/{806.bundle.50e039eb624382ee1fce.js → 370.bundle.bd9884c274c26a54dfae.js} +101 -18
  18. package/dist/{682.bundle.0909fbf9a76430e4bbc9.js → 382.bundle.3060bce26740a347900b.js} +38 -5
  19. package/dist/{907.bundle.d2c612ec56380e73df89.js → 444.bundle.1a872eddff40579d7c84.js} +4 -4
  20. package/dist/{483.bundle.a353efc5a5dd563c903c.js → 483.bundle.0f1848f6a2cf34829fef.js} +16 -3
  21. package/dist/{35.bundle.0168d78bfad0cb784112.js → 501.bundle.2f703ca4598a3be0d748.js} +950 -348
  22. package/dist/{905.bundle.c1c60224a599e789feb4.js → 552.bundle.61343aead612379fb815.js} +3 -3
  23. package/dist/{981.bundle.cccdc8caaa5a11f4a998.js → 555.bundle.e849661a6879ce530191.js} +14 -13
  24. package/dist/{939.bundle.9d93b2e47c52338747a2.js → 612.bundle.297a033523539e0b47f9.js} +2 -2
  25. package/dist/{295.bundle.9926ff25c6dbf53845b1.js → 675.bundle.c9720f40fd7c7e9b7e54.js} +5 -9
  26. package/dist/{325.bundle.1c54c1689fb4b1955e8c.js → 717.bundle.444382300af90e310557.js} +58 -26
  27. package/dist/{722.bundle.2547630541b670f10d6e.js → 722.bundle.1242e0348afc63ca4f5e.js} +10 -4
  28. package/dist/{121.bundle.b582314ec0024fdf2d15.js → 792.bundle.485ad2f98823a4b3feb1.js} +6 -10
  29. package/dist/{721.bundle.0de8f780088aee87dbd9.js → 799.bundle.1dde0deef2be81924d9d.js} +12 -12
  30. package/dist/{448.bundle.077b4b50ee63487516eb.js → 806.bundle.05f48607cfe443d63fc6.js} +19 -6
  31. package/dist/{297.bundle.194d8985ab974839b5b6.js → 837.bundle.ff9fe44bf863a5bceabc.js} +2 -2
  32. package/dist/{961.bundle.6aea7b3de9e93a9ebab1.js → 853.bundle.72427df14c9e5f55b0d6.js} +4 -4
  33. package/dist/{473.bundle.6cd4be953853f35b29c3.js → 914.bundle.e15be8089bf422ed7b51.js} +512 -274
  34. package/dist/{94.bundle.08683468d52365475d9a.js → 920.bundle.2ce2755d7ba79de478a2.js} +39 -9
  35. package/dist/{390.bundle.5a21388b461ee51db594.js → 944.bundle.260e4bf5a03ad05d11b7.js} +655 -95
  36. package/dist/{243.bundle.391c2805222b849abc2c.js → 989.bundle.50e94f736258c5d8f5b6.js} +4 -4
  37. package/dist/app-config.js +5 -1
  38. package/dist/{app.bundle.9e22e72ec23a08cde379.js → app.bundle.6834e46debda9e53f119.js} +167495 -48675
  39. package/dist/app.bundle.css +5 -4
  40. package/dist/assets/images/action-new-dialog.svg +14 -0
  41. package/dist/assets/images/arrow-down.svg +5 -0
  42. package/dist/assets/images/arrow-left-small.svg +6 -0
  43. package/dist/assets/images/arrow-left.svg +6 -0
  44. package/dist/assets/images/arrow-right-small.svg +6 -0
  45. package/dist/assets/images/arrow-right.svg +6 -0
  46. package/dist/assets/images/calendar.svg +5 -0
  47. package/dist/assets/images/cancel.svg +8 -0
  48. package/dist/assets/images/checkbox-active.svg +9 -0
  49. package/dist/assets/images/checkbox-checked.svg +9 -0
  50. package/dist/assets/images/checkbox-default.svg +3 -0
  51. package/dist/assets/images/checkbox-unchecked.svg +3 -0
  52. package/dist/assets/images/chevron-down.svg +3 -0
  53. package/dist/assets/images/chevron-left.svg +3 -0
  54. package/dist/assets/images/chevron-menu.svg +12 -0
  55. package/dist/assets/images/chevron-next.svg +6 -0
  56. package/dist/assets/images/chevron-prev.svg +6 -0
  57. package/dist/assets/images/chevron-right.svg +3 -0
  58. package/dist/assets/images/circled-checkmark.svg +6 -0
  59. package/dist/assets/images/clipboard.svg +1 -0
  60. package/dist/assets/images/closeIcon.svg +3 -0
  61. package/dist/assets/images/content-next.svg +9 -0
  62. package/dist/assets/images/content-prev.svg +9 -0
  63. package/dist/assets/images/dotted-circle.svg +3 -0
  64. package/dist/assets/images/edit-patient.svg +15 -0
  65. package/dist/assets/images/exclamation.svg +9 -0
  66. package/dist/assets/images/external-link.svg +5 -0
  67. package/dist/assets/images/eye-hidden.svg +8 -0
  68. package/dist/assets/images/eye-visible.svg +6 -0
  69. package/dist/assets/images/focus-frame-target.svg +13 -0
  70. package/dist/assets/images/group-layers.svg +6 -0
  71. package/dist/assets/images/icon-add.svg +15 -0
  72. package/dist/assets/images/icon-alert-small.svg +8 -0
  73. package/dist/assets/images/icon-chevron-patient.svg +12 -0
  74. package/dist/assets/images/icon-clear-field.svg +8 -0
  75. package/dist/assets/images/icon-close.svg +8 -0
  76. package/dist/assets/images/icon-color-lut.svg +23 -0
  77. package/dist/assets/images/icon-delete.svg +17 -0
  78. package/dist/assets/images/icon-disclosure-close.svg +12 -0
  79. package/dist/assets/images/icon-disclosure-open.svg +12 -0
  80. package/dist/assets/images/icon-display-settings.svg +21 -0
  81. package/dist/assets/images/icon-more-menu.svg +17 -0
  82. package/dist/assets/images/icon-mpr-alt.svg +9 -0
  83. package/dist/assets/images/icon-multiple-patients.svg +21 -0
  84. package/dist/assets/images/icon-next-inactive.svg +6 -0
  85. package/dist/assets/images/icon-next.svg +6 -0
  86. package/dist/assets/images/icon-patient.svg +13 -0
  87. package/dist/assets/images/icon-pause.svg +6 -0
  88. package/dist/assets/images/icon-play.svg +6 -0
  89. package/dist/assets/images/icon-prev-inactive.svg +6 -0
  90. package/dist/assets/images/icon-prev.svg +6 -0
  91. package/dist/assets/images/icon-rename.svg +15 -0
  92. package/dist/assets/images/icon-search.svg +9 -0
  93. package/dist/assets/images/icon-settings.svg +13 -0
  94. package/dist/assets/images/icon-status-alert.svg +8 -0
  95. package/dist/assets/images/icon-tool-scissor.svg +17 -0
  96. package/dist/assets/images/icon-toolbar-back.svg +12 -0
  97. package/dist/assets/images/icon-transferring.svg +6 -0
  98. package/dist/assets/images/icon-upload.svg +6 -0
  99. package/dist/assets/images/icons-alert-outline.svg +8 -0
  100. package/dist/assets/images/illustration-investigational-use.svg +20 -0
  101. package/dist/assets/images/info-action.svg +10 -0
  102. package/dist/assets/images/info-link.svg +7 -0
  103. package/dist/assets/images/info.svg +3 -0
  104. package/dist/assets/images/launch-arrow.svg +7 -0
  105. package/dist/assets/images/launch-info.svg +8 -0
  106. package/dist/assets/images/layout-advanced-3d-four-up.svg +13 -0
  107. package/dist/assets/images/layout-advanced-3d-main.svg +12 -0
  108. package/dist/assets/images/layout-advanced-3d-only.svg +9 -0
  109. package/dist/assets/images/layout-advanced-3d-primary.svg +12 -0
  110. package/dist/assets/images/layout-advanced-axial-primary.svg +11 -0
  111. package/dist/assets/images/layout-advanced-mpr.svg +11 -0
  112. package/dist/assets/images/layout-common-1x1.svg +9 -0
  113. package/dist/assets/images/layout-common-1x2.svg +10 -0
  114. package/dist/assets/images/layout-common-2x2.svg +11 -0
  115. package/dist/assets/images/layout-common-2x3.svg +12 -0
  116. package/dist/assets/images/list-bullets.svg +10 -0
  117. package/dist/assets/images/loading-ohif-mark.svg +5 -0
  118. package/dist/assets/images/lock.svg +1 -0
  119. package/dist/assets/images/logo-ohif-small.svg +5 -0
  120. package/dist/assets/images/magnifier.svg +7 -0
  121. package/dist/assets/images/navigation-panel-right-hide.svg +5 -0
  122. package/dist/assets/images/navigation-panel-right-reveal.svg +5 -0
  123. package/dist/assets/images/next-arrow.svg +12 -0
  124. package/dist/assets/images/notifications-error.svg +8 -0
  125. package/dist/assets/images/notifications-info.svg +8 -0
  126. package/dist/assets/images/notifications-success.svg +6 -0
  127. package/dist/assets/images/notifications-warning.svg +8 -0
  128. package/dist/assets/images/notificationwarning-diamond.svg +10 -0
  129. package/dist/assets/images/ohif-logo-color-darkbg.svg +20 -0
  130. package/dist/assets/images/ohif-logo.svg +18 -0
  131. package/dist/assets/images/old-play.svg +9 -0
  132. package/dist/assets/images/old-stop.svg +9 -0
  133. package/dist/assets/images/old-trash.svg +9 -0
  134. package/dist/assets/images/panel-group-more.svg +6 -0
  135. package/dist/assets/images/panel-group-open-close.svg +6 -0
  136. package/dist/assets/images/pencil.svg +4 -0
  137. package/dist/assets/images/power-off.svg +11 -0
  138. package/dist/assets/images/prev-arrow.svg +12 -0
  139. package/dist/assets/images/profile.svg +1 -0
  140. package/dist/assets/images/push-left.svg +5 -0
  141. package/dist/assets/images/push-right.svg +5 -0
  142. package/dist/assets/images/row-add.svg +8 -0
  143. package/dist/assets/images/row-edit.svg +9 -0
  144. package/dist/assets/images/row-hidden.svg +11 -0
  145. package/dist/assets/images/row-lock.svg +7 -0
  146. package/dist/assets/images/row-shown.svg +9 -0
  147. package/dist/assets/images/row-unlock.svg +7 -0
  148. package/dist/assets/images/settings.svg +6 -0
  149. package/dist/assets/images/side-panel-close-left.svg +14 -0
  150. package/dist/assets/images/side-panel-close-right.svg +14 -0
  151. package/dist/assets/images/sorting-active-down.svg +6 -0
  152. package/dist/assets/images/sorting-active-up.svg +6 -0
  153. package/dist/assets/images/sorting.svg +6 -0
  154. package/dist/assets/images/status-alert-warning.svg +9 -0
  155. package/dist/assets/images/status-alert.svg +7 -0
  156. package/dist/assets/images/status-locked.svg +7 -0
  157. package/dist/assets/images/status-tracked.svg +7 -0
  158. package/dist/assets/images/status-untracked.svg +6 -0
  159. package/dist/assets/images/tab-4d.svg +13 -0
  160. package/dist/assets/images/tab-linear.svg +8 -0
  161. package/dist/assets/images/tab-patient-info.svg +7 -0
  162. package/dist/assets/images/tab-roi-threshold.svg +10 -0
  163. package/dist/assets/images/tab-segmentation.svg +11 -0
  164. package/dist/assets/images/tab-studies.svg +13 -0
  165. package/dist/assets/images/tool-3d-rotate.svg +20 -0
  166. package/dist/assets/images/tool-angle.svg +12 -0
  167. package/dist/assets/images/tool-annotate.svg +11 -0
  168. package/dist/assets/images/tool-bidirectional.svg +21 -0
  169. package/dist/assets/images/tool-calibrate.svg +19 -0
  170. package/dist/assets/images/tool-capture.svg +10 -0
  171. package/dist/assets/images/tool-cine.svg +9 -0
  172. package/dist/assets/images/tool-circle.svg +8 -0
  173. package/dist/assets/images/tool-cobb-angle.svg +14 -0
  174. package/dist/assets/images/tool-create-threshold.svg +9 -0
  175. package/dist/assets/images/tool-crosshair.svg +14 -0
  176. package/dist/assets/images/tool-dicom-tag-browser.svg +15 -0
  177. package/dist/assets/images/tool-flip-horizontal.svg +10 -0
  178. package/dist/assets/images/tool-freehand-polygon.svg +37 -0
  179. package/dist/assets/images/tool-freehand-roi.svg +12 -0
  180. package/dist/assets/images/tool-freehand.svg +34 -0
  181. package/dist/assets/images/tool-fusion-color.svg +13 -0
  182. package/dist/assets/images/tool-invert.svg +10 -0
  183. package/dist/assets/images/tool-layout-default.svg +22 -0
  184. package/dist/assets/images/tool-length.svg +16 -0
  185. package/dist/assets/images/tool-magnetic-roi.svg +17 -0
  186. package/dist/assets/images/tool-magnify.svg +7 -0
  187. package/dist/assets/images/tool-measure-elipse.svg +12 -0
  188. package/dist/assets/images/tool-more-menu.svg +6 -0
  189. package/dist/assets/images/tool-move.svg +13 -0
  190. package/dist/assets/images/tool-polygon.svg +3 -0
  191. package/dist/assets/images/tool-quick-magnify.svg +11 -0
  192. package/dist/assets/images/tool-rectangle.svg +12 -0
  193. package/dist/assets/images/tool-reference-lines.svg +13 -0
  194. package/dist/assets/images/tool-reset.svg +9 -0
  195. package/dist/assets/images/tool-rotate-right.svg +12 -0
  196. package/dist/assets/images/tool-seg-brush.svg +9 -0
  197. package/dist/assets/images/tool-seg-eraser.svg +10 -0
  198. package/dist/assets/images/tool-seg-shape.svg +9 -0
  199. package/dist/assets/images/tool-seg-threshold.svg +17 -0
  200. package/dist/assets/images/tool-spline-roi.svg +14 -0
  201. package/dist/assets/images/tool-stack-image-sync.svg +10 -0
  202. package/dist/assets/images/tool-stack-scroll.svg +10 -0
  203. package/dist/assets/images/tool-toggle-dicom-overlay.svg +9 -0
  204. package/dist/assets/images/tool-ultrasound-bidirectional.svg +15 -0
  205. package/dist/assets/images/tool-window-level.svg +9 -0
  206. package/dist/assets/images/tool-window-region.svg +12 -0
  207. package/dist/assets/images/tool-zoom.svg +9 -0
  208. package/dist/assets/images/tracked.svg +6 -0
  209. package/dist/assets/images/ui-arrow-down.svg +3 -0
  210. package/dist/assets/images/ui-arrow-left.svg +3 -0
  211. package/dist/assets/images/ui-arrow-right.svg +3 -0
  212. package/dist/assets/images/ui-arrow-up.svg +3 -0
  213. package/dist/assets/images/unlink.svg +9 -0
  214. package/dist/assets/images/viewport-status-tracked.svg +13 -0
  215. package/dist/assets/images/viewport-window-level.svg +17 -0
  216. package/dist/cornerstoneDICOMImageLoader.min.js +1 -1
  217. package/dist/cornerstoneDICOMImageLoader.min.js.map +1 -1
  218. package/dist/google.js +1 -0
  219. package/dist/{histogram-worker.bundle.829e14ec12c2b41a4323.js → histogram-worker.bundle.6b31e5ed4c4a7a6998f2.js} +2 -2
  220. package/dist/index.html +1 -1
  221. package/dist/{polySeg.bundle.1799686b019040500219.js → polySeg.bundle.df492df5042827938ba4.js} +3 -3
  222. package/dist/{suv-peak-worker.bundle.25f8b85eab9ec06da48d.js → suv-peak-worker.bundle.8f4b505fad3d371489fe.js} +4 -4
  223. package/dist/sw.js +1 -1
  224. package/package.json +26 -23
  225. /package/dist/{998.css → 129.css} +0 -0
  226. /package/dist/{574.css → 139.css} +0 -0
  227. /package/dist/{544.css → 172.css} +0 -0
  228. /package/dist/{550.css → 363.css} +0 -0
  229. /package/dist/{325.css → 404.css} +0 -0
  230. /package/dist/{481.css → 717.css} +0 -0
  231. /package/dist/{726.bundle.c8de818cf1a3ff0cf7d2.js → 726.bundle.90d63d40a19b058034ee.js} +0 -0
  232. /package/dist/{835.bundle.4c0eaa2c1a427ee41817.js → 835.bundle.5d1951da8bbc6afdf3e0.js} +0 -0
  233. /package/dist/{931.bundle.d270a1fda9a2836c3cc5.js → 931.bundle.058f8de4606f27b31f4f.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,914],{
3
3
 
4
4
  /***/ 25271:
5
5
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
@@ -7,7 +7,7 @@
7
7
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8
8
  /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
9
9
  /* harmony export */ });
10
- async function addImageSlicesToViewports(renderingEngine, stackInputs, viewportIds, immediateRender = false, suppressEvents = false) {
10
+ async function addImageSlicesToViewports(renderingEngine, stackInputs, viewportIds) {
11
11
  for (const viewportId of viewportIds) {
12
12
  const viewport = renderingEngine.getViewport(viewportId);
13
13
  if (!viewport) {
@@ -20,7 +20,7 @@ async function addImageSlicesToViewports(renderingEngine, stackInputs, viewportI
20
20
  }
21
21
  const addStackPromises = viewportIds.map(async (viewportId) => {
22
22
  const viewport = renderingEngine.getViewport(viewportId);
23
- return viewport.addImages(stackInputs, immediateRender, suppressEvents);
23
+ return viewport.addImages(stackInputs);
24
24
  });
25
25
  await Promise.all(addStackPromises);
26
26
  }
@@ -647,12 +647,24 @@ function createAndCacheDerivedImage(referencedImageId, options = {}, preventCach
647
647
  const { TypedArrayConstructor } = (0,_utilities__WEBPACK_IMPORTED_MODULE_4__.getBufferConfiguration)(options.targetBufferType, length);
648
648
  const imageScalarData = new TypedArrayConstructor(skipCreateBuffer ? 1 : length);
649
649
  const derivedImageId = imageId;
650
- ['imagePixelModule', 'imagePlaneModule', 'generalSeriesModule'].forEach((type) => {
650
+ ['imagePlaneModule', 'generalSeriesModule'].forEach((type) => {
651
651
  _utilities__WEBPACK_IMPORTED_MODULE_4__.genericMetadataProvider.add(derivedImageId, {
652
652
  type,
653
653
  metadata: ___WEBPACK_IMPORTED_MODULE_6__.metaData.get(type, referencedImageId),
654
654
  });
655
655
  });
656
+ const imagePixelModule = ___WEBPACK_IMPORTED_MODULE_6__.metaData.get('imagePixelModule', referencedImageId);
657
+ _utilities__WEBPACK_IMPORTED_MODULE_4__.genericMetadataProvider.add(derivedImageId, {
658
+ type: 'imagePixelModule',
659
+ metadata: {
660
+ ...imagePixelModule,
661
+ bitsAllocated: 8,
662
+ bitsStored: 8,
663
+ highBit: 7,
664
+ samplesPerPixel: 1,
665
+ pixelRepresentation: 0,
666
+ },
667
+ });
656
668
  const localImage = createAndCacheLocalImage({ scalarData: imageScalarData, onCacheAdd, skipCreateBuffer }, imageId, true);
657
669
  const imageLoadObject = {
658
670
  promise: Promise.resolve(localImage),
@@ -1114,9 +1126,23 @@ function generateVolumeScalarData(targetBuffer, scalarLength) {
1114
1126
  throw new Error(_enums_Events__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.CACHE_SIZE_EXCEEDED);
1115
1127
  }
1116
1128
  let volumeScalarData;
1117
- if (targetBuffer?.sharedArrayBuffer) {
1118
- const buffer = new SharedArrayBuffer(numBytes);
1119
- volumeScalarData = new TypedArrayConstructor(buffer);
1129
+ if (targetBuffer?.sharedArrayBuffer ?? (0,_init__WEBPACK_IMPORTED_MODULE_10__/* .getShouldUseSharedArrayBuffer */ .TB)()) {
1130
+ switch (targetBuffer.type) {
1131
+ case 'Float32Array':
1132
+ volumeScalarData = (0,_utilities__WEBPACK_IMPORTED_MODULE_9__.createFloat32SharedArray)(scalarLength);
1133
+ break;
1134
+ case 'Uint8Array':
1135
+ volumeScalarData = (0,_utilities__WEBPACK_IMPORTED_MODULE_9__.createUint8SharedArray)(scalarLength);
1136
+ break;
1137
+ case 'Uint16Array':
1138
+ volumeScalarData = (0,_utilities__WEBPACK_IMPORTED_MODULE_9__.createUint16SharedArray)(scalarLength);
1139
+ break;
1140
+ case 'Int16Array':
1141
+ volumeScalarData = (0,_utilities__WEBPACK_IMPORTED_MODULE_9__.createUint16SharedArray)(scalarLength);
1142
+ break;
1143
+ default:
1144
+ throw new Error('generateVolumeScalarData: SharedArrayBuffer is not supported for the specified target buffer type');
1145
+ }
1120
1146
  }
1121
1147
  else {
1122
1148
  volumeScalarData = new TypedArrayConstructor(scalarLength);
@@ -1554,7 +1580,7 @@ class CentralizedWorkerManager {
1554
1580
  /* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(61738);
1555
1581
  /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(55965);
1556
1582
  /* harmony import */ var _synchronizers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(42375);
1557
- /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2746);
1583
+ /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(49574);
1558
1584
  /* harmony import */ var _utilities__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(74119);
1559
1585
  /* harmony import */ var _cursors__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(32916);
1560
1586
  /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(40969);
@@ -1636,7 +1662,7 @@ class CentralizedWorkerManager {
1636
1662
  /* harmony import */ var _stateManagement_annotation_annotationLocking__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(48428);
1637
1663
  /* harmony import */ var _stateManagement_annotation_annotationVisibility__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(21009);
1638
1664
  /* 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);
1665
+ /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(49574);
1640
1666
  /* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(61738);
1641
1667
  /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(84901);
1642
1668
  /* harmony import */ var _utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(90252);
@@ -2310,6 +2336,7 @@ class BidirectionalTool extends _base__WEBPACK_IMPORTED_MODULE_4__/* .Annotation
2310
2336
  viewUp: [...viewUp],
2311
2337
  FrameOfReferenceUID,
2312
2338
  referencedImageId,
2339
+ ...viewport.getViewReference({ points: [worldPos] }),
2313
2340
  },
2314
2341
  data: {
2315
2342
  handles: {
@@ -2530,7 +2557,7 @@ class AnnotationTool extends _AnnotationDisplayTool__WEBPACK_IMPORTED_MODULE_2__
2530
2557
  if (viewport instanceof _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.BaseVolumeViewport) {
2531
2558
  const volumeId = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.utilities.getVolumeId(targetId);
2532
2559
  const volume = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.cache.getVolume(volumeId);
2533
- return volume.scaling?.PT !== undefined;
2560
+ return volume?.scaling?.PT !== undefined;
2534
2561
  }
2535
2562
  const scalingModule = imageId && _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.metaData.get('scalingModule', imageId);
2536
2563
  return typeof scalingModule?.suvbw === 'number';
@@ -2630,7 +2657,7 @@ __webpack_require__.d(__webpack_exports__, {
2630
2657
  t0: () => (/* reexport */ SegmentationDisplayTool/* default */.A)
2631
2658
  });
2632
2659
 
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
2660
+ // 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
2661
 
2635
2662
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/tools/base/index.js
2636
2663
  var base = __webpack_require__(96214);
@@ -2640,6 +2667,8 @@ var PanTool = __webpack_require__(25294);
2640
2667
  var TrackballRotateTool = __webpack_require__(15924);
2641
2668
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/tools/WindowLevelTool.js
2642
2669
  var WindowLevelTool = __webpack_require__(455);
2670
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/tools/WindowLevelRegionTool.js
2671
+ var WindowLevelRegionTool = __webpack_require__(60747);
2643
2672
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/tools/StackScrollTool.js
2644
2673
  var StackScrollTool = __webpack_require__(20132);
2645
2674
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/tools/PlanarRotateTool.js
@@ -2722,8 +2751,8 @@ var esm = __webpack_require__(92136);
2722
2751
  var stateManagement = __webpack_require__(95778);
2723
2752
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/annotation/annotationLocking.js
2724
2753
  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);
2754
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/drawingSvg/index.js + 18 modules
2755
+ var drawingSvg = __webpack_require__(49574);
2727
2756
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/viewportFilters/index.js + 4 modules
2728
2757
  var viewportFilters = __webpack_require__(90252);
2729
2758
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/cursors/elementCursor.js
@@ -3259,6 +3288,7 @@ var SegmentSelectTool = __webpack_require__(34041);
3259
3288
 
3260
3289
 
3261
3290
 
3291
+
3262
3292
 
3263
3293
 
3264
3294
  /***/ }),
@@ -3313,6 +3343,102 @@ class AnnotationFrameRange {
3313
3343
  }
3314
3344
 
3315
3345
 
3346
+ /***/ }),
3347
+
3348
+ /***/ 25781:
3349
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3350
+
3351
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3352
+ /* harmony export */ x: () => (/* binding */ getClosestImageIdForStackViewport)
3353
+ /* harmony export */ });
3354
+ /* unused harmony export annotationHydration */
3355
+ /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(92136);
3356
+ /* harmony import */ var _stateManagement__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(95778);
3357
+ /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44753);
3358
+
3359
+
3360
+
3361
+ function annotationHydration(viewport, toolName, worldPoints, options) {
3362
+ const viewReference = viewport.getViewReference();
3363
+ const { viewPlaneNormal, FrameOfReferenceUID } = viewReference;
3364
+ const annotation = {
3365
+ annotationUID: options?.annotationUID || utilities.uuidv4(),
3366
+ data: {
3367
+ handles: {
3368
+ points: worldPoints,
3369
+ },
3370
+ },
3371
+ highlighted: false,
3372
+ autoGenerated: false,
3373
+ invalidated: false,
3374
+ isLocked: false,
3375
+ isVisible: true,
3376
+ metadata: {
3377
+ toolName,
3378
+ viewPlaneNormal,
3379
+ FrameOfReferenceUID,
3380
+ referencedImageId: getReferencedImageId(viewport, worldPoints[0], viewPlaneNormal),
3381
+ ...options,
3382
+ },
3383
+ };
3384
+ addAnnotation(annotation, viewport.element);
3385
+ return annotation;
3386
+ }
3387
+ function getReferencedImageId(viewport, worldPos, viewPlaneNormal) {
3388
+ let referencedImageId;
3389
+ if (viewport instanceof StackViewport) {
3390
+ referencedImageId = getClosestImageIdForStackViewport(viewport, worldPos, viewPlaneNormal);
3391
+ }
3392
+ else if (viewport instanceof BaseVolumeViewport) {
3393
+ const targetId = getTargetId(viewport);
3394
+ const volumeId = utilities.getVolumeId(targetId);
3395
+ const imageVolume = cache.getVolume(volumeId);
3396
+ referencedImageId = utilities.getClosestImageId(imageVolume, worldPos, viewPlaneNormal);
3397
+ }
3398
+ else {
3399
+ throw new Error('getReferencedImageId: viewport must be a StackViewport or BaseVolumeViewport');
3400
+ }
3401
+ return referencedImageId;
3402
+ }
3403
+ function getTargetId(viewport) {
3404
+ const targetId = viewport.getReferenceId?.();
3405
+ if (targetId) {
3406
+ return targetId;
3407
+ }
3408
+ if (viewport instanceof BaseVolumeViewport) {
3409
+ return `volumeId:${getTargetVolumeId(viewport)}`;
3410
+ }
3411
+ throw new Error('getTargetId: viewport must have a getTargetId method');
3412
+ }
3413
+ function getTargetVolumeId(viewport) {
3414
+ const actorEntries = viewport.getActors();
3415
+ if (!actorEntries) {
3416
+ return;
3417
+ }
3418
+ return actorEntries.find((actorEntry) => actorEntry.actor.getClassName() === 'vtkVolume')?.uid;
3419
+ }
3420
+ function getClosestImageIdForStackViewport(viewport, worldPos, viewPlaneNormal) {
3421
+ const imageIds = viewport.getImageIds();
3422
+ if (!imageIds || !imageIds.length) {
3423
+ return;
3424
+ }
3425
+ const distanceImagePairs = imageIds.map((imageId) => {
3426
+ const { imagePositionPatient } = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.metaData.get('imagePlaneModule', imageId);
3427
+ const distance = calculateDistanceToImage(worldPos, imagePositionPatient, viewPlaneNormal);
3428
+ return { imageId, distance };
3429
+ });
3430
+ distanceImagePairs.sort((a, b) => a.distance - b.distance);
3431
+ return distanceImagePairs[0].imageId;
3432
+ }
3433
+ function calculateDistanceToImage(worldPos, ImagePositionPatient, viewPlaneNormal) {
3434
+ const dir = gl_matrix__WEBPACK_IMPORTED_MODULE_2__/* .vec3.create */ .eR.create();
3435
+ gl_matrix__WEBPACK_IMPORTED_MODULE_2__/* .vec3.sub */ .eR.sub(dir, worldPos, ImagePositionPatient);
3436
+ const dot = gl_matrix__WEBPACK_IMPORTED_MODULE_2__/* .vec3.dot */ .eR.dot(dir, viewPlaneNormal);
3437
+ return Math.abs(dot);
3438
+ }
3439
+
3440
+
3441
+
3316
3442
  /***/ }),
3317
3443
 
3318
3444
  /***/ 42290:
@@ -3795,6 +3921,9 @@ function _createCinePlayContext(viewport, playClipOptions) {
3795
3921
  /***/ 88484:
3796
3922
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3797
3923
 
3924
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3925
+ /* harmony export */ Ay: () => (__WEBPACK_DEFAULT_EXPORT__)
3926
+ /* harmony export */ });
3798
3927
  /* unused harmony exports clip, clipToBox */
3799
3928
  function clip(val, low, high) {
3800
3929
  return Math.min(Math.max(low, val), high);
@@ -3803,7 +3932,7 @@ function clipToBox(point, box) {
3803
3932
  point.x = clip(point.x, 0, box.width);
3804
3933
  point.y = clip(point.y, 0, box.height);
3805
3934
  }
3806
- /* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = ((/* unused pure expression or super */ null && (clip)));
3935
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (clip);
3807
3936
 
3808
3937
 
3809
3938
  /***/ }),
@@ -3912,57 +4041,90 @@ function removeContourSegmentationAnnotation(annotation) {
3912
4041
 
3913
4042
  /***/ }),
3914
4043
 
3915
- /***/ 93712:
3916
- /***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {
3917
-
3918
- /* harmony import */ var _RectangleROIStartEndThreshold__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69405);
4044
+ /***/ 53891:
4045
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3919
4046
 
3920
- function validateAnnotation(annotation) {
3921
- if (!annotation?.data) {
3922
- throw new Error('Tool data is empty');
4047
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4048
+ /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
4049
+ /* harmony export */ });
4050
+ function calculatePerimeter(polyline, closed) {
4051
+ let perimeter = 0;
4052
+ for (let i = 0; i < polyline.length - 1; i++) {
4053
+ const point1 = polyline[i];
4054
+ const point2 = polyline[i + 1];
4055
+ perimeter += Math.sqrt(Math.pow(point2[0] - point1[0], 2) + Math.pow(point2[1] - point1[1], 2));
3923
4056
  }
3924
- if (!annotation.metadata || annotation.metadata.referenceImageId) {
3925
- throw new Error('Tool data is not associated with any imageId');
4057
+ if (closed) {
4058
+ const firstPoint = polyline[0];
4059
+ const lastPoint = polyline[polyline.length - 1];
4060
+ perimeter += Math.sqrt(Math.pow(lastPoint[0] - firstPoint[0], 2) +
4061
+ Math.pow(lastPoint[1] - firstPoint[1], 2));
3926
4062
  }
4063
+ return perimeter;
3927
4064
  }
3928
- class AnnotationToPointData {
3929
- constructor() {
4065
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (calculatePerimeter);
4066
+
4067
+
4068
+ /***/ }),
4069
+
4070
+ /***/ 84045:
4071
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4072
+
4073
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4074
+ /* harmony export */ A: () => (/* binding */ findHandlePolylineIndex)
4075
+ /* harmony export */ });
4076
+ /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(92136);
4077
+ /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(44753);
4078
+
4079
+
4080
+ const { isEqual } = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.utilities;
4081
+ function findHandlePolylineIndex(annotation, handleIndex) {
4082
+ const { polyline } = annotation.data.contour;
4083
+ const { points } = annotation.data.handles;
4084
+ const { length } = points;
4085
+ if (handleIndex === length) {
4086
+ return polyline.length;
3930
4087
  }
3931
- static { this.TOOL_NAMES = {}; }
3932
- static convert(annotation, index, metadataProvider) {
3933
- validateAnnotation(annotation);
3934
- const { toolName } = annotation.metadata;
3935
- const toolClass = AnnotationToPointData.TOOL_NAMES[toolName];
3936
- if (!toolClass) {
3937
- throw new Error(`Unknown tool type: ${toolName}, cannot convert to RTSSReport`);
3938
- }
3939
- const ContourSequence = toolClass.getContourSequence(annotation, metadataProvider);
3940
- const color = [
3941
- Math.floor(Math.random() * 255),
3942
- Math.floor(Math.random() * 255),
3943
- Math.floor(Math.random() * 255),
3944
- ];
3945
- return {
3946
- ReferencedROINumber: index + 1,
3947
- ROIDisplayColor: color,
3948
- ContourSequence,
3949
- };
4088
+ if (handleIndex < 0) {
4089
+ handleIndex = (handleIndex + length) % length;
3950
4090
  }
3951
- static register(toolClass) {
3952
- AnnotationToPointData.TOOL_NAMES[toolClass.toolName] = toolClass;
4091
+ if (handleIndex === 0) {
4092
+ return 0;
4093
+ }
4094
+ const handle = points[handleIndex];
4095
+ const index = polyline.findIndex((point) => isEqual(handle, point));
4096
+ if (index !== -1) {
4097
+ return index;
3953
4098
  }
4099
+ let closestDistance = Infinity;
4100
+ return polyline.reduce((closestIndex, point, testIndex) => {
4101
+ const distance = gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec3.squaredDistance */ .eR.squaredDistance(point, handle);
4102
+ if (distance < closestDistance) {
4103
+ closestDistance = distance;
4104
+ return testIndex;
4105
+ }
4106
+ return closestIndex;
4107
+ }, -1);
3954
4108
  }
3955
- AnnotationToPointData.register(_RectangleROIStartEndThreshold__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A);
3956
- /* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = ((/* unused pure expression or super */ null && (AnnotationToPointData)));
3957
4109
 
3958
4110
 
3959
4111
  /***/ }),
3960
4112
 
3961
- /***/ 14633:
4113
+ /***/ 75908:
3962
4114
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3963
4115
 
3964
- /* unused harmony export default */
3965
- /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(44753);
4116
+
4117
+ // EXPORTS
4118
+ __webpack_require__.d(__webpack_exports__, {
4119
+ getContourHolesDataCanvas: () => (/* reexport */ getContourHolesDataCanvas),
4120
+ updateContourPolyline: () => (/* reexport */ updateContourPolyline/* default */.A)
4121
+ });
4122
+
4123
+ // UNUSED EXPORTS: AnnotationToPointData, acceptAutogeneratedInterpolations, areCoplanarContours, calculatePerimeter, contourFinder, detectContourHoles, findHandlePolylineIndex, generateContourSetsFromLabelmap, getContourHolesDataWorld, getDeduplicatedVTKPolyDataPoints, interpolation
4124
+
4125
+ // EXTERNAL MODULE: ../../../node_modules/gl-matrix/esm/index.js + 1 modules
4126
+ var esm = __webpack_require__(44753);
4127
+ ;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/areCoplanarContours.js
3966
4128
 
3967
4129
  function areCoplanarContours(firstAnnotation, secondAnnotation) {
3968
4130
  const { viewPlaneNormal: firstViewPlaneNormal } = firstAnnotation.metadata;
@@ -3979,39 +4141,7 @@ function areCoplanarContours(firstAnnotation, secondAnnotation) {
3979
4141
  return glMatrix.equals(firstDistance, secondDistance);
3980
4142
  }
3981
4143
 
3982
-
3983
- /***/ }),
3984
-
3985
- /***/ 53891:
3986
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3987
-
3988
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3989
- /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
3990
- /* harmony export */ });
3991
- function calculatePerimeter(polyline, closed) {
3992
- let perimeter = 0;
3993
- for (let i = 0; i < polyline.length - 1; i++) {
3994
- const point1 = polyline[i];
3995
- const point2 = polyline[i + 1];
3996
- perimeter += Math.sqrt(Math.pow(point2[0] - point1[0], 2) + Math.pow(point2[1] - point1[1], 2));
3997
- }
3998
- if (closed) {
3999
- const firstPoint = polyline[0];
4000
- const lastPoint = polyline[polyline.length - 1];
4001
- perimeter += Math.sqrt(Math.pow(lastPoint[0] - firstPoint[0], 2) +
4002
- Math.pow(lastPoint[1] - firstPoint[1], 2));
4003
- }
4004
- return perimeter;
4005
- }
4006
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (calculatePerimeter);
4007
-
4008
-
4009
- /***/ }),
4010
-
4011
- /***/ 11716:
4012
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4013
-
4014
- /* unused harmony exports findContours, findContoursFromReducedSet */
4144
+ ;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/contourFinder.js
4015
4145
  function findNextLink(line, lines, contourPoints) {
4016
4146
  let index = -1;
4017
4147
  lines.forEach((cell, i) => {
@@ -4067,21 +4197,62 @@ function findContours(lines) {
4067
4197
  return extraContours;
4068
4198
  }
4069
4199
  }
4070
- function findContoursFromReducedSet(lines) {
4200
+ function contourFinder_findContoursFromReducedSet(lines) {
4071
4201
  return findContours(lines);
4072
4202
  }
4073
- /* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = ({
4203
+ /* harmony default export */ const contourFinder = ({
4074
4204
  findContours,
4075
- findContoursFromReducedSet,
4205
+ findContoursFromReducedSet: contourFinder_findContoursFromReducedSet,
4076
4206
  });
4077
4207
 
4208
+ ;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/getDeduplicatedVTKPolyDataPoints.js
4209
+ function getDeduplicatedVTKPolyDataPoints_getDeduplicatedVTKPolyDataPoints(polyData, bypass = false) {
4210
+ const points = polyData.getPoints();
4211
+ const lines = polyData.getLines();
4212
+ const pointsArray = new Array(points.getNumberOfPoints())
4213
+ .fill(0)
4214
+ .map((_, i) => points.getPoint(i).slice());
4215
+ const linesArray = new Array(lines.getNumberOfCells()).fill(0).map((_, i) => {
4216
+ const cell = lines.getCell(i * 3).slice();
4217
+ return { a: cell[0], b: cell[1] };
4218
+ });
4219
+ if (bypass) {
4220
+ return { points: pointsArray, lines: linesArray };
4221
+ }
4222
+ const newPoints = [];
4223
+ for (const [i, pt] of pointsArray.entries()) {
4224
+ const index = newPoints.findIndex((point) => point[0] === pt[0] && point[1] === pt[1] && point[2] === pt[2]);
4225
+ if (index >= 0) {
4226
+ linesArray.map((line) => {
4227
+ if (line.a === i) {
4228
+ line.a = index;
4229
+ }
4230
+ if (line.b === i) {
4231
+ line.b = index;
4232
+ }
4233
+ return line;
4234
+ });
4235
+ }
4236
+ else {
4237
+ const newIndex = newPoints.length;
4238
+ newPoints.push(pt);
4239
+ linesArray.map((line) => {
4240
+ if (line.a === i) {
4241
+ line.a = newIndex;
4242
+ }
4243
+ if (line.b === i) {
4244
+ line.b = newIndex;
4245
+ }
4246
+ return line;
4247
+ });
4248
+ }
4249
+ }
4250
+ const newLines = linesArray.filter((line) => line.a !== line.b);
4251
+ return { points: newPoints, lines: newLines };
4252
+ }
4253
+ /* harmony default export */ const contours_getDeduplicatedVTKPolyDataPoints = ({ getDeduplicatedVTKPolyDataPoints: getDeduplicatedVTKPolyDataPoints_getDeduplicatedVTKPolyDataPoints });
4078
4254
 
4079
- /***/ }),
4080
-
4081
- /***/ 92806:
4082
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4083
-
4084
- /* unused harmony export processContourHoles */
4255
+ ;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/detectContourHoles.js
4085
4256
  const getIsPointInsidePolygon = (point, vertices) => {
4086
4257
  const x = point[0];
4087
4258
  const y = point[1];
@@ -4154,65 +4325,19 @@ function processContourHoles(contours, points, useXOR = true) {
4154
4325
  }
4155
4326
  return retContours;
4156
4327
  }
4157
- /* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = ({ processContourHoles });
4158
-
4159
-
4160
- /***/ }),
4161
-
4162
- /***/ 84045:
4163
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4164
-
4165
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4166
- /* harmony export */ A: () => (/* binding */ findHandlePolylineIndex)
4167
- /* harmony export */ });
4168
- /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(92136);
4169
- /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(44753);
4328
+ /* harmony default export */ const detectContourHoles = ({ processContourHoles });
4170
4329
 
4171
-
4172
- const { isEqual } = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.utilities;
4173
- function findHandlePolylineIndex(annotation, handleIndex) {
4174
- const { polyline } = annotation.data.contour;
4175
- const { points } = annotation.data.handles;
4176
- const { length } = points;
4177
- if (handleIndex === length) {
4178
- return polyline.length;
4179
- }
4180
- if (handleIndex < 0) {
4181
- handleIndex = (handleIndex + length) % length;
4182
- }
4183
- if (handleIndex === 0) {
4184
- return 0;
4185
- }
4186
- const handle = points[handleIndex];
4187
- const index = polyline.findIndex((point) => isEqual(handle, point));
4188
- if (index !== -1) {
4189
- return index;
4190
- }
4191
- let closestDistance = Infinity;
4192
- return polyline.reduce((closestIndex, point, testIndex) => {
4193
- const distance = gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec3.squaredDistance */ .eR.squaredDistance(point, handle);
4194
- if (distance < closestDistance) {
4195
- closestDistance = distance;
4196
- return testIndex;
4197
- }
4198
- return closestIndex;
4199
- }, -1);
4200
- }
4201
-
4202
-
4203
- /***/ }),
4204
-
4205
- /***/ 36392:
4206
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4207
-
4208
- /* unused harmony export generateContourSetsFromLabelmap */
4209
- /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(92136);
4210
- /* harmony import */ var _kitware_vtk_js_Filters_General_ImageMarchingSquares__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(52754);
4211
- /* harmony import */ var _kitware_vtk_js_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(45128);
4212
- /* harmony import */ var _kitware_vtk_js_Common_DataModel_ImageData__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(51250);
4213
- /* harmony import */ var _contours__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(75534);
4214
- /* harmony import */ var _contourFinder__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(11716);
4215
- /* harmony import */ var _enums_SegmentationRepresentations__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(83946);
4330
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/index.js + 28 modules
4331
+ var dist_esm = __webpack_require__(92136);
4332
+ // EXTERNAL MODULE: ../../../node_modules/@kitware/vtk.js/Filters/General/ImageMarchingSquares.js
4333
+ var ImageMarchingSquares = __webpack_require__(52754);
4334
+ // EXTERNAL MODULE: ../../../node_modules/@kitware/vtk.js/Common/Core/DataArray.js
4335
+ var DataArray = __webpack_require__(45128);
4336
+ // EXTERNAL MODULE: ../../../node_modules/@kitware/vtk.js/Common/DataModel/ImageData.js
4337
+ var ImageData = __webpack_require__(51250);
4338
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/enums/SegmentationRepresentations.js
4339
+ var SegmentationRepresentations = __webpack_require__(83946);
4340
+ ;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/generateContourSetsFromLabelmap.js
4216
4341
 
4217
4342
 
4218
4343
 
@@ -4220,7 +4345,7 @@ function findHandlePolylineIndex(annotation, handleIndex) {
4220
4345
 
4221
4346
 
4222
4347
 
4223
- const { Labelmap } = _enums_SegmentationRepresentations__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A;
4348
+ const { Labelmap } = SegmentationRepresentations/* default */.A;
4224
4349
  function generateContourSetsFromLabelmap({ segmentations }) {
4225
4350
  const { representationData, segments = [0, 1] } = segmentations;
4226
4351
  const { volumeId: segVolumeId } = representationData[Labelmap];
@@ -4323,19 +4448,61 @@ function isSliceEmptyForSegment(sliceIndex, segData, pixelsPerSlice, segIndex) {
4323
4448
  }
4324
4449
 
4325
4450
 
4451
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/RectangleROIStartEndThreshold.js
4452
+ var RectangleROIStartEndThreshold = __webpack_require__(69405);
4453
+ ;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/AnnotationToPointData.js
4326
4454
 
4327
- /***/ }),
4455
+ function validateAnnotation(annotation) {
4456
+ if (!annotation?.data) {
4457
+ throw new Error('Tool data is empty');
4458
+ }
4459
+ if (!annotation.metadata || annotation.metadata.referenceImageId) {
4460
+ throw new Error('Tool data is not associated with any imageId');
4461
+ }
4462
+ }
4463
+ class AnnotationToPointData {
4464
+ constructor() {
4465
+ }
4466
+ static { this.TOOL_NAMES = {}; }
4467
+ static convert(annotation, index, metadataProvider) {
4468
+ validateAnnotation(annotation);
4469
+ const { toolName } = annotation.metadata;
4470
+ const toolClass = AnnotationToPointData.TOOL_NAMES[toolName];
4471
+ if (!toolClass) {
4472
+ throw new Error(`Unknown tool type: ${toolName}, cannot convert to RTSSReport`);
4473
+ }
4474
+ const ContourSequence = toolClass.getContourSequence(annotation, metadataProvider);
4475
+ const color = [
4476
+ Math.floor(Math.random() * 255),
4477
+ Math.floor(Math.random() * 255),
4478
+ Math.floor(Math.random() * 255),
4479
+ ];
4480
+ return {
4481
+ ReferencedROINumber: index + 1,
4482
+ ROIDisplayColor: color,
4483
+ ContourSequence,
4484
+ };
4485
+ }
4486
+ static register(toolClass) {
4487
+ AnnotationToPointData.TOOL_NAMES[toolClass.toolName] = toolClass;
4488
+ }
4489
+ }
4490
+ AnnotationToPointData.register(RectangleROIStartEndThreshold/* default */.A);
4491
+ /* harmony default export */ const contours_AnnotationToPointData = ((/* unused pure expression or super */ null && (AnnotationToPointData)));
4328
4492
 
4329
- /***/ 88267:
4330
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4493
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/index.js
4494
+ var stateManagement = __webpack_require__(95778);
4495
+ ;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/getContourHolesDataWorld.js
4331
4496
 
4332
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4333
- /* harmony export */ A: () => (/* binding */ getContourHolesDataCanvas)
4334
- /* harmony export */ });
4335
- /* harmony import */ var _getContourHolesDataWorld__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(98043);
4497
+ function getContourHolesDataWorld(annotation) {
4498
+ const childAnnotationUIDs = annotation.childAnnotationUIDs ?? [];
4499
+ return childAnnotationUIDs.map((uid) => (0,stateManagement/* getAnnotation */.gw)(uid).data.contour.polyline);
4500
+ }
4501
+
4502
+ ;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/getContourHolesDataCanvas.js
4336
4503
 
4337
4504
  function getContourHolesDataCanvas(annotation, viewport) {
4338
- const worldHoleContours = (0,_getContourHolesDataWorld__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(annotation);
4505
+ const worldHoleContours = getContourHolesDataWorld(annotation);
4339
4506
  const canvasHoleContours = [];
4340
4507
  worldHoleContours.forEach((worldHoleContour) => {
4341
4508
  const numPoints = worldHoleContour.length;
@@ -4348,98 +4515,24 @@ function getContourHolesDataCanvas(annotation, viewport) {
4348
4515
  return canvasHoleContours;
4349
4516
  }
4350
4517
 
4518
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/updateContourPolyline.js
4519
+ var updateContourPolyline = __webpack_require__(89111);
4520
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/segmentation/InterpolationManager/InterpolationManager.js
4521
+ var InterpolationManager_InterpolationManager = __webpack_require__(33836);
4522
+ ;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/interpolation/acceptAutogeneratedInterpolations.js
4351
4523
 
4352
- /***/ }),
4353
-
4354
- /***/ 98043:
4355
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4356
-
4357
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4358
- /* harmony export */ A: () => (/* binding */ getContourHolesDataWorld)
4359
- /* harmony export */ });
4360
- /* harmony import */ var _stateManagement__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(95778);
4361
-
4362
- function getContourHolesDataWorld(annotation) {
4363
- const childAnnotationUIDs = annotation.childAnnotationUIDs ?? [];
4364
- return childAnnotationUIDs.map((uid) => (0,_stateManagement__WEBPACK_IMPORTED_MODULE_0__/* .getAnnotation */ .gw)(uid).data.contour.polyline);
4365
- }
4366
-
4367
-
4368
- /***/ }),
4369
-
4370
- /***/ 19866:
4371
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4372
-
4373
- /* unused harmony export getDeduplicatedVTKPolyDataPoints */
4374
- function getDeduplicatedVTKPolyDataPoints(polyData, bypass = false) {
4375
- const points = polyData.getPoints();
4376
- const lines = polyData.getLines();
4377
- const pointsArray = new Array(points.getNumberOfPoints())
4378
- .fill(0)
4379
- .map((_, i) => points.getPoint(i).slice());
4380
- const linesArray = new Array(lines.getNumberOfCells()).fill(0).map((_, i) => {
4381
- const cell = lines.getCell(i * 3).slice();
4382
- return { a: cell[0], b: cell[1] };
4383
- });
4384
- if (bypass) {
4385
- return { points: pointsArray, lines: linesArray };
4386
- }
4387
- const newPoints = [];
4388
- for (const [i, pt] of pointsArray.entries()) {
4389
- const index = newPoints.findIndex((point) => point[0] === pt[0] && point[1] === pt[1] && point[2] === pt[2]);
4390
- if (index >= 0) {
4391
- linesArray.map((line) => {
4392
- if (line.a === i) {
4393
- line.a = index;
4394
- }
4395
- if (line.b === i) {
4396
- line.b = index;
4397
- }
4398
- return line;
4399
- });
4400
- }
4401
- else {
4402
- const newIndex = newPoints.length;
4403
- newPoints.push(pt);
4404
- linesArray.map((line) => {
4405
- if (line.a === i) {
4406
- line.a = newIndex;
4407
- }
4408
- if (line.b === i) {
4409
- line.b = newIndex;
4410
- }
4411
- return line;
4412
- });
4413
- }
4414
- }
4415
- const newLines = linesArray.filter((line) => line.a !== line.b);
4416
- return { points: newPoints, lines: newLines };
4524
+ function acceptAutogeneratedInterpolations(annotationGroupSelector, selector) {
4525
+ InterpolationManager.acceptAutoGenerated(annotationGroupSelector, selector);
4417
4526
  }
4418
- /* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = ({ getDeduplicatedVTKPolyDataPoints });
4419
-
4420
-
4421
- /***/ }),
4422
4527
 
4423
- /***/ 75534:
4424
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4528
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/interpolation/index.js
4529
+ var interpolation = __webpack_require__(69115);
4530
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/findHandlePolylineIndex.js
4531
+ var findHandlePolylineIndex = __webpack_require__(84045);
4532
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/calculatePerimeter.js
4533
+ var calculatePerimeter = __webpack_require__(53891);
4534
+ ;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/index.js
4425
4535
 
4426
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4427
- /* harmony export */ getContourHolesDataCanvas: () => (/* reexport safe */ _getContourHolesDataCanvas__WEBPACK_IMPORTED_MODULE_7__.A),
4428
- /* harmony export */ updateContourPolyline: () => (/* reexport safe */ _updateContourPolyline__WEBPACK_IMPORTED_MODULE_8__.A)
4429
- /* harmony export */ });
4430
- /* harmony import */ var _areCoplanarContours__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14633);
4431
- /* harmony import */ var _contourFinder__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11716);
4432
- /* harmony import */ var _getDeduplicatedVTKPolyDataPoints__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(19866);
4433
- /* harmony import */ var _detectContourHoles__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(92806);
4434
- /* harmony import */ var _generateContourSetsFromLabelmap__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(36392);
4435
- /* harmony import */ var _AnnotationToPointData__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(93712);
4436
- /* harmony import */ var _getContourHolesDataWorld__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(98043);
4437
- /* harmony import */ var _getContourHolesDataCanvas__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(88267);
4438
- /* harmony import */ var _updateContourPolyline__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(89111);
4439
- /* harmony import */ var _interpolation_acceptAutogeneratedInterpolations__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(65864);
4440
- /* harmony import */ var _interpolation__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(69115);
4441
- /* harmony import */ var _findHandlePolylineIndex__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(84045);
4442
- /* harmony import */ var _calculatePerimeter__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(53891);
4443
4536
 
4444
4537
 
4445
4538
 
@@ -4455,20 +4548,6 @@ function getDeduplicatedVTKPolyDataPoints(polyData, bypass = false) {
4455
4548
 
4456
4549
 
4457
4550
 
4458
-
4459
- /***/ }),
4460
-
4461
- /***/ 65864:
4462
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4463
-
4464
- /* unused harmony export default */
4465
- /* harmony import */ var _segmentation_InterpolationManager_InterpolationManager__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(33836);
4466
-
4467
- function acceptAutogeneratedInterpolations(annotationGroupSelector, selector) {
4468
- InterpolationManager.acceptAutoGenerated(annotationGroupSelector, selector);
4469
- }
4470
-
4471
-
4472
4551
  /***/ }),
4473
4552
 
4474
4553
  /***/ 69115:
@@ -4497,7 +4576,7 @@ function acceptAutogeneratedInterpolations(annotationGroupSelector, selector) {
4497
4576
 
4498
4577
 
4499
4578
  function updateContourPolyline(annotation, polylineData, transforms, options) {
4500
- const { canvasToWorld } = transforms;
4579
+ const { canvasToWorld, worldToCanvas } = transforms;
4501
4580
  const { data } = annotation;
4502
4581
  const { targetWindingDirection } = polylineData;
4503
4582
  let { points: polyline } = polylineData;
@@ -4507,7 +4586,7 @@ function updateContourPolyline(annotation, polylineData, transforms, options) {
4507
4586
  let { closed } = polylineData;
4508
4587
  const numPoints = polyline.length;
4509
4588
  const polylineWorldPoints = new Array(numPoints);
4510
- const currentWindingDirection = _math__WEBPACK_IMPORTED_MODULE_1__.polyline.getWindingDirection(polyline);
4589
+ const currentPolylineWindingDirection = _math__WEBPACK_IMPORTED_MODULE_1__.polyline.getWindingDirection(polyline);
4511
4590
  const parentAnnotation = (0,_stateManagement__WEBPACK_IMPORTED_MODULE_2__/* .getParentAnnotation */ .Ay)(annotation);
4512
4591
  if (closed === undefined) {
4513
4592
  let currentClosedState = false;
@@ -4521,11 +4600,18 @@ function updateContourPolyline(annotation, polylineData, transforms, options) {
4521
4600
  ? parentAnnotation.data.contour.windingDirection * -1
4522
4601
  : targetWindingDirection;
4523
4602
  if (windingDirection === undefined) {
4524
- windingDirection = currentWindingDirection;
4603
+ windingDirection = currentPolylineWindingDirection;
4525
4604
  }
4526
- else if (windingDirection !== currentWindingDirection) {
4605
+ if (windingDirection !== currentPolylineWindingDirection) {
4527
4606
  polyline.reverse();
4528
4607
  }
4608
+ const handlePoints = data.handles.points.map((p) => worldToCanvas(p));
4609
+ if (handlePoints.length > 2) {
4610
+ const currentHandlesWindingDirection = _math__WEBPACK_IMPORTED_MODULE_1__.polyline.getWindingDirection(handlePoints);
4611
+ if (currentHandlesWindingDirection !== windingDirection) {
4612
+ data.handles.points.reverse();
4613
+ }
4614
+ }
4529
4615
  for (let i = 0; i < numPoints; i++) {
4530
4616
  polylineWorldPoints[i] = canvasToWorld(polyline[i]);
4531
4617
  }
@@ -5159,6 +5245,7 @@ function getViewportForAnnotation(annotation) {
5159
5245
 
5160
5246
  // EXPORTS
5161
5247
  __webpack_require__.d(__webpack_exports__, {
5248
+ clip: () => (/* reexport */ clip/* default */.Ay),
5162
5249
  debounce: () => (/* reexport */ debounce/* default */.A),
5163
5250
  getCalibratedLengthUnitsAndScale: () => (/* reexport */ getCalibratedUnits/* getCalibratedLengthUnitsAndScale */.Op),
5164
5251
  math: () => (/* reexport */ math),
@@ -5172,7 +5259,7 @@ __webpack_require__.d(__webpack_exports__, {
5172
5259
  triggerAnnotationRenderForViewportIds: () => (/* reexport */ triggerAnnotationRenderForViewportIds/* default */.A)
5173
5260
  });
5174
5261
 
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
5262
+ // 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
5263
 
5177
5264
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/index.js + 28 modules
5178
5265
  var esm = __webpack_require__(92136);
@@ -5212,8 +5299,10 @@ var annotationFrameRange = __webpack_require__(41209);
5212
5299
  var pointInSurroundingSphereCallback = __webpack_require__(5093);
5213
5300
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/getViewportForAnnotation.js
5214
5301
  var getViewportForAnnotation = __webpack_require__(39490);
5215
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/index.js
5216
- var contours = __webpack_require__(75534);
5302
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/annotationHydration.js
5303
+ var annotationHydration = __webpack_require__(25781);
5304
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/index.js + 9 modules
5305
+ var contours = __webpack_require__(75908);
5217
5306
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/segmentation/index.js
5218
5307
  var segmentation = __webpack_require__(10351);
5219
5308
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/drawing/index.js + 1 modules
@@ -5251,8 +5340,8 @@ var touch = __webpack_require__(54868);
5251
5340
  var dynamicVolume = __webpack_require__(16390);
5252
5341
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/polyData/utils.js
5253
5342
  var utils = __webpack_require__(46514);
5254
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/voi/index.js
5255
- var voi = __webpack_require__(10413);
5343
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/voi/index.js + 4 modules
5344
+ var voi = __webpack_require__(14149);
5256
5345
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contourSegmentation/index.js
5257
5346
  var contourSegmentation = __webpack_require__(7259);
5258
5347
  ;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/index.js
@@ -5291,6 +5380,7 @@ var contourSegmentation = __webpack_require__(7259);
5291
5380
 
5292
5381
 
5293
5382
 
5383
+
5294
5384
 
5295
5385
 
5296
5386
  const roundNumber = esm.utilities.roundNumber;
@@ -5383,6 +5473,8 @@ __webpack_require__.d(__webpack_exports__, {
5383
5473
 
5384
5474
  // UNUSED EXPORTS: Calculator
5385
5475
 
5476
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/index.js + 28 modules
5477
+ var esm = __webpack_require__(92136);
5386
5478
  ;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/math/basic/Calculator.js
5387
5479
  class Calculator {
5388
5480
  }
@@ -5390,55 +5482,73 @@ class Calculator {
5390
5482
 
5391
5483
  ;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/math/basic/BasicStatsCalculator.js
5392
5484
 
5485
+
5486
+ const { PointsManager } = esm.utilities;
5393
5487
  class BasicStatsCalculator extends basic_Calculator {
5394
5488
  static { this.max = [-Infinity]; }
5489
+ static { this.min = [Infinity]; }
5395
5490
  static { this.sum = [0]; }
5396
- static { this.sumSquares = [0]; }
5397
- static { this.squaredDiffSum = [0]; }
5398
5491
  static { this.count = 0; }
5399
- static { this.statsCallback = ({ value: newValue }) => {
5492
+ static { this.runMean = [0]; }
5493
+ static { this.m2 = [0]; }
5494
+ static { this.pointsInShape = PointsManager.create3(1024); }
5495
+ static statsInit(options) {
5496
+ if (options.noPointsCollection) {
5497
+ BasicStatsCalculator.pointsInShape = null;
5498
+ }
5499
+ }
5500
+ static { this.statsCallback = ({ value: newValue, pointLPS = null }) => {
5400
5501
  if (Array.isArray(newValue) &&
5401
5502
  newValue.length > 1 &&
5402
5503
  this.max.length === 1) {
5403
5504
  this.max.push(this.max[0], this.max[0]);
5505
+ this.min.push(this.min[0], this.min[0]);
5404
5506
  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]);
5507
+ this.runMean.push(0, 0);
5508
+ this.m2.push(this.m2[0], this.m2[0]);
5407
5509
  }
5510
+ this.pointsInShape?.push(pointLPS);
5408
5511
  const newArray = Array.isArray(newValue) ? newValue : [newValue];
5409
5512
  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)));
5513
+ this.max.map((it, idx) => {
5514
+ const value = newArray[idx];
5515
+ const delta = value - this.runMean[idx];
5516
+ this.sum[idx] += value;
5517
+ this.runMean[idx] += delta / this.count;
5518
+ const delta2 = value - this.runMean[idx];
5519
+ this.m2[idx] += delta * delta2;
5520
+ this.min[idx] = Math.min(this.min[idx], value);
5521
+ this.max[idx] = Math.max(it, value);
5522
+ });
5414
5523
  }; }
5415
- static { this.getStatistics = () => {
5524
+ static { this.getStatistics = (options) => {
5416
5525
  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));
5526
+ const stdDev = this.m2.map((squaredDiffSum) => Math.sqrt(squaredDiffSum / this.count));
5527
+ const unit = options?.unit || null;
5419
5528
  const named = {
5420
5529
  max: {
5421
5530
  name: 'max',
5422
5531
  label: 'Max Pixel',
5423
5532
  value: singleArrayAsNumber(this.max),
5424
- unit: null,
5533
+ unit,
5534
+ },
5535
+ min: {
5536
+ name: 'min',
5537
+ label: 'Min Pixel',
5538
+ value: singleArrayAsNumber(this.min),
5539
+ unit,
5425
5540
  },
5426
5541
  mean: {
5427
5542
  name: 'mean',
5428
5543
  label: 'Mean Pixel',
5429
5544
  value: singleArrayAsNumber(mean),
5430
- unit: null,
5545
+ unit,
5431
5546
  },
5432
5547
  stdDev: {
5433
5548
  name: 'stdDev',
5434
5549
  label: 'Standard Deviation',
5435
5550
  value: singleArrayAsNumber(stdDev),
5436
- unit: null,
5437
- },
5438
- stdDevWithSumSquare: {
5439
- name: 'stdDevWithSumSquare',
5440
- value: singleArrayAsNumber(stdDevWithSumSquare),
5441
- unit: null,
5551
+ unit,
5442
5552
  },
5443
5553
  count: {
5444
5554
  name: 'count',
@@ -5446,14 +5556,17 @@ class BasicStatsCalculator extends basic_Calculator {
5446
5556
  value: this.count,
5447
5557
  unit: null,
5448
5558
  },
5559
+ pointsInShape: this.pointsInShape,
5449
5560
  array: [],
5450
5561
  };
5451
- named.array.push(named.max, named.mean, named.stdDev, named.stdDevWithSumSquare, named.count);
5562
+ named.array.push(named.max, named.mean, named.stdDev, named.stdDev, named.count);
5452
5563
  this.max = [-Infinity];
5564
+ this.min = [Infinity];
5453
5565
  this.sum = [0];
5454
- this.sumSquares = [0];
5455
- this.squaredDiffSum = [0];
5566
+ this.m2 = [0];
5567
+ this.runMean = [0];
5456
5568
  this.count = 0;
5569
+ this.pointsInShape = PointsManager.create3(1024);
5457
5570
  return named;
5458
5571
  }; }
5459
5572
  }
@@ -7649,8 +7762,8 @@ function getBrushThresholdForToolGroup(toolGroupId) {
7649
7762
 
7650
7763
  // UNUSED EXPORTS: default
7651
7764
 
7652
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/index.js
7653
- var contours = __webpack_require__(75534);
7765
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/index.js + 9 modules
7766
+ var contours = __webpack_require__(75908);
7654
7767
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/enums/SegmentationRepresentations.js
7655
7768
  var SegmentationRepresentations = __webpack_require__(83946);
7656
7769
  // EXTERNAL MODULE: ../../../node_modules/gl-matrix/esm/index.js + 1 modules
@@ -9106,7 +9219,7 @@ function stackContextPrefetch_prefetch(element) {
9106
9219
  .then(() => doneCallback(imageId));
9107
9220
  const { useNorm16Texture, preferSizeOverAccuracy } = (0,esm.getConfiguration)().rendering;
9108
9221
  const useNativeDataType = useNorm16Texture || preferSizeOverAccuracy;
9109
- indicesToRequestCopy.forEach((imageIdIndex) => {
9222
+ stackPrefetch.indicesToRequest.forEach((imageIdIndex) => {
9110
9223
  const imageId = stack.imageIds[imageIdIndex];
9111
9224
  const options = {
9112
9225
  targetBuffer: {
@@ -9205,7 +9318,7 @@ function stackContextPrefetch_disable(element) {
9205
9318
  const promiseRemovedHandler = (0,stackPrefetchUtils/* getPromiseRemovedHandler */.m0)(element);
9206
9319
  esm.eventTarget.removeEventListener(esm.Enums.Events.IMAGE_CACHE_IMAGE_REMOVED, promiseRemovedHandler);
9207
9320
  const stackPrefetchData = (0,state/* getToolState */.k)(element);
9208
- if (stackPrefetchData && stackPrefetchData.data.length) {
9321
+ if (stackPrefetchData) {
9209
9322
  stackPrefetchData.enabled = false;
9210
9323
  }
9211
9324
  }
@@ -10157,10 +10270,144 @@ var ColorbarRangeTextPosition;
10157
10270
 
10158
10271
  /***/ }),
10159
10272
 
10160
- /***/ 10413:
10161
- /***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {
10273
+ /***/ 14149:
10274
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
10275
+
10276
+
10277
+ // EXPORTS
10278
+ __webpack_require__.d(__webpack_exports__, {
10279
+ windowLevel: () => (/* reexport */ windowlevel_namespaceObject)
10280
+ });
10281
+
10282
+ // UNUSED EXPORTS: colorbar
10283
+
10284
+ // NAMESPACE OBJECT: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/voi/windowlevel/index.js
10285
+ var windowlevel_namespaceObject = {};
10286
+ __webpack_require__.r(windowlevel_namespaceObject);
10287
+ __webpack_require__.d(windowlevel_namespaceObject, {
10288
+ calculateMinMaxMean: () => (calculateMinMaxMean),
10289
+ extractWindowLevelRegionToolData: () => (extractWindowLevelRegionToolData),
10290
+ getLuminanceFromRegion: () => (getLuminanceFromRegion)
10291
+ });
10292
+
10293
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/voi/colorbar/index.js
10294
+ var colorbar = __webpack_require__(64690);
10295
+ ;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/voi/windowlevel/getLuminanceFromRegion.js
10296
+ function getLuminanceFromRegion(imageData, x, y, width, height) {
10297
+ const luminance = [];
10298
+ let index = 0;
10299
+ const pixelData = imageData.scalarData;
10300
+ let spIndex, row, column;
10301
+ if (imageData.color) {
10302
+ for (row = 0; row < height; row++) {
10303
+ for (column = 0; column < width; column++) {
10304
+ spIndex = ((row + y) * imageData.columns + (column + x)) * 4;
10305
+ const red = pixelData[spIndex];
10306
+ const green = pixelData[spIndex + 1];
10307
+ const blue = pixelData[spIndex + 2];
10308
+ luminance[index++] = 0.2126 * red + 0.7152 * green + 0.0722 * blue;
10309
+ }
10310
+ }
10311
+ }
10312
+ else {
10313
+ for (row = 0; row < height; row++) {
10314
+ for (column = 0; column < width; column++) {
10315
+ spIndex = (row + y) * imageData.columns + (column + x);
10316
+ luminance[index++] = pixelData[spIndex];
10317
+ }
10318
+ }
10319
+ }
10320
+ return luminance;
10321
+ }
10322
+
10323
+
10324
+ ;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/voi/windowlevel/calculateMinMaxMean.js
10325
+ function calculateMinMaxMean(pixelLuminance, globalMin, globalMax) {
10326
+ const numPixels = pixelLuminance.length;
10327
+ let min = globalMax;
10328
+ let max = globalMin;
10329
+ let sum = 0;
10330
+ if (numPixels < 2) {
10331
+ return {
10332
+ min,
10333
+ max,
10334
+ mean: (globalMin + globalMax) / 2,
10335
+ };
10336
+ }
10337
+ for (let index = 0; index < numPixels; index++) {
10338
+ const spv = pixelLuminance[index];
10339
+ min = Math.min(min, spv);
10340
+ max = Math.max(max, spv);
10341
+ sum += spv;
10342
+ }
10343
+ return {
10344
+ min,
10345
+ max,
10346
+ mean: sum / numPixels,
10347
+ };
10348
+ }
10349
+
10350
+
10351
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/index.js + 28 modules
10352
+ var esm = __webpack_require__(92136);
10353
+ ;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/voi/windowlevel/extractWindowLevelRegionToolData.js
10354
+
10355
+ function extractWindowLevelRegionToolData(viewport) {
10356
+ if (viewport instanceof esm.VolumeViewport) {
10357
+ return extractImageDataVolume(viewport);
10358
+ }
10359
+ if (viewport instanceof esm.StackViewport) {
10360
+ return extractImageDataStack(viewport);
10361
+ }
10362
+ throw new Error('Viewport not supported');
10363
+ }
10364
+ function extractImageDataVolume(viewport) {
10365
+ const { scalarData, width, height } = esm.utilities.getCurrentVolumeViewportSlice(viewport);
10366
+ const { min: minPixelValue, max: maxPixelValue } = esm.utilities.getMinMax(scalarData);
10367
+ const volumeId = viewport.getVolumeId();
10368
+ const volume = esm.cache.getVolume(volumeId);
10369
+ const { metadata, cornerstoneImageMetaData } = volume;
10370
+ const { Rows: rows, Columns: columns } = metadata;
10371
+ const { color } = cornerstoneImageMetaData;
10372
+ return {
10373
+ scalarData,
10374
+ width,
10375
+ height,
10376
+ minPixelValue,
10377
+ maxPixelValue,
10378
+ rows,
10379
+ columns,
10380
+ color,
10381
+ };
10382
+ }
10383
+ function extractImageDataStack(viewport) {
10384
+ const imageData = viewport.getImageData();
10385
+ const { scalarData } = imageData;
10386
+ const { min: minPixelValue, max: maxPixelValue } = esm.utilities.getMinMax(scalarData);
10387
+ const width = imageData.dimensions[0];
10388
+ const height = imageData.dimensions[1];
10389
+ const { rows, columns, color } = viewport.getCornerstoneImage();
10390
+ return {
10391
+ scalarData,
10392
+ width,
10393
+ height,
10394
+ minPixelValue,
10395
+ maxPixelValue,
10396
+ rows,
10397
+ columns,
10398
+ color,
10399
+ };
10400
+ }
10401
+
10402
+
10403
+ ;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/voi/windowlevel/index.js
10404
+
10405
+
10406
+
10407
+
10408
+
10409
+ ;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/voi/index.js
10162
10410
 
10163
- /* harmony import */ var _colorbar__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(64690);
10164
10411
 
10165
10412
 
10166
10413