@ohif/app 3.9.0-beta.57 → 3.9.0-beta.59

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 (41) hide show
  1. package/dist/{29.bundle.976319462f33868497c2.js → 117.bundle.403581eea72534ff9c7e.js} +1765 -582
  2. package/dist/{169.bundle.483057ed84ca3e92513a.js → 169.bundle.d28df3cf2d600fc3e146.js} +7 -5
  3. package/dist/{210.bundle.368d53177dc659dc6af0.js → 210.bundle.ea52c75bb27ab002dc4d.js} +2 -2
  4. package/dist/{281.bundle.49da07d997da7cc01705.js → 281.bundle.719e9e222fecb4e9e9c6.js} +18 -4
  5. package/dist/{360.bundle.2c117803c05f0bc31424.js → 360.bundle.9a0c682beae1ef7e40b1.js} +5 -5
  6. package/dist/{372.bundle.d97377781382080306bd.js → 372.bundle.9891a9938b28db4b36ce.js} +5 -4
  7. package/dist/424.bundle.1caecbb1bbefc271b621.js +663 -0
  8. package/dist/{497.bundle.ee102d6243f984113f08.js → 497.bundle.bbc07cef12d598653a65.js} +149 -117
  9. package/dist/{498.bundle.bb47c493dd02451f77ef.js → 498.bundle.e5ccb2bc38e4bfdd564b.js} +1 -1
  10. package/dist/{516.bundle.d777e4126814a5a47117.js → 516.bundle.e59c26f055d145ce835e.js} +47 -12
  11. package/dist/{196.bundle.cf8c2311aafb5312bbf7.js → 579.bundle.0b78fc095924efac431d.js} +1705 -493
  12. package/dist/{552.bundle.85aaefb5e22d6d1bffa9.js → 65.bundle.d15cc84a0b991e182649.js} +15 -680
  13. package/dist/{129.bundle.3102eccbd5c78524c3dd.js → 650.bundle.a65389abf76ad921aa17.js} +2671 -2975
  14. package/dist/{793.bundle.c92f52ddff0e3bf506e6.js → 793.bundle.e4c759b5cdfcc3c7494f.js} +2 -2
  15. package/dist/{818.bundle.cda4e369fdee5459a544.js → 818.bundle.b64fae7e982e16a82ca2.js} +133 -69
  16. package/dist/{842.bundle.a5533bc77e6f57b0ee30.js → 842.bundle.cccbb7e3611e3d220f07.js} +2 -2
  17. package/dist/{888.bundle.7ff5dfd3c14072cee2a9.js → 888.bundle.d3b2a82cb17155725342.js} +9 -3
  18. package/dist/{428.bundle.744fc5865b2d747de88a.js → 904.bundle.008f8a2095669f4eabba.js} +88 -50
  19. package/dist/{962.bundle.d5f55c85407221bbce7b.js → 962.bundle.868b30361a52b0ffa504.js} +2 -2
  20. package/dist/{993.bundle.aa31ebda5a5f62c44de5.js → 993.bundle.302a286ebb6e3fc0c35a.js} +1265 -485
  21. package/dist/{994.bundle.c4709bfb7fd9dcde0551.js → 994.bundle.3b5f396b62cce2990c03.js} +15 -1
  22. package/dist/{app.bundle.a69624a3e0becd131c65.js → app.bundle.14f126e3ec4491bb1948.js} +1393 -1321
  23. package/dist/app.bundle.css +2 -2
  24. package/dist/dicom-microscopy-viewer/dicomMicroscopyViewer.min.js.map +1 -0
  25. package/dist/{histogram-worker.bundle.e7e9fea2c3236b0e747a.js → histogram-worker.bundle.89729ccb99d170ff2f2f.js} +2 -1
  26. package/dist/index.html +3 -1
  27. package/dist/{polySeg.bundle.b25c61224998018d0f79.js → polySeg.bundle.d8943427beee7694621a.js} +3 -22
  28. package/dist/{suv-peak-worker.bundle.eb11e71db02e52601ecf.js → suv-peak-worker.bundle.15dcb8d1ab8e0528bfd9.js} +3 -22
  29. package/dist/sw.js +1 -1
  30. package/package.json +18 -18
  31. /package/dist/{153.bundle.62dad8e9c7532474e95c.js → 153.bundle.42a66f99ced5972aa0c0.js} +0 -0
  32. /package/dist/{202.bundle.bb0e8196739bb896dc9e.js → 202.bundle.f6d9ca4b1c16b1aa227f.js} +0 -0
  33. /package/dist/{246.bundle.27aca95ea22cd5fcd414.js → 246.bundle.912e9f8342cd5d6228e6.js} +0 -0
  34. /package/dist/{353.bundle.a741604612f3f1d18398.js → 353.bundle.5b11e6b395c5d5cc33bf.js} +0 -0
  35. /package/dist/{376.bundle.2657056d8bc2b11fb0e8.js → 376.bundle.ac0e23dc830cd982fd18.js} +0 -0
  36. /package/dist/{552.css → 424.css} +0 -0
  37. /package/dist/{502.bundle.e7e6c345146aef00a169.js → 502.bundle.823682db96d52df1b8cf.js} +0 -0
  38. /package/dist/{591.bundle.aa91409b528ae6b601e0.js → 591.bundle.39fa1e6e7285929f2e29.js} +0 -0
  39. /package/dist/{791.bundle.d614182fa975e92cf4f5.js → 791.bundle.ecf9b1f8892d5f8962a3.js} +0 -0
  40. /package/dist/{944.bundle.c2bcb49d5077bd6fcc87.js → 944.bundle.93eddec203a43754e826.js} +0 -0
  41. /package/dist/{978.bundle.cd27543a62e7230557b2.js → 978.bundle.c12902cf44dca926bcb8.js} +0 -0
@@ -12,8 +12,8 @@ __webpack_require__.d(__webpack_exports__, {
12
12
 
13
13
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/store/index.js + 4 modules
14
14
  var store = __webpack_require__(33232);
15
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/index.js + 28 modules
16
- var esm = __webpack_require__(62709);
15
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/index.js + 1 modules
16
+ var esm = __webpack_require__(12651);
17
17
  ;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/drawingSvg/getSvgDrawingHelper.js
18
18
 
19
19
 
@@ -132,8 +132,8 @@ var lodash_get_default = /*#__PURE__*/__webpack_require__.n(lodash_get);
132
132
  // EXTERNAL MODULE: ../../../node_modules/lodash.clonedeep/index.js
133
133
  var lodash_clonedeep = __webpack_require__(11677);
134
134
  var lodash_clonedeep_default = /*#__PURE__*/__webpack_require__.n(lodash_clonedeep);
135
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/index.js + 28 modules
136
- var esm = __webpack_require__(62709);
135
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/index.js + 1 modules
136
+ var esm = __webpack_require__(12651);
137
137
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/cursors/index.js + 4 modules
138
138
  var cursors = __webpack_require__(60020);
139
139
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/cursors/elementCursor.js
@@ -715,7 +715,7 @@ function getToolGroupsWithToolName(toolName) {
715
715
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
716
716
  /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
717
717
  /* harmony export */ });
718
- /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(62709);
718
+ /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12651);
719
719
  /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(72076);
720
720
  /* harmony import */ var _utilities_getCalibratedUnits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(39661);
721
721
  /* harmony import */ var _utilities__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(42975);
@@ -731,7 +731,7 @@ function getToolGroupsWithToolName(toolName) {
731
731
  /* harmony import */ var _planarFreehandROITool_openContourEndEditLoop__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(82571);
732
732
  /* harmony import */ var _planarFreehandROITool_renderMethods__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(54435);
733
733
  /* harmony import */ var _stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(36705);
734
- /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(86785);
734
+ /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(25876);
735
735
  /* harmony import */ var _utilities_drawing__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(20724);
736
736
  /* harmony import */ var _utilities_math_polyline__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(42744);
737
737
  /* harmony import */ var _utilities_pointInShapeCallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(31955);
@@ -889,45 +889,12 @@ class PlanarFreehandROITool extends _base_ContourSegmentationBaseTool__WEBPACK_I
889
889
  }
890
890
  const { imageData, metadata } = image;
891
891
  const canvasCoordinates = points.map((p) => viewport.worldToCanvas(p));
892
- const canvasPoint = canvasCoordinates[0];
893
- const originalWorldPoint = viewport.canvasToWorld(canvasPoint);
894
- const deltaXPoint = viewport.canvasToWorld([
895
- canvasPoint[0] + 1,
896
- canvasPoint[1],
897
- ]);
898
- const deltaYPoint = viewport.canvasToWorld([
899
- canvasPoint[0],
900
- canvasPoint[1] + 1,
901
- ]);
902
- const deltaInX = gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec3.distance */ .R3.distance(originalWorldPoint, deltaXPoint);
903
- const deltaInY = gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec3.distance */ .R3.distance(originalWorldPoint, deltaYPoint);
904
- const worldPosIndex = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.utilities.transformWorldToIndex(imageData, points[0]);
905
- worldPosIndex[0] = Math.floor(worldPosIndex[0]);
906
- worldPosIndex[1] = Math.floor(worldPosIndex[1]);
907
- worldPosIndex[2] = Math.floor(worldPosIndex[2]);
908
- let iMin = worldPosIndex[0];
909
- let iMax = worldPosIndex[0];
910
- let jMin = worldPosIndex[1];
911
- let jMax = worldPosIndex[1];
912
- let kMin = worldPosIndex[2];
913
- let kMax = worldPosIndex[2];
914
- for (let j = 1; j < points.length; j++) {
915
- const worldPosIndex = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.utilities.transformWorldToIndex(imageData, points[j]);
916
- worldPosIndex[0] = Math.floor(worldPosIndex[0]);
917
- worldPosIndex[1] = Math.floor(worldPosIndex[1]);
918
- worldPosIndex[2] = Math.floor(worldPosIndex[2]);
919
- iMin = Math.min(iMin, worldPosIndex[0]);
920
- iMax = Math.max(iMax, worldPosIndex[0]);
921
- jMin = Math.min(jMin, worldPosIndex[1]);
922
- jMax = Math.max(jMax, worldPosIndex[1]);
923
- kMin = Math.min(kMin, worldPosIndex[2]);
924
- kMax = Math.max(kMax, worldPosIndex[2]);
925
- }
926
- const worldPosIndex2 = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.utilities.transformWorldToIndex(imageData, points[1]);
927
- worldPosIndex2[0] = Math.floor(worldPosIndex2[0]);
928
- worldPosIndex2[1] = Math.floor(worldPosIndex2[1]);
929
- worldPosIndex2[2] = Math.floor(worldPosIndex2[2]);
930
- const { scale, areaUnits } = (0,_utilities_getCalibratedUnits__WEBPACK_IMPORTED_MODULE_2__/* .getCalibratedLengthUnitsAndScale */ .mh)(image, () => {
892
+ const modalityUnitOptions = {
893
+ isPreScaled: (0,_utilities_viewport_isViewportPreScaled__WEBPACK_IMPORTED_MODULE_20__/* .isViewportPreScaled */ .P)(viewport, targetId),
894
+ isSuvScaled: this.isSuvScaled(viewport, targetId, annotation.metadata.referencedImageId),
895
+ };
896
+ const modalityUnit = (0,_utilities_getModalityUnit__WEBPACK_IMPORTED_MODULE_21__/* .getModalityUnit */ .F)(metadata.Modality, annotation.metadata.referencedImageId, modalityUnitOptions);
897
+ const calibratedScale = (0,_utilities_getCalibratedUnits__WEBPACK_IMPORTED_MODULE_2__/* .getCalibratedLengthUnitsAndScale */ .mh)(image, () => {
931
898
  const polyline = data.contour.polyline;
932
899
  const numPoints = polyline.length;
933
900
  const projectedPolyline = new Array(numPoints);
@@ -935,10 +902,7 @@ class PlanarFreehandROITool extends _base_ContourSegmentationBaseTool__WEBPACK_I
935
902
  projectedPolyline[i] = viewport.worldToCanvas(polyline[i]);
936
903
  }
937
904
  const { maxX: canvasMaxX, maxY: canvasMaxY, minX: canvasMinX, minY: canvasMinY, } = _utilities__WEBPACK_IMPORTED_MODULE_3__.math.polyline.getAABB(projectedPolyline);
938
- const topLeftBBWorld = viewport.canvasToWorld([
939
- canvasMinX,
940
- canvasMinY,
941
- ]);
905
+ const topLeftBBWorld = viewport.canvasToWorld([canvasMinX, canvasMinY]);
942
906
  const topLeftBBIndex = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.utilities.transformWorldToIndex(imageData, topLeftBBWorld);
943
907
  const bottomRightBBWorld = viewport.canvasToWorld([
944
908
  canvasMaxX,
@@ -947,71 +911,29 @@ class PlanarFreehandROITool extends _base_ContourSegmentationBaseTool__WEBPACK_I
947
911
  const bottomRightBBIndex = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.utilities.transformWorldToIndex(imageData, bottomRightBBWorld);
948
912
  return [topLeftBBIndex, bottomRightBBIndex];
949
913
  });
950
- let area = _utilities_math__WEBPACK_IMPORTED_MODULE_4__.polyline.getArea(canvasCoordinates) / scale / scale;
951
- area *= deltaInX * deltaInY;
952
- const iDelta = 0.01 * (iMax - iMin);
953
- const jDelta = 0.01 * (jMax - jMin);
954
- const kDelta = 0.01 * (kMax - kMin);
955
- iMin = Math.floor(iMin - iDelta);
956
- iMax = Math.ceil(iMax + iDelta);
957
- jMin = Math.floor(jMin - jDelta);
958
- jMax = Math.ceil(jMax + jDelta);
959
- kMin = Math.floor(kMin - kDelta);
960
- kMax = Math.ceil(kMax + kDelta);
961
- const boundsIJK = [
962
- [iMin, iMax],
963
- [jMin, jMax],
964
- [kMin, kMax],
965
- ];
966
- const worldPosEnd = imageData.indexToWorld([iMax, jMax, kMax]);
967
- const canvasPosEnd = viewport.worldToCanvas(worldPosEnd);
968
- let curRow = 0;
969
- let intersections = [];
970
- let intersectionCounter = 0;
971
- const pointsInShape = (0,_utilities_pointInShapeCallback__WEBPACK_IMPORTED_MODULE_19__/* ["default"] */ .Z)(imageData, (pointLPS, pointIJK) => {
972
- let result = true;
973
- const point = viewport.worldToCanvas(pointLPS);
974
- if (point[1] != curRow) {
975
- intersectionCounter = 0;
976
- curRow = point[1];
977
- intersections = (0,_utilities_math_polyline__WEBPACK_IMPORTED_MODULE_18__.getLineSegmentIntersectionsCoordinates)(canvasCoordinates, point, [canvasPosEnd[0], point[1]]);
978
- intersections.sort((function (index) {
979
- return function (a, b) {
980
- return a[index] === b[index]
981
- ? 0
982
- : a[index] < b[index]
983
- ? -1
984
- : 1;
985
- };
986
- })(0));
987
- }
988
- if (intersections.length && point[0] > intersections[0][0]) {
989
- intersections.shift();
990
- intersectionCounter++;
991
- }
992
- if (intersectionCounter % 2 === 0) {
993
- result = false;
994
- }
995
- return result;
996
- }, this.configuration.statsCalculator.statsCallback, boundsIJK);
997
- const modalityUnitOptions = {
998
- isPreScaled: (0,_utilities_viewport_isViewportPreScaled__WEBPACK_IMPORTED_MODULE_20__/* .isViewportPreScaled */ .P)(viewport, targetId),
999
- isSuvScaled: this.isSuvScaled(viewport, targetId, annotation.metadata.referencedImageId),
1000
- };
1001
- const modalityUnit = (0,_utilities_getModalityUnit__WEBPACK_IMPORTED_MODULE_21__/* .getModalityUnit */ .F)(metadata.Modality, annotation.metadata.referencedImageId, modalityUnitOptions);
1002
- const stats = this.configuration.statsCalculator.getStatistics();
1003
- cachedStats[targetId] = {
1004
- Modality: metadata.Modality,
1005
- area,
1006
- perimeter: (0,_utilities_contours_calculatePerimeter__WEBPACK_IMPORTED_MODULE_23__/* ["default"] */ .Z)(canvasCoordinates, closed),
1007
- mean: stats.mean?.value,
1008
- max: stats.max?.value,
1009
- stdDev: stats.stdDev?.value,
1010
- statsArray: stats.array,
1011
- pointsInShape: pointsInShape,
1012
- areaUnit: areaUnits,
1013
- modalityUnit,
1014
- };
914
+ if (closed) {
915
+ this.updateClosedCachedStats({
916
+ targetId,
917
+ viewport,
918
+ canvasCoordinates,
919
+ points,
920
+ imageData,
921
+ metadata,
922
+ cachedStats,
923
+ modalityUnit,
924
+ calibratedScale,
925
+ });
926
+ }
927
+ else {
928
+ this.updateOpenCachedStats({
929
+ metadata,
930
+ canvasCoordinates,
931
+ targetId,
932
+ cachedStats,
933
+ modalityUnit,
934
+ calibratedScale,
935
+ });
936
+ }
1015
937
  }
1016
938
  (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_15__/* .triggerAnnotationModified */ .hg)(annotation, enabledElement.viewport.element, _enums__WEBPACK_IMPORTED_MODULE_25__.ChangeTypes.StatsUpdated);
1017
939
  annotation.invalidated = false;
@@ -1204,10 +1126,117 @@ class PlanarFreehandROITool extends _base_ContourSegmentationBaseTool__WEBPACK_I
1204
1126
  }
1205
1127
  }
1206
1128
  }
1129
+ updateClosedCachedStats({ viewport, points, imageData, metadata, cachedStats, targetId, modalityUnit, canvasCoordinates, calibratedScale, }) {
1130
+ const { scale, areaUnits, units } = calibratedScale;
1131
+ const canvasPoint = canvasCoordinates[0];
1132
+ const originalWorldPoint = viewport.canvasToWorld(canvasPoint);
1133
+ const deltaXPoint = viewport.canvasToWorld([
1134
+ canvasPoint[0] + 1,
1135
+ canvasPoint[1],
1136
+ ]);
1137
+ const deltaYPoint = viewport.canvasToWorld([
1138
+ canvasPoint[0],
1139
+ canvasPoint[1] + 1,
1140
+ ]);
1141
+ const deltaInX = gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec3.distance */ .R3.distance(originalWorldPoint, deltaXPoint);
1142
+ const deltaInY = gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec3.distance */ .R3.distance(originalWorldPoint, deltaYPoint);
1143
+ const worldPosIndex = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.utilities.transformWorldToIndex(imageData, points[0]);
1144
+ worldPosIndex[0] = Math.floor(worldPosIndex[0]);
1145
+ worldPosIndex[1] = Math.floor(worldPosIndex[1]);
1146
+ worldPosIndex[2] = Math.floor(worldPosIndex[2]);
1147
+ let iMin = worldPosIndex[0];
1148
+ let iMax = worldPosIndex[0];
1149
+ let jMin = worldPosIndex[1];
1150
+ let jMax = worldPosIndex[1];
1151
+ let kMin = worldPosIndex[2];
1152
+ let kMax = worldPosIndex[2];
1153
+ for (let j = 1; j < points.length; j++) {
1154
+ const worldPosIndex = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.utilities.transformWorldToIndex(imageData, points[j]);
1155
+ worldPosIndex[0] = Math.floor(worldPosIndex[0]);
1156
+ worldPosIndex[1] = Math.floor(worldPosIndex[1]);
1157
+ worldPosIndex[2] = Math.floor(worldPosIndex[2]);
1158
+ iMin = Math.min(iMin, worldPosIndex[0]);
1159
+ iMax = Math.max(iMax, worldPosIndex[0]);
1160
+ jMin = Math.min(jMin, worldPosIndex[1]);
1161
+ jMax = Math.max(jMax, worldPosIndex[1]);
1162
+ kMin = Math.min(kMin, worldPosIndex[2]);
1163
+ kMax = Math.max(kMax, worldPosIndex[2]);
1164
+ }
1165
+ const worldPosIndex2 = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.utilities.transformWorldToIndex(imageData, points[1]);
1166
+ worldPosIndex2[0] = Math.floor(worldPosIndex2[0]);
1167
+ worldPosIndex2[1] = Math.floor(worldPosIndex2[1]);
1168
+ worldPosIndex2[2] = Math.floor(worldPosIndex2[2]);
1169
+ let area = _utilities_math__WEBPACK_IMPORTED_MODULE_4__.polyline.getArea(canvasCoordinates) / scale / scale;
1170
+ area *= deltaInX * deltaInY;
1171
+ const iDelta = 0.01 * (iMax - iMin);
1172
+ const jDelta = 0.01 * (jMax - jMin);
1173
+ const kDelta = 0.01 * (kMax - kMin);
1174
+ iMin = Math.floor(iMin - iDelta);
1175
+ iMax = Math.ceil(iMax + iDelta);
1176
+ jMin = Math.floor(jMin - jDelta);
1177
+ jMax = Math.ceil(jMax + jDelta);
1178
+ kMin = Math.floor(kMin - kDelta);
1179
+ kMax = Math.ceil(kMax + kDelta);
1180
+ const boundsIJK = [
1181
+ [iMin, iMax],
1182
+ [jMin, jMax],
1183
+ [kMin, kMax],
1184
+ ];
1185
+ const worldPosEnd = imageData.indexToWorld([iMax, jMax, kMax]);
1186
+ const canvasPosEnd = viewport.worldToCanvas(worldPosEnd);
1187
+ let curRow = 0;
1188
+ let intersections = [];
1189
+ let intersectionCounter = 0;
1190
+ const pointsInShape = (0,_utilities_pointInShapeCallback__WEBPACK_IMPORTED_MODULE_19__/* ["default"] */ .Z)(imageData, (pointLPS, _pointIJK) => {
1191
+ let result = true;
1192
+ const point = viewport.worldToCanvas(pointLPS);
1193
+ if (point[1] != curRow) {
1194
+ intersectionCounter = 0;
1195
+ curRow = point[1];
1196
+ intersections = (0,_utilities_math_polyline__WEBPACK_IMPORTED_MODULE_18__.getLineSegmentIntersectionsCoordinates)(canvasCoordinates, point, [canvasPosEnd[0], point[1]]);
1197
+ intersections.sort((function (index) {
1198
+ return function (a, b) {
1199
+ return a[index] === b[index] ? 0 : a[index] < b[index] ? -1 : 1;
1200
+ };
1201
+ })(0));
1202
+ }
1203
+ if (intersections.length && point[0] > intersections[0][0]) {
1204
+ intersections.shift();
1205
+ intersectionCounter++;
1206
+ }
1207
+ if (intersectionCounter % 2 === 0) {
1208
+ result = false;
1209
+ }
1210
+ return result;
1211
+ }, this.configuration.statsCalculator.statsCallback, boundsIJK);
1212
+ const stats = this.configuration.statsCalculator.getStatistics();
1213
+ cachedStats[targetId] = {
1214
+ Modality: metadata.Modality,
1215
+ area,
1216
+ perimeter: (0,_utilities_contours_calculatePerimeter__WEBPACK_IMPORTED_MODULE_23__/* ["default"] */ .Z)(canvasCoordinates, closed) / scale,
1217
+ mean: stats.mean?.value,
1218
+ max: stats.max?.value,
1219
+ stdDev: stats.stdDev?.value,
1220
+ statsArray: stats.array,
1221
+ pointsInShape: pointsInShape,
1222
+ areaUnit: areaUnits,
1223
+ modalityUnit,
1224
+ unit: units,
1225
+ };
1226
+ }
1227
+ updateOpenCachedStats({ targetId, metadata, canvasCoordinates, cachedStats, modalityUnit, calibratedScale, }) {
1228
+ const { scale, units } = calibratedScale;
1229
+ cachedStats[targetId] = {
1230
+ Modality: metadata.Modality,
1231
+ length: (0,_utilities_contours_calculatePerimeter__WEBPACK_IMPORTED_MODULE_23__/* ["default"] */ .Z)(canvasCoordinates, false) / scale,
1232
+ modalityUnit,
1233
+ unit: units,
1234
+ };
1235
+ }
1207
1236
  }
1208
1237
  function defaultGetTextLines(data, targetId) {
1209
1238
  const cachedVolumeStats = data.cachedStats[targetId];
1210
- const { area, mean, stdDev, perimeter, max, isEmptyArea, areaUnit, modalityUnit, } = cachedVolumeStats || {};
1239
+ const { area, mean, stdDev, length, perimeter, max, isEmptyArea, areaUnit, modalityUnit, unit, } = cachedVolumeStats || {};
1211
1240
  const textLines = [];
1212
1241
  if (area) {
1213
1242
  const areaLine = isEmptyArea
@@ -1225,7 +1254,10 @@ function defaultGetTextLines(data, targetId) {
1225
1254
  textLines.push(`Std Dev: ${(0,_utilities__WEBPACK_IMPORTED_MODULE_3__.roundNumber)(stdDev)} ${modalityUnit}`);
1226
1255
  }
1227
1256
  if (perimeter) {
1228
- textLines.push(`Perimeter: ${(0,_utilities__WEBPACK_IMPORTED_MODULE_3__.roundNumber)(perimeter)} ${modalityUnit}`);
1257
+ textLines.push(`Perimeter: ${(0,_utilities__WEBPACK_IMPORTED_MODULE_3__.roundNumber)(perimeter)} ${unit}`);
1258
+ }
1259
+ if (length) {
1260
+ textLines.push(`${(0,_utilities__WEBPACK_IMPORTED_MODULE_3__.roundNumber)(length)} ${unit}`);
1229
1261
  }
1230
1262
  return textLines;
1231
1263
  }
@@ -1242,7 +1274,7 @@ PlanarFreehandROITool.toolName = 'PlanarFreehandROI';
1242
1274
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1243
1275
  /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
1244
1276
  /* harmony export */ });
1245
- /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(62709);
1277
+ /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12651);
1246
1278
  /* harmony import */ var _enums_SegmentationRepresentations__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(74297);
1247
1279
  /* harmony import */ var _stateManagement_segmentation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(95482);
1248
1280
  /* harmony import */ var _stateManagement_segmentation_config_segmentationVisibility__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(39949);
@@ -14,7 +14,7 @@ __webpack_require__.r(__webpack_exports__);
14
14
  /* harmony import */ var _ohif_ui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(38604);
15
15
  /* harmony import */ var _cornerstonejs_tools__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(93725);
16
16
  /* harmony import */ var _getContextModule__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(89859);
17
- /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(62709);
17
+ /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(12651);
18
18
  /* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(69190);
19
19
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
20
20
 
@@ -20,8 +20,8 @@ var esm = __webpack_require__(72076);
20
20
  // EXTERNAL MODULE: ../../../node_modules/prop-types/index.js
21
21
  var prop_types = __webpack_require__(3827);
22
22
  var prop_types_default = /*#__PURE__*/__webpack_require__.n(prop_types);
23
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/index.js + 28 modules
24
- var dist_esm = __webpack_require__(62709);
23
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/index.js + 1 modules
24
+ var dist_esm = __webpack_require__(12651);
25
25
  // EXTERNAL MODULE: ../../ui/src/index.js + 784 modules
26
26
  var src = __webpack_require__(38604);
27
27
  // EXTERNAL MODULE: ../../../node_modules/moment/moment.js
@@ -761,8 +761,8 @@ __webpack_require__.r(types_namespaceObject);
761
761
 
762
762
  // EXTERNAL MODULE: ../../../node_modules/react/index.js
763
763
  var react = __webpack_require__(43001);
764
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/index.js + 28 modules
765
- var esm = __webpack_require__(62709);
764
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/index.js + 1 modules
765
+ var esm = __webpack_require__(12651);
766
766
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/index.js
767
767
  var dist_esm = __webpack_require__(93725);
768
768
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/streaming-image-volume-loader/dist/esm/index.js + 13 modules
@@ -2987,12 +2987,15 @@ function PlanarFreehandROI_getDisplayText(annotation, displaySet, customizationS
2987
2987
  PlanarFreehandROI
2988
2988
  } = customizationService.get('cornerstone.measurements');
2989
2989
  const {
2990
- displayText
2990
+ displayText: displayTextClosed,
2991
+ displayTextOpen
2991
2992
  } = PlanarFreehandROI;
2992
2993
  const {
2993
2994
  metadata,
2994
2995
  data
2995
2996
  } = annotation;
2997
+ const isClosed = data.contour?.closed;
2998
+ const displayText = isClosed ? displayTextClosed : displayTextOpen;
2996
2999
  const {
2997
3000
  SOPInstanceUID,
2998
3001
  frameNumber
@@ -3024,13 +3027,13 @@ function PlanarFreehandROI_getDisplayText(annotation, displaySet, customizationS
3024
3027
  return src.utils.roundNumber(value, 2);
3025
3028
  });
3026
3029
  }
3027
- return isNaN(values) ? values : src.utils.roundNumber(values, 2);
3030
+ return isNaN(values) ? [values] : [src.utils.roundNumber(values, 2)];
3028
3031
  };
3029
3032
  const findUnitForValue = (displayTextItems, value) => displayTextItems.find(({
3030
3033
  type,
3031
3034
  for: filter
3032
3035
  }) => type === 'unit' && filter.includes(value))?.value;
3033
- const formatDisplayText = (displayName, result, unit) => `${displayName}: ${Array.isArray(result) ? roundValues(result).join(', ') : roundValues(result)} ${unit}`;
3036
+ const formatDisplayText = (displayName, result, unit) => `${displayName}: ${roundValues(result).join(', ')} ${unit}`;
3034
3037
  displayText.forEach(({
3035
3038
  displayName,
3036
3039
  value,
@@ -5476,7 +5479,8 @@ async function init({
5476
5479
  rendering: {
5477
5480
  preferSizeOverAccuracy: Boolean(appConfig.preferSizeOverAccuracy),
5478
5481
  useNorm16Texture: Boolean(appConfig.useNorm16Texture)
5479
- }
5482
+ },
5483
+ peerImport: appConfig.peerImport
5480
5484
  });
5481
5485
 
5482
5486
  // For debugging e2e tests that are failing on CI
@@ -5566,10 +5570,13 @@ async function init({
5566
5570
  // add metadata providers
5567
5571
  esm.metaData.addProvider(esm.utilities.calibratedPixelSpacingMetadataProvider.get.bind(esm.utilities.calibratedPixelSpacingMetadataProvider)); // this provider is required for Calibration tool
5568
5572
  esm.metaData.addProvider(metadataProvider.get.bind(metadataProvider), 9999);
5573
+
5574
+ // These are set reasonably low to allow for interleaved retrieves and slower
5575
+ // connections.
5569
5576
  esm.imageLoadPoolManager.maxNumRequests = {
5570
- interaction: appConfig?.maxNumRequests?.interaction || 100,
5571
- thumbnail: appConfig?.maxNumRequests?.thumbnail || 75,
5572
- prefetch: appConfig?.maxNumRequests?.prefetch || 10
5577
+ interaction: appConfig?.maxNumRequests?.interaction || 10,
5578
+ thumbnail: appConfig?.maxNumRequests?.thumbnail || 5,
5579
+ prefetch: appConfig?.maxNumRequests?.prefetch || 5
5573
5580
  };
5574
5581
  initWADOImageLoader(userAuthenticationService, appConfig, extensionManager);
5575
5582
 
@@ -6508,6 +6515,11 @@ function getCustomizationModule() {
6508
6515
  }]
6509
6516
  },
6510
6517
  PlanarFreehandROI: {
6518
+ displayTextOpen: [{
6519
+ displayName: 'Length',
6520
+ value: 'length',
6521
+ type: 'value'
6522
+ }],
6511
6523
  displayText: [{
6512
6524
  displayName: 'Mean',
6513
6525
  value: 'mean',
@@ -15080,6 +15092,9 @@ const {
15080
15092
  const {
15081
15093
  getDynamicVolumeInfo
15082
15094
  } = volumeLoaderHelpers ?? {};
15095
+ const {
15096
+ imageRetrieveMetadataProvider
15097
+ } = esm.utilities;
15083
15098
  const Component = /*#__PURE__*/react.lazy(() => {
15084
15099
  return __webpack_require__.e(/* import() */ 169).then(__webpack_require__.bind(__webpack_require__, 31169));
15085
15100
  });
@@ -15088,6 +15103,14 @@ const OHIFCornerstoneViewport = props => {
15088
15103
  fallback: /*#__PURE__*/react.createElement("div", null, "Loading...")
15089
15104
  }, /*#__PURE__*/react.createElement(Component, props));
15090
15105
  };
15106
+ const stackRetrieveOptions = {
15107
+ retrieveOptions: {
15108
+ single: {
15109
+ streaming: true,
15110
+ decodeLevel: 1
15111
+ }
15112
+ }
15113
+ };
15091
15114
 
15092
15115
  /**
15093
15116
  *
@@ -15108,6 +15131,18 @@ const cornerstoneExtension = {
15108
15131
  toolbarService.registerEventForToolbarUpdate(cornerstoneViewportService, [cornerstoneViewportService.EVENTS.VIEWPORT_DATA_CHANGED]);
15109
15132
  toolbarService.registerEventForToolbarUpdate(segmentationService, [segmentationService.EVENTS.SEGMENTATION_ADDED, segmentationService.EVENTS.SEGMENTATION_REMOVED, segmentationService.EVENTS.SEGMENTATION_UPDATED]);
15110
15133
  toolbarService.registerEventForToolbarUpdate(esm.eventTarget, [dist_esm.Enums.Events.TOOL_ACTIVATED]);
15134
+
15135
+ // Configure the interleaved/HTJ2K loader
15136
+ imageRetrieveMetadataProvider.clear();
15137
+ // The default volume interleaved options are to interleave the
15138
+ // image retrieve, but don't perform progressive loading per image
15139
+ // This interleaves images and replicates them for low-resolution depth volume
15140
+ // reconstruction, which progressively improves
15141
+ imageRetrieveMetadataProvider.add('volume', esm.ProgressiveRetrieveImages.interleavedRetrieveStages);
15142
+ // The default stack loading option is to progressive load HTJ2K images
15143
+ // There are other possible options, but these need more thought about
15144
+ // how to define them.
15145
+ imageRetrieveMetadataProvider.add('stack', stackRetrieveOptions);
15111
15146
  },
15112
15147
  onModeExit: ({
15113
15148
  servicesManager
@@ -15340,7 +15375,7 @@ const reset = () => {
15340
15375
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
15341
15376
  /* harmony export */ Z: () => (/* binding */ getSOPInstanceAttributes)
15342
15377
  /* harmony export */ });
15343
- /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(62709);
15378
+ /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12651);
15344
15379
 
15345
15380
 
15346
15381
  /**