@ohif/app 3.14.0-beta.55 → 3.14.0-beta.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{9187.bundle.47a04a89.js → 1283.bundle.56abacf4.js} +162 -137
- package/dist/{4262.bundle.0c550b7f.js → 1558.bundle.03d5783b.js} +36 -11
- package/dist/{1566.bundle.8d90bb15.js → 1566.bundle.e9f5d851.js} +5 -1
- package/dist/{1645.bundle.65cff869.js → 1645.bundle.618a2886.js} +700 -389
- package/dist/{1724.bundle.b4757283.js → 1724.bundle.59b20c59.js} +1184 -1139
- package/dist/{1788.bundle.5b78672d.js → 1788.bundle.3f1349d2.js} +101 -43
- package/dist/1975.bundle.53cf5d7c.js +8216 -0
- package/dist/{5922.bundle.46b3e037.js → 2894.bundle.db3f8686.js} +240 -151
- package/dist/{6567.bundle.cc57e572.js → 3044.bundle.039294b9.js} +105 -76
- package/dist/{3386.bundle.7665dd43.js → 3386.bundle.a9fd7dfd.js} +92 -23
- package/dist/{4004.bundle.da822fd2.js → 4018.bundle.48c288e5.js} +128 -253
- package/dist/{2894.bundle.d612efb2.js → 513.bundle.9c0548cf.js} +1 -1
- package/dist/{5143.bundle.62bcf4ee.js → 5143.bundle.67167d39.js} +219 -147
- package/dist/{5895.bundle.b4892e1b.js → 5320.bundle.0c7b2cb7.js} +1473 -617
- package/dist/{5383.bundle.d393d2f5.js → 5383.bundle.79243338.js} +26 -4
- package/dist/{4324.bundle.8645d6b4.js → 5888.bundle.cd717f42.js} +1364 -8004
- package/dist/{8128.bundle.2afe5a05.js → 5914.bundle.00f408d2.js} +419 -49
- package/dist/{1284.bundle.a489bd1d.js → 5989.bundle.f8096a4e.js} +1175 -616
- package/dist/{6255.bundle.ee378f1c.js → 6255.bundle.521051c1.js} +42 -18
- package/dist/{829.bundle.e60fee3a.js → 641.bundle.4627a8e1.js} +472 -483
- package/dist/{1568.bundle.474a5a93.js → 9187.bundle.237037e4.js} +1 -1
- package/dist/{6711.bundle.baba2ccd.js → 9232.bundle.3b0caf8e.js} +10 -10
- package/dist/{1895.bundle.923d0bd4.js → 9620.bundle.67375c83.js} +82 -24
- package/dist/{app.bundle.3a861c86.js → app.bundle.5a277c45.js} +44 -44
- package/dist/{compute.bundle.caab94e6.js → compute.bundle.a8f26c49.js} +10 -10
- package/dist/index.html +1 -1
- package/dist/{interpolation.bundle.eed65b60.js → interpolation.bundle.aef2f614.js} +5 -5
- package/dist/{polySeg.bundle.34a58c4f.js → polySeg.bundle.ba052ac3.js} +11 -11
- package/dist/static/wasm/{27ff970b98.module.wasm → 0e14aeab30.module.wasm} +0 -0
- package/dist/static/wasm/58a146bc8c.module.wasm +0 -0
- package/dist/static/wasm/99a2672e64.module.wasm +0 -0
- package/dist/static/wasm/{11f8dc2413.module.wasm → d8b213f3ea.module.wasm} +0 -0
- package/dist/sw.js +1 -1
- package/package.json +6 -6
- package/dist/0.bundle.485115b4.js +0 -4498
- package/dist/static/wasm/58769f1d7d.module.wasm +0 -0
- /package/dist/{1895.bundle.css → 9620.bundle.css} +0 -0
|
@@ -1878,6 +1878,17 @@ var ChangeTypes;
|
|
|
1878
1878
|
/* export default */ __webpack_exports__.A = (ChangeTypes);
|
|
1879
1879
|
|
|
1880
1880
|
|
|
1881
|
+
},
|
|
1882
|
+
52602(__unused_rspack___webpack_module__, __webpack_exports__) {
|
|
1883
|
+
var SegmentationRepresentations;
|
|
1884
|
+
(function (SegmentationRepresentations) {
|
|
1885
|
+
SegmentationRepresentations["Labelmap"] = "Labelmap";
|
|
1886
|
+
SegmentationRepresentations["Contour"] = "Contour";
|
|
1887
|
+
SegmentationRepresentations["Surface"] = "Surface";
|
|
1888
|
+
})(SegmentationRepresentations || (SegmentationRepresentations = {}));
|
|
1889
|
+
/* export default */ __webpack_exports__.A = (SegmentationRepresentations);
|
|
1890
|
+
|
|
1891
|
+
|
|
1881
1892
|
},
|
|
1882
1893
|
48413(__unused_rspack___webpack_module__, __webpack_exports__) {
|
|
1883
1894
|
var StrategyCallbacks;
|
|
@@ -2457,7 +2468,9 @@ function mouseDownActivate(evt) {
|
|
|
2457
2468
|
if (activeTool.addNewAnnotation) {
|
|
2458
2469
|
try {
|
|
2459
2470
|
const annotation = activeTool.addNewAnnotation(evt, 'mouse');
|
|
2460
|
-
(
|
|
2471
|
+
if (annotation?.annotationUID) {
|
|
2472
|
+
(0,_stateManagement_annotation_annotationSelection_js__rspack_import_2.setAnnotationSelected)(annotation.annotationUID);
|
|
2473
|
+
}
|
|
2461
2474
|
}
|
|
2462
2475
|
catch (error) {
|
|
2463
2476
|
cs3dLogger.warn('Error adding new annotation, viewport not ready:', error);
|
|
@@ -3186,7 +3199,9 @@ function touchStartActivate(evt) {
|
|
|
3186
3199
|
if (activeTool.addNewAnnotation) {
|
|
3187
3200
|
try {
|
|
3188
3201
|
const annotation = activeTool.addNewAnnotation(evt, 'touch');
|
|
3189
|
-
(
|
|
3202
|
+
if (annotation?.annotationUID) {
|
|
3203
|
+
(0,_stateManagement_annotation_annotationSelection_js__rspack_import_1.setAnnotationSelected)(annotation.annotationUID);
|
|
3204
|
+
}
|
|
3190
3205
|
}
|
|
3191
3206
|
catch (error) {
|
|
3192
3207
|
cs3dLogger.warn('Error adding new annotation, viewport not ready:', error);
|
|
@@ -5041,7 +5056,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5041
5056
|
/* import */ var _cursors_index_js__rspack_import_8 = __webpack_require__(80935);
|
|
5042
5057
|
/* import */ var _types_index_js__rspack_import_9 = __webpack_require__(34521);
|
|
5043
5058
|
/* import */ var _stateManagement_annotation_index_js__rspack_import_10 = __webpack_require__(51236);
|
|
5044
|
-
/* import */ var _stateManagement_segmentation_index_js__rspack_import_11 = __webpack_require__(
|
|
5059
|
+
/* import */ var _stateManagement_segmentation_index_js__rspack_import_11 = __webpack_require__(86274);
|
|
5045
5060
|
/* import */ var _tools_annotation_splines_index_js__rspack_import_12 = __webpack_require__(30688);
|
|
5046
5061
|
/* import */ var _tools_index_js__rspack_import_13 = __webpack_require__(24215);
|
|
5047
5062
|
/* import */ var _tools_annotation_VideoRedactionTool_js__rspack_import_14 = __webpack_require__(71459);
|
|
@@ -5155,7 +5170,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
5155
5170
|
store: () => (/* reexport module object */ _store_index_js__rspack_import_1),
|
|
5156
5171
|
synchronizers: () => (/* reexport module object */ _synchronizers_index_js__rspack_import_5),
|
|
5157
5172
|
utilities: () => (/* reexport module object */ _utilities_index_js__rspack_import_7),
|
|
5158
|
-
version: () => (/* reexport safe */ (/* inlined export _version_js__rspack_import_4 */"5.
|
|
5173
|
+
version: () => (/* reexport safe */ (/* inlined export _version_js__rspack_import_4 */"5.12.0"))
|
|
5159
5174
|
});
|
|
5160
5175
|
|
|
5161
5176
|
|
|
@@ -6854,7 +6869,11 @@ class SegmentationStateManager {
|
|
|
6854
6869
|
delete state.viewportSegRepresentations[viewportId];
|
|
6855
6870
|
}
|
|
6856
6871
|
else if (activeRepresentationRemoved) {
|
|
6857
|
-
state.viewportSegRepresentations[viewportId]
|
|
6872
|
+
const remainingRepresentations = state.viewportSegRepresentations[viewportId];
|
|
6873
|
+
const hasActiveRepresentation = remainingRepresentations.some((representation) => representation.active);
|
|
6874
|
+
if (!hasActiveRepresentation) {
|
|
6875
|
+
remainingRepresentations[0].active = true;
|
|
6876
|
+
}
|
|
6858
6877
|
}
|
|
6859
6878
|
}
|
|
6860
6879
|
});
|
|
@@ -6865,10 +6884,9 @@ class SegmentationStateManager {
|
|
|
6865
6884
|
removedRepresentations.forEach((representation) => {
|
|
6866
6885
|
(0,_triggerSegmentationEvents_js__rspack_import_5.triggerSegmentationRepresentationRemoved)(viewportId, representation.segmentationId, representation.type);
|
|
6867
6886
|
});
|
|
6868
|
-
const
|
|
6869
|
-
if (
|
|
6870
|
-
|
|
6871
|
-
(0,_triggerSegmentationEvents_js__rspack_import_5.triggerSegmentationRepresentationModified)(viewportId, remainingRepresentations[0].segmentationId, remainingRepresentations[0].type);
|
|
6887
|
+
const activeRepresentation = this.getSegmentationRepresentations(viewportId).find((representation) => representation.active);
|
|
6888
|
+
if (activeRepresentation) {
|
|
6889
|
+
(0,_triggerSegmentationEvents_js__rspack_import_5.triggerSegmentationRepresentationModified)(viewportId, activeRepresentation.segmentationId, activeRepresentation.type);
|
|
6872
6890
|
}
|
|
6873
6891
|
return removedRepresentations;
|
|
6874
6892
|
}
|
|
@@ -7424,6 +7442,77 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
7424
7442
|
});
|
|
7425
7443
|
|
|
7426
7444
|
|
|
7445
|
+
},
|
|
7446
|
+
64540(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
7447
|
+
__webpack_require__.r(__webpack_exports__);
|
|
7448
|
+
/* import */ var _getSegmentationRepresentation_js__rspack_import_0 = __webpack_require__(47290);
|
|
7449
|
+
/* import */ var _setSegmentationRepresentationVisibility_js__rspack_import_1 = __webpack_require__(54766);
|
|
7450
|
+
/* import */ var _getSegmentationRepresentationVisibility_js__rspack_import_2 = __webpack_require__(45114);
|
|
7451
|
+
/* import */ var _SegmentationRenderingEngine_js__rspack_import_3 = __webpack_require__(79157);
|
|
7452
|
+
/* import */ var _triggerSegmentationEvents_js__rspack_import_4 = __webpack_require__(11815);
|
|
7453
|
+
|
|
7454
|
+
|
|
7455
|
+
|
|
7456
|
+
|
|
7457
|
+
|
|
7458
|
+
function setSegmentationRepresentationVisibility(viewportId, specifier, visibility) {
|
|
7459
|
+
const representations = (0,_getSegmentationRepresentation_js__rspack_import_0/* .getSegmentationRepresentations */.r$)(viewportId, specifier);
|
|
7460
|
+
if (!representations) {
|
|
7461
|
+
return;
|
|
7462
|
+
}
|
|
7463
|
+
representations.forEach((representation) => {
|
|
7464
|
+
(0,_setSegmentationRepresentationVisibility_js__rspack_import_1/* .setSegmentationRepresentationVisibility */.s)(viewportId, {
|
|
7465
|
+
segmentationId: representation.segmentationId,
|
|
7466
|
+
type: representation.type,
|
|
7467
|
+
}, visibility);
|
|
7468
|
+
});
|
|
7469
|
+
}
|
|
7470
|
+
function getSegmentationRepresentationVisibility(viewportId, specifier) {
|
|
7471
|
+
return (0,_getSegmentationRepresentationVisibility_js__rspack_import_2/* .getSegmentationRepresentationVisibility */.I)(viewportId, specifier);
|
|
7472
|
+
}
|
|
7473
|
+
function setSegmentIndexVisibility(viewportId, specifier, segmentIndex, visibility) {
|
|
7474
|
+
const representations = (0,_getSegmentationRepresentation_js__rspack_import_0/* .getSegmentationRepresentations */.r$)(viewportId, specifier);
|
|
7475
|
+
if (!representations) {
|
|
7476
|
+
return;
|
|
7477
|
+
}
|
|
7478
|
+
representations.forEach((representation) => {
|
|
7479
|
+
if (!representation.segments || !representation.segments[segmentIndex]) {
|
|
7480
|
+
return;
|
|
7481
|
+
}
|
|
7482
|
+
representation.visible ||= visibility;
|
|
7483
|
+
representation.segments[segmentIndex].visible = visibility;
|
|
7484
|
+
});
|
|
7485
|
+
(0,_SegmentationRenderingEngine_js__rspack_import_3/* .triggerSegmentationRenderBySegmentationId */.fy)(specifier.segmentationId);
|
|
7486
|
+
(0,_triggerSegmentationEvents_js__rspack_import_4.triggerSegmentationRepresentationModified)(viewportId, specifier.segmentationId);
|
|
7487
|
+
}
|
|
7488
|
+
function getSegmentIndexVisibility(viewportId, specifier, segmentIndex) {
|
|
7489
|
+
const hiddenSegments = getHiddenSegmentIndices(viewportId, specifier);
|
|
7490
|
+
return !hiddenSegments.has(segmentIndex);
|
|
7491
|
+
}
|
|
7492
|
+
function getHiddenSegmentIndices(viewportId, specifier) {
|
|
7493
|
+
const representation = (0,_getSegmentationRepresentation_js__rspack_import_0/* .getSegmentationRepresentation */.Ut)(viewportId, specifier);
|
|
7494
|
+
if (!representation) {
|
|
7495
|
+
return new Set();
|
|
7496
|
+
}
|
|
7497
|
+
const segmentsHidden = Object.entries(representation.segments).reduce((acc, [segmentIndex, segment]) => {
|
|
7498
|
+
if (!segment.visible) {
|
|
7499
|
+
acc.add(Number(segmentIndex));
|
|
7500
|
+
}
|
|
7501
|
+
return acc;
|
|
7502
|
+
}, new Set());
|
|
7503
|
+
return segmentsHidden;
|
|
7504
|
+
}
|
|
7505
|
+
|
|
7506
|
+
|
|
7507
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
7508
|
+
getHiddenSegmentIndices: () => (getHiddenSegmentIndices),
|
|
7509
|
+
getSegmentIndexVisibility: () => (getSegmentIndexVisibility),
|
|
7510
|
+
getSegmentationRepresentationVisibility: () => (getSegmentationRepresentationVisibility),
|
|
7511
|
+
setSegmentIndexVisibility: () => (setSegmentIndexVisibility),
|
|
7512
|
+
setSegmentationRepresentationVisibility: () => (setSegmentationRepresentationVisibility)
|
|
7513
|
+
});
|
|
7514
|
+
|
|
7515
|
+
|
|
7427
7516
|
},
|
|
7428
7517
|
12366(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
7429
7518
|
/* import */ var _cornerstonejs_core__rspack_import_0 = __webpack_require__(62721);
|
|
@@ -7492,6 +7581,34 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
7492
7581
|
});
|
|
7493
7582
|
|
|
7494
7583
|
|
|
7584
|
+
},
|
|
7585
|
+
47290(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
7586
|
+
/* import */ var _SegmentationStateManager_js__rspack_import_0 = __webpack_require__(91155);
|
|
7587
|
+
|
|
7588
|
+
function getSegmentationRepresentations(viewportId, specifier = {}) {
|
|
7589
|
+
const segmentationStateManager = _SegmentationStateManager_js__rspack_import_0/* .defaultSegmentationStateManager */._6;
|
|
7590
|
+
return segmentationStateManager.getSegmentationRepresentations(viewportId, specifier);
|
|
7591
|
+
}
|
|
7592
|
+
function getSegmentationRepresentation(viewportId, specifier) {
|
|
7593
|
+
const segmentationStateManager = _SegmentationStateManager_js__rspack_import_0/* .defaultSegmentationStateManager */._6;
|
|
7594
|
+
if (!specifier.segmentationId || !specifier.type) {
|
|
7595
|
+
throw new Error('getSegmentationRepresentation: No segmentationId or type provided, you need to provide at least one of them');
|
|
7596
|
+
}
|
|
7597
|
+
const representations = segmentationStateManager.getSegmentationRepresentations(viewportId, specifier);
|
|
7598
|
+
return representations?.[0];
|
|
7599
|
+
}
|
|
7600
|
+
function getSegmentationRepresentationsBySegmentationId(segmentationId) {
|
|
7601
|
+
const segmentationStateManager = _SegmentationStateManager_js__rspack_import_0/* .defaultSegmentationStateManager */._6;
|
|
7602
|
+
return segmentationStateManager.getSegmentationRepresentationsBySegmentationId(segmentationId);
|
|
7603
|
+
}
|
|
7604
|
+
|
|
7605
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
7606
|
+
Ut: () => (getSegmentationRepresentation),
|
|
7607
|
+
ny: () => (getSegmentationRepresentationsBySegmentationId),
|
|
7608
|
+
r$: () => (getSegmentationRepresentations)
|
|
7609
|
+
});
|
|
7610
|
+
|
|
7611
|
+
|
|
7495
7612
|
},
|
|
7496
7613
|
39046(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
7497
7614
|
/* import */ var _SegmentationStateManager_js__rspack_import_0 = __webpack_require__(91155);
|
|
@@ -7654,6 +7771,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
7654
7771
|
Nf: () => (/* reexport safe */ _labelmapModel_index_js__rspack_import_0.Nf),
|
|
7655
7772
|
Pi: () => (/* reexport safe */ _labelmapModel_index_js__rspack_import_0.Pi),
|
|
7656
7773
|
Qk: () => (/* reexport safe */ _labelmapModel_index_js__rspack_import_0.Qk),
|
|
7774
|
+
RP: () => (/* reexport safe */ _labelmapModel_index_js__rspack_import_0.RP),
|
|
7657
7775
|
Ry: () => (/* reexport safe */ _labelmapModel_index_js__rspack_import_0.Ry),
|
|
7658
7776
|
VQ: () => (/* reexport safe */ _labelmapModel_index_js__rspack_import_0.VQ),
|
|
7659
7777
|
Zs: () => (/* reexport safe */ _labelmapModel_index_js__rspack_import_0.Zs),
|
|
@@ -7667,7 +7785,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
7667
7785
|
|
|
7668
7786
|
|
|
7669
7787
|
},
|
|
7670
|
-
|
|
7788
|
+
86274(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
7671
7789
|
// ESM COMPAT FLAG
|
|
7672
7790
|
__webpack_require__.r(__webpack_exports__);
|
|
7673
7791
|
|
|
@@ -7712,16 +7830,6 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
7712
7830
|
updateSegmentations: () => (/* reexport */ updateSegmentations),
|
|
7713
7831
|
utilities: () => (/* reexport */ utilities)
|
|
7714
7832
|
});
|
|
7715
|
-
// NAMESPACE OBJECT: ../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/config/segmentationVisibility.js
|
|
7716
|
-
var segmentationVisibility_namespaceObject = {};
|
|
7717
|
-
__webpack_require__.r(segmentationVisibility_namespaceObject);
|
|
7718
|
-
__webpack_require__.d(segmentationVisibility_namespaceObject, {
|
|
7719
|
-
getHiddenSegmentIndices: () => (getHiddenSegmentIndices),
|
|
7720
|
-
getSegmentIndexVisibility: () => (getSegmentIndexVisibility),
|
|
7721
|
-
getSegmentationRepresentationVisibility: () => (segmentationVisibility_getSegmentationRepresentationVisibility),
|
|
7722
|
-
setSegmentIndexVisibility: () => (setSegmentIndexVisibility),
|
|
7723
|
-
setSegmentationRepresentationVisibility: () => (segmentationVisibility_setSegmentationRepresentationVisibility) });
|
|
7724
|
-
|
|
7725
7833
|
// NAMESPACE OBJECT: ../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/config/styleHelpers.js
|
|
7726
7834
|
var styleHelpers_namespaceObject = {};
|
|
7727
7835
|
__webpack_require__.r(styleHelpers_namespaceObject);
|
|
@@ -7739,7 +7847,7 @@ __webpack_require__.r(config_namespaceObject);
|
|
|
7739
7847
|
__webpack_require__.d(config_namespaceObject, {
|
|
7740
7848
|
color: () => (segmentationColor),
|
|
7741
7849
|
style: () => (styleHelpers_namespaceObject),
|
|
7742
|
-
visibility: () => (
|
|
7850
|
+
visibility: () => (segmentationVisibility) });
|
|
7743
7851
|
|
|
7744
7852
|
|
|
7745
7853
|
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/removeSegmentationRepresentations.js
|
|
@@ -7775,78 +7883,14 @@ var segmentLocking = __webpack_require__(65419);
|
|
|
7775
7883
|
var segmentationState = __webpack_require__(61342);
|
|
7776
7884
|
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/config/segmentationColor.js
|
|
7777
7885
|
var segmentationColor = __webpack_require__(4069);
|
|
7778
|
-
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/
|
|
7779
|
-
var
|
|
7780
|
-
;// CONCATENATED MODULE: ../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/setSegmentationRepresentationVisibility.js
|
|
7781
|
-
|
|
7782
|
-
function setSegmentationRepresentationVisibility(viewportId, specifier, visible) {
|
|
7783
|
-
const segmentationStateManager = SegmentationStateManager/* .defaultSegmentationStateManager */._6;
|
|
7784
|
-
segmentationStateManager.setSegmentationRepresentationVisibility(viewportId, specifier, visible);
|
|
7785
|
-
}
|
|
7786
|
-
|
|
7787
|
-
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/getSegmentationRepresentationVisibility.js
|
|
7788
|
-
var getSegmentationRepresentationVisibility = __webpack_require__(45114);
|
|
7789
|
-
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/SegmentationRenderingEngine.js
|
|
7790
|
-
var SegmentationRenderingEngine = __webpack_require__(79157);
|
|
7791
|
-
;// CONCATENATED MODULE: ../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/config/segmentationVisibility.js
|
|
7792
|
-
|
|
7793
|
-
|
|
7794
|
-
|
|
7795
|
-
|
|
7796
|
-
|
|
7797
|
-
function segmentationVisibility_setSegmentationRepresentationVisibility(viewportId, specifier, visibility) {
|
|
7798
|
-
const representations = (0,getSegmentationRepresentation/* .getSegmentationRepresentations */.r$)(viewportId, specifier);
|
|
7799
|
-
if (!representations) {
|
|
7800
|
-
return;
|
|
7801
|
-
}
|
|
7802
|
-
representations.forEach((representation) => {
|
|
7803
|
-
setSegmentationRepresentationVisibility(viewportId, {
|
|
7804
|
-
segmentationId: representation.segmentationId,
|
|
7805
|
-
type: representation.type,
|
|
7806
|
-
}, visibility);
|
|
7807
|
-
});
|
|
7808
|
-
}
|
|
7809
|
-
function segmentationVisibility_getSegmentationRepresentationVisibility(viewportId, specifier) {
|
|
7810
|
-
return (0,getSegmentationRepresentationVisibility/* .getSegmentationRepresentationVisibility */.I)(viewportId, specifier);
|
|
7811
|
-
}
|
|
7812
|
-
function setSegmentIndexVisibility(viewportId, specifier, segmentIndex, visibility) {
|
|
7813
|
-
const representations = (0,getSegmentationRepresentation/* .getSegmentationRepresentations */.r$)(viewportId, specifier);
|
|
7814
|
-
if (!representations) {
|
|
7815
|
-
return;
|
|
7816
|
-
}
|
|
7817
|
-
representations.forEach((representation) => {
|
|
7818
|
-
if (!representation.segments || !representation.segments[segmentIndex]) {
|
|
7819
|
-
return;
|
|
7820
|
-
}
|
|
7821
|
-
representation.visible ||= visibility;
|
|
7822
|
-
representation.segments[segmentIndex].visible = visibility;
|
|
7823
|
-
});
|
|
7824
|
-
(0,SegmentationRenderingEngine/* .triggerSegmentationRenderBySegmentationId */.fy)(specifier.segmentationId);
|
|
7825
|
-
(0,triggerSegmentationEvents.triggerSegmentationRepresentationModified)(viewportId, specifier.segmentationId);
|
|
7826
|
-
}
|
|
7827
|
-
function getSegmentIndexVisibility(viewportId, specifier, segmentIndex) {
|
|
7828
|
-
const hiddenSegments = getHiddenSegmentIndices(viewportId, specifier);
|
|
7829
|
-
return !hiddenSegments.has(segmentIndex);
|
|
7830
|
-
}
|
|
7831
|
-
function getHiddenSegmentIndices(viewportId, specifier) {
|
|
7832
|
-
const representation = (0,getSegmentationRepresentation/* .getSegmentationRepresentation */.Ut)(viewportId, specifier);
|
|
7833
|
-
if (!representation) {
|
|
7834
|
-
return new Set();
|
|
7835
|
-
}
|
|
7836
|
-
const segmentsHidden = Object.entries(representation.segments).reduce((acc, [segmentIndex, segment]) => {
|
|
7837
|
-
if (!segment.visible) {
|
|
7838
|
-
acc.add(Number(segmentIndex));
|
|
7839
|
-
}
|
|
7840
|
-
return acc;
|
|
7841
|
-
}, new Set());
|
|
7842
|
-
return segmentsHidden;
|
|
7843
|
-
}
|
|
7844
|
-
|
|
7845
|
-
|
|
7886
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/config/segmentationVisibility.js
|
|
7887
|
+
var segmentationVisibility = __webpack_require__(64540);
|
|
7846
7888
|
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/getSegmentations.js
|
|
7847
7889
|
var getSegmentations = __webpack_require__(39046);
|
|
7848
7890
|
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/getViewportSegmentations.js
|
|
7849
7891
|
var getViewportSegmentations = __webpack_require__(85160);
|
|
7892
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/SegmentationRenderingEngine.js
|
|
7893
|
+
var SegmentationRenderingEngine = __webpack_require__(79157);
|
|
7850
7894
|
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/SegmentationStyle.js
|
|
7851
7895
|
var SegmentationStyle = __webpack_require__(29966);
|
|
7852
7896
|
;// CONCATENATED MODULE: ../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/config/styleHelpers.js
|
|
@@ -7960,10 +8004,49 @@ function clearSegmentValue(segmentationId, segmentIndex, options) {
|
|
|
7960
8004
|
}
|
|
7961
8005
|
}
|
|
7962
8006
|
|
|
8007
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/labelmapModel/privateLabelmap.js
|
|
8008
|
+
var privateLabelmap = __webpack_require__(55892);
|
|
8009
|
+
;// CONCATENATED MODULE: ../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/helpers/moveSegmentToPrivateLabelmap.js
|
|
8010
|
+
|
|
8011
|
+
|
|
8012
|
+
|
|
8013
|
+
|
|
8014
|
+
const { DefaultHistoryMemo: moveSegmentToPrivateLabelmap_DefaultHistoryMemo } = esm.utilities.HistoryMemo;
|
|
8015
|
+
function moveSegmentToPrivateLabelmap(segmentationId, segmentIndex, options) {
|
|
8016
|
+
const segmentation = (0,getSegmentation/* .getSegmentation */.T)(segmentationId);
|
|
8017
|
+
if (!segmentation?.representationData.Labelmap) {
|
|
8018
|
+
return;
|
|
8019
|
+
}
|
|
8020
|
+
const layer = (0,privateLabelmap/* .moveSegmentToPrivateLabelmap */.J)(segmentation, segmentIndex, {
|
|
8021
|
+
moveStepCallback: (step) => {
|
|
8022
|
+
if (!options?.recordHistory) {
|
|
8023
|
+
return;
|
|
8024
|
+
}
|
|
8025
|
+
moveSegmentToPrivateLabelmap_DefaultHistoryMemo.push({
|
|
8026
|
+
restoreMemo: (undo) => {
|
|
8027
|
+
if (undo) {
|
|
8028
|
+
step.undo();
|
|
8029
|
+
}
|
|
8030
|
+
else {
|
|
8031
|
+
step.redo();
|
|
8032
|
+
}
|
|
8033
|
+
(0,triggerSegmentationEvents.triggerSegmentationDataModified)(segmentationId);
|
|
8034
|
+
},
|
|
8035
|
+
});
|
|
8036
|
+
},
|
|
8037
|
+
});
|
|
8038
|
+
(0,triggerSegmentationEvents.triggerSegmentationDataModified)(segmentationId);
|
|
8039
|
+
return layer?.labelmapId;
|
|
8040
|
+
}
|
|
8041
|
+
|
|
7963
8042
|
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/helpers/computeStackLabelmapFromVolume.js + 1 modules
|
|
7964
8043
|
var computeStackLabelmapFromVolume = __webpack_require__(11474);
|
|
8044
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/labelmapModel/index.js
|
|
8045
|
+
var labelmapModel = __webpack_require__(82159);
|
|
7965
8046
|
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/getActiveSegmentIndex.js
|
|
7966
8047
|
var getActiveSegmentIndex = __webpack_require__(72676);
|
|
8048
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/getSegmentationRepresentation.js
|
|
8049
|
+
var getSegmentationRepresentation = __webpack_require__(47290);
|
|
7967
8050
|
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/getViewportIdsWithSegmentation.js
|
|
7968
8051
|
var getViewportIdsWithSegmentation = __webpack_require__(66155);
|
|
7969
8052
|
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/annotation/annotationState.js
|
|
@@ -8117,6 +8200,8 @@ var segmentationEventManager = __webpack_require__(65604);
|
|
|
8117
8200
|
|
|
8118
8201
|
|
|
8119
8202
|
|
|
8203
|
+
|
|
8204
|
+
|
|
8120
8205
|
|
|
8121
8206
|
|
|
8122
8207
|
|
|
@@ -8125,6 +8210,10 @@ const helpers = {
|
|
|
8125
8210
|
convertStackToVolumeLabelmap: convertStackToVolumeLabelmap,
|
|
8126
8211
|
computeVolumeLabelmapFromStack: computeVolumeLabelmapFromStack/* .computeVolumeLabelmapFromStack */.a,
|
|
8127
8212
|
convertVolumeToStackLabelmap: computeStackLabelmapFromVolume/* .convertVolumeToStackLabelmap */.f,
|
|
8213
|
+
getLabelToSegmentIndex: labelmapModel/* .getLabelToSegmentIndex */.rR,
|
|
8214
|
+
getLabelValueForSegment: labelmapModel/* .getLabelValueForSegment */.GY,
|
|
8215
|
+
getSegmentIndexForLabelValue: labelmapModel/* .getSegmentIndexForLabelValue */.Mx,
|
|
8216
|
+
moveSegmentToPrivateLabelmap: moveSegmentToPrivateLabelmap,
|
|
8128
8217
|
};
|
|
8129
8218
|
|
|
8130
8219
|
|
|
@@ -8189,6 +8278,7 @@ function internalAddRepresentationData({ segmentationId, type, data, }) {
|
|
|
8189
8278
|
|
|
8190
8279
|
__webpack_require__.d(__webpack_exports__, {
|
|
8191
8280
|
BS: () => (/* reexport safe */ _labelmapLayerStore_js__rspack_import_1.BS),
|
|
8281
|
+
GY: () => (/* reexport safe */ _labelmapSegmentBindings_js__rspack_import_3.GY),
|
|
8192
8282
|
Hs: () => (/* reexport safe */ _labelmapLayerStore_js__rspack_import_1.Hs),
|
|
8193
8283
|
Lp: () => (/* reexport safe */ _labelmapImageReferenceResolver_js__rspack_import_6.A),
|
|
8194
8284
|
M4: () => (/* reexport safe */ _labelmapLayerStore_js__rspack_import_1.M4),
|
|
@@ -8196,6 +8286,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
8196
8286
|
Nf: () => (/* reexport safe */ _labelmapSegmentBindings_js__rspack_import_3.Nf),
|
|
8197
8287
|
Pi: () => (/* reexport safe */ _labelmapSegmentBindings_js__rspack_import_3.Pi),
|
|
8198
8288
|
Qk: () => (/* reexport safe */ _labelmapEditTransaction_js__rspack_import_5.Qk),
|
|
8289
|
+
RP: () => (/* reexport safe */ _labelmapEditTransaction_js__rspack_import_5.RP),
|
|
8199
8290
|
Ry: () => (/* reexport safe */ _labelmapEditTransaction_js__rspack_import_5.Ry),
|
|
8200
8291
|
VQ: () => (/* reexport safe */ _labelmapEditTransaction_js__rspack_import_5.VQ),
|
|
8201
8292
|
Zs: () => (/* reexport safe */ _labelmapSegmentBindings_js__rspack_import_3.Zs),
|
|
@@ -8203,6 +8294,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
8203
8294
|
kL: () => (/* reexport safe */ _labelmapLayerStore_js__rspack_import_1.kL),
|
|
8204
8295
|
m: () => (/* reexport safe */ _labelmapLayerStore_js__rspack_import_1.m),
|
|
8205
8296
|
r: () => (/* reexport safe */ _labelmapSegmentBindings_js__rspack_import_3.r),
|
|
8297
|
+
rR: () => (/* reexport safe */ _labelmapSegmentBindings_js__rspack_import_3.rR),
|
|
8206
8298
|
uk: () => (/* reexport safe */ _normalizeLabelmapSegmentationData_js__rspack_import_0.uk),
|
|
8207
8299
|
xS: () => (/* reexport safe */ _labelmapLegacyAdapter_js__rspack_import_2.x)
|
|
8208
8300
|
});
|
|
@@ -8255,6 +8347,11 @@ function getSegmentIndexForLabelValue(segmentation, labelmapId, labelValue) {
|
|
|
8255
8347
|
}
|
|
8256
8348
|
return layer.labelToSegmentIndex?.[labelValue] ?? labelValue;
|
|
8257
8349
|
}
|
|
8350
|
+
function getLabelToSegmentIndex(segmentation, labelmapId) {
|
|
8351
|
+
return {
|
|
8352
|
+
...((0,_labelmapLayerStore_js__rspack_import_1/* .getLabelmap */.Hs)(segmentation, labelmapId)?.labelToSegmentIndex ?? {}),
|
|
8353
|
+
};
|
|
8354
|
+
}
|
|
8258
8355
|
function getLabelValueForSegment(segmentation, segmentIndex) {
|
|
8259
8356
|
return (getSegmentBinding(segmentation, segmentIndex)?.labelValue ?? segmentIndex);
|
|
8260
8357
|
}
|
|
@@ -8288,13 +8385,15 @@ function removeSegmentBinding(segmentation, segmentIndex) {
|
|
|
8288
8385
|
|
|
8289
8386
|
|
|
8290
8387
|
__webpack_require__.d(__webpack_exports__, {
|
|
8388
|
+
GY: () => (getLabelValueForSegment),
|
|
8291
8389
|
I3: () => (getSegmentsOnLabelmap),
|
|
8292
8390
|
Mx: () => (getSegmentIndexForLabelValue),
|
|
8293
8391
|
Nf: () => (resolveLabelmapForSegment),
|
|
8294
8392
|
Pi: () => (removeSegmentBinding),
|
|
8295
8393
|
Zs: () => (setSegmentBinding),
|
|
8296
8394
|
hM: () => (getSegmentBinding),
|
|
8297
|
-
r: () => (getLabelmapForSegment)
|
|
8395
|
+
r: () => (getLabelmapForSegment),
|
|
8396
|
+
rR: () => (getLabelToSegmentIndex)
|
|
8298
8397
|
});
|
|
8299
8398
|
|
|
8300
8399
|
|
|
@@ -8566,7 +8665,7 @@ function isSegmentIndexLocked(segmentationId, segmentIndex) {
|
|
|
8566
8665
|
throw new Error(`No segmentation state found for ${segmentationId}`);
|
|
8567
8666
|
}
|
|
8568
8667
|
const { segments } = segmentation;
|
|
8569
|
-
return segments[segmentIndex]
|
|
8668
|
+
return segments?.[segmentIndex]?.locked === true;
|
|
8570
8669
|
}
|
|
8571
8670
|
function setSegmentIndexLocked(segmentationId, segmentIndex, locked = true) {
|
|
8572
8671
|
const segmentation = (0,_stateManagement_segmentation_getSegmentation_js__rspack_import_0/* .getSegmentation */.T)(segmentationId);
|
|
@@ -8750,6 +8849,20 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
8750
8849
|
});
|
|
8751
8850
|
|
|
8752
8851
|
|
|
8852
|
+
},
|
|
8853
|
+
54766(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
8854
|
+
/* import */ var _SegmentationStateManager_js__rspack_import_0 = __webpack_require__(91155);
|
|
8855
|
+
|
|
8856
|
+
function setSegmentationRepresentationVisibility(viewportId, specifier, visible) {
|
|
8857
|
+
const segmentationStateManager = _SegmentationStateManager_js__rspack_import_0/* .defaultSegmentationStateManager */._6;
|
|
8858
|
+
segmentationStateManager.setSegmentationRepresentationVisibility(viewportId, specifier, visible);
|
|
8859
|
+
}
|
|
8860
|
+
|
|
8861
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
8862
|
+
s: () => (setSegmentationRepresentationVisibility)
|
|
8863
|
+
});
|
|
8864
|
+
|
|
8865
|
+
|
|
8753
8866
|
},
|
|
8754
8867
|
11815(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
8755
8868
|
// ESM COMPAT FLAG
|
|
@@ -11170,7 +11283,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
11170
11283
|
/* import */ var _store_ToolGroupManager_index_js__rspack_import_16 = __webpack_require__(91893);
|
|
11171
11284
|
/* import */ var _utilities_debounce_js__rspack_import_17 = __webpack_require__(20361);
|
|
11172
11285
|
/* import */ var _utilities_math_point_index_js__rspack_import_18 = __webpack_require__(3756);
|
|
11173
|
-
/* import */ var _stateManagement_segmentation_index_js__rspack_import_19 = __webpack_require__(
|
|
11286
|
+
/* import */ var _stateManagement_segmentation_index_js__rspack_import_19 = __webpack_require__(86274);
|
|
11174
11287
|
|
|
11175
11288
|
|
|
11176
11289
|
|
|
@@ -16752,7 +16865,7 @@ ScaleOverlayTool.toolName = 'ScaleOverlay';
|
|
|
16752
16865
|
/* import */ var _SculptorTool_CircleSculptCursor_js__rspack_import_10 = __webpack_require__(73455);
|
|
16753
16866
|
/* import */ var _distancePointToContour_js__rspack_import_11 = __webpack_require__(21111);
|
|
16754
16867
|
/* import */ var _store_ToolGroupManager_index_js__rspack_import_12 = __webpack_require__(91893);
|
|
16755
|
-
/* import */ var _utilities_math_polyline_index_js__rspack_import_13 = __webpack_require__(
|
|
16868
|
+
/* import */ var _utilities_math_polyline_index_js__rspack_import_13 = __webpack_require__(1109);
|
|
16756
16869
|
|
|
16757
16870
|
|
|
16758
16871
|
|
|
@@ -17594,7 +17707,7 @@ class SliceIntersectionTool extends _base_index_js__rspack_import_2/* .Annotatio
|
|
|
17594
17707
|
if (!enabledElement) {
|
|
17595
17708
|
return false;
|
|
17596
17709
|
}
|
|
17597
|
-
return !!this._findLineNear(enabledElement.viewport.id, canvasCoords, LINE_PROXIMITY, true);
|
|
17710
|
+
return !!this._findLineNear(enabledElement.viewport.id, canvasCoords, LINE_PROXIMITY, { includeHandles: true });
|
|
17598
17711
|
};
|
|
17599
17712
|
this.toolSelectedCallback = (evt, _annotation) => {
|
|
17600
17713
|
const { element, currentPoints } = evt.detail;
|
|
@@ -17671,7 +17784,7 @@ class SliceIntersectionTool extends _base_index_js__rspack_import_2/* .Annotatio
|
|
|
17671
17784
|
if (!this._isPlanarViewport(viewport)) {
|
|
17672
17785
|
return false;
|
|
17673
17786
|
}
|
|
17674
|
-
const lineInfo = this._findLineNear(viewport.id, currentPoints.canvas, LINE_PROXIMITY, true);
|
|
17787
|
+
const lineInfo = this._findLineNear(viewport.id, currentPoints.canvas, LINE_PROXIMITY, { includeHandles: true, includeSlabLines: true });
|
|
17675
17788
|
let needsRedraw = false;
|
|
17676
17789
|
if (lineInfo) {
|
|
17677
17790
|
if (this._activeGroupId !== lineInfo.groupId ||
|
|
@@ -17953,7 +18066,7 @@ class SliceIntersectionTool extends _base_index_js__rspack_import_2/* .Annotatio
|
|
|
17953
18066
|
this._appendSlabGeometry(lineInfo, targetViewport, targetPlane, leaderViewport, leaderPlane);
|
|
17954
18067
|
this._appendBoundaryGeometry(lineInfo, targetViewport, targetPlane, leaderViewport, leaderPlane);
|
|
17955
18068
|
if (isActive) {
|
|
17956
|
-
this._appendHandles(lineInfo,
|
|
18069
|
+
this._appendHandles(lineInfo, leaderViewport);
|
|
17957
18070
|
}
|
|
17958
18071
|
return lineInfo;
|
|
17959
18072
|
}
|
|
@@ -18060,7 +18173,7 @@ class SliceIntersectionTool extends _base_index_js__rspack_import_2/* .Annotatio
|
|
|
18060
18173
|
spacing: Number.isFinite(spacing) ? spacing : 0,
|
|
18061
18174
|
};
|
|
18062
18175
|
}
|
|
18063
|
-
_appendHandles(lineInfo,
|
|
18176
|
+
_appendHandles(lineInfo, leaderViewport) {
|
|
18064
18177
|
const { rotatable, slabThicknessControls, showSlabThickness } = this.configuration;
|
|
18065
18178
|
const [start, end] = lineInfo.canvasPoints;
|
|
18066
18179
|
const volumeMode = this._isVolumeModeViewport(leaderViewport);
|
|
@@ -18071,32 +18184,22 @@ class SliceIntersectionTool extends _base_index_js__rspack_import_2/* .Annotatio
|
|
|
18071
18184
|
]);
|
|
18072
18185
|
}
|
|
18073
18186
|
if (slabThicknessControls && showSlabThickness && volumeMode) {
|
|
18074
|
-
lineInfo.slabHandles = this._computeSlabHandles(lineInfo
|
|
18187
|
+
lineInfo.slabHandles = this._computeSlabHandles(lineInfo);
|
|
18075
18188
|
}
|
|
18076
18189
|
}
|
|
18077
|
-
_computeSlabHandles(lineInfo
|
|
18190
|
+
_computeSlabHandles(lineInfo) {
|
|
18078
18191
|
const [start, end] = lineInfo.canvasPoints;
|
|
18079
18192
|
const anchorCanvas = [
|
|
18080
18193
|
start[0] + (end[0] - start[0]) * SLAB_HANDLE_LINE_FRACTION,
|
|
18081
18194
|
start[1] + (end[1] - start[1]) * SLAB_HANDLE_LINE_FRACTION,
|
|
18082
18195
|
];
|
|
18083
|
-
const
|
|
18084
|
-
const
|
|
18085
|
-
|
|
18086
|
-
|
|
18087
|
-
|
|
18088
|
-
|
|
18089
|
-
|
|
18090
|
-
];
|
|
18091
|
-
const plusCanvas = targetViewport.worldToCanvas(plusWorld);
|
|
18092
|
-
const canvasOffset = Math.hypot(plusCanvas[0] - anchorCanvas[0], plusCanvas[1] - anchorCanvas[1]);
|
|
18093
|
-
if (canvasOffset >= MIN_SLAB_HANDLE_CANVAS_OFFSET) {
|
|
18094
|
-
const minusWorld = [
|
|
18095
|
-
anchorWorld[0] - normal[0] * (slabThickness / 2),
|
|
18096
|
-
anchorWorld[1] - normal[1] * (slabThickness / 2),
|
|
18097
|
-
anchorWorld[2] - normal[2] * (slabThickness / 2),
|
|
18098
|
-
];
|
|
18099
|
-
return [plusCanvas, targetViewport.worldToCanvas(minusWorld)];
|
|
18196
|
+
const minimumOffsetSquared = MIN_SLAB_HANDLE_CANVAS_OFFSET * MIN_SLAB_HANDLE_CANVAS_OFFSET;
|
|
18197
|
+
const handles = lineInfo.slabLineSegments
|
|
18198
|
+
.map(([segmentStart, segmentEnd]) => _utilities_math_line_index_js__rspack_import_12.distanceToPointSquaredInfo(segmentStart, segmentEnd, anchorCanvas))
|
|
18199
|
+
.filter((info) => info.distanceSquared >= minimumOffsetSquared)
|
|
18200
|
+
.map((info) => info.point);
|
|
18201
|
+
if (handles.length) {
|
|
18202
|
+
return handles;
|
|
18100
18203
|
}
|
|
18101
18204
|
const direction = gl_matrix__rspack_import_0/* .vec2.normalize */.Zc.S8(gl_matrix__rspack_import_0/* .vec2.create */.Zc.vt(), gl_matrix__rspack_import_0/* .vec2.subtract */.Zc.Re(gl_matrix__rspack_import_0/* .vec2.create */.Zc.vt(), end, start));
|
|
18102
18205
|
const perpendicular = [-direction[1], direction[0]];
|
|
@@ -18405,7 +18508,7 @@ class SliceIntersectionTool extends _base_index_js__rspack_import_2/* .Annotatio
|
|
|
18405
18508
|
targetViewportId: lineInfo.targetViewportId,
|
|
18406
18509
|
});
|
|
18407
18510
|
}
|
|
18408
|
-
_findLineNear(viewportId, canvasCoords, proximity, includeHandles = false) {
|
|
18511
|
+
_findLineNear(viewportId, canvasCoords, proximity, { includeHandles = false, includeSlabLines = false, } = {}) {
|
|
18409
18512
|
const lines = this._renderedLines.get(viewportId) ?? [];
|
|
18410
18513
|
const handleReach = this.configuration.handleRadius + proximity;
|
|
18411
18514
|
for (const lineInfo of lines) {
|
|
@@ -18423,6 +18526,22 @@ class SliceIntersectionTool extends _base_index_js__rspack_import_2/* .Annotatio
|
|
|
18423
18526
|
}
|
|
18424
18527
|
}
|
|
18425
18528
|
}
|
|
18529
|
+
if (includeSlabLines && this.configuration.slabThicknessControls) {
|
|
18530
|
+
let slabLineInfo = null;
|
|
18531
|
+
let slabLineDistance = Infinity;
|
|
18532
|
+
for (const lineInfo of lines) {
|
|
18533
|
+
for (const [segmentStart, segmentEnd] of lineInfo.slabLineSegments) {
|
|
18534
|
+
const distance = _utilities_math_line_index_js__rspack_import_12.distanceToPoint(segmentStart, segmentEnd, canvasCoords);
|
|
18535
|
+
if (distance <= proximity && distance < slabLineDistance) {
|
|
18536
|
+
slabLineDistance = distance;
|
|
18537
|
+
slabLineInfo = lineInfo;
|
|
18538
|
+
}
|
|
18539
|
+
}
|
|
18540
|
+
}
|
|
18541
|
+
if (slabLineInfo) {
|
|
18542
|
+
return slabLineInfo;
|
|
18543
|
+
}
|
|
18544
|
+
}
|
|
18426
18545
|
return null;
|
|
18427
18546
|
}
|
|
18428
18547
|
_getViewportsInfo() {
|
|
@@ -23570,6 +23689,7 @@ function changeTextCallback(data, eventData, doneChangingTextCallback) {
|
|
|
23570
23689
|
/* import */ var _utilities_defaultGetTextLines_js__rspack_import_22 = __webpack_require__(73131);
|
|
23571
23690
|
/* import */ var _utilities_getEllipseWorldCoordinates_js__rspack_import_23 = __webpack_require__(84455);
|
|
23572
23691
|
/* import */ var _utilities_sampleAreaAnnotationVoxels_js__rspack_import_24 = __webpack_require__(72821);
|
|
23692
|
+
/* import */ var _utilities_areaAnnotationShapeUtils_js__rspack_import_25 = __webpack_require__(98512);
|
|
23573
23693
|
var _a;
|
|
23574
23694
|
|
|
23575
23695
|
|
|
@@ -23595,6 +23715,7 @@ var _a;
|
|
|
23595
23715
|
|
|
23596
23716
|
|
|
23597
23717
|
|
|
23718
|
+
|
|
23598
23719
|
|
|
23599
23720
|
|
|
23600
23721
|
const cs3dLogger = _cornerstonejs_core__rspack_import_2.utilities.logger.toolsLog.getLogger('tools.annotation.CircleROITool');
|
|
@@ -24130,7 +24251,7 @@ class CircleROITool extends _base_index_js__rspack_import_0/* .AnnotationTool */
|
|
|
24130
24251
|
points: points,
|
|
24131
24252
|
boundsMargin: worldRadius,
|
|
24132
24253
|
createShape: ({ volume, planePoint, viewPlaneNormal }) => {
|
|
24133
|
-
if (!(
|
|
24254
|
+
if (!(0,_utilities_areaAnnotationShapeUtils_js__rspack_import_25/* .hasValidAreaAnnotationDimensions */.k)(worldRadius)) {
|
|
24134
24255
|
return null;
|
|
24135
24256
|
}
|
|
24136
24257
|
return createCircleShape({
|
|
@@ -24270,7 +24391,7 @@ function defaultGetTextLines(data, targetIds) {
|
|
|
24270
24391
|
/* import */ var _utilities_segmentation_floodFillSliceLazy_js__rspack_import_3 = __webpack_require__(69972);
|
|
24271
24392
|
/* import */ var _utilities_segmentation_growCut_intensityRange_adaptiveRegionIntensityRange_js__rspack_import_4 = __webpack_require__(24946);
|
|
24272
24393
|
/* import */ var _utilities_segmentation_growCut_getViewportVoiMappingForVolume_js__rspack_import_5 = __webpack_require__(76658);
|
|
24273
|
-
/* import */ var _stateManagement_segmentation_index_js__rspack_import_6 = __webpack_require__(
|
|
24394
|
+
/* import */ var _stateManagement_segmentation_index_js__rspack_import_6 = __webpack_require__(86274);
|
|
24274
24395
|
/* import */ var _stateManagement_segmentation_triggerSegmentationEvents_js__rspack_import_7 = __webpack_require__(11815);
|
|
24275
24396
|
/* import */ var _utilities_segmentation_createLabelmapMemo_js__rspack_import_8 = __webpack_require__(89725);
|
|
24276
24397
|
/* import */ var _regionSegmentHoverCursors_js__rspack_import_9 = __webpack_require__(36669);
|
|
@@ -26263,15 +26384,16 @@ ETDRSGridTool.toolName = 'ETDRSGrid';
|
|
|
26263
26384
|
/* import */ var _utilities_getViewportICamera_js__rspack_import_12 = __webpack_require__(40196);
|
|
26264
26385
|
/* import */ var _utilities_planar_getWorldWidthAndHeightFromTwoPoints_js__rspack_import_13 = __webpack_require__(13298);
|
|
26265
26386
|
/* import */ var _utilities_sampleAreaAnnotationVoxels_js__rspack_import_14 = __webpack_require__(72821);
|
|
26266
|
-
/* import */ var
|
|
26267
|
-
/* import */ var
|
|
26268
|
-
/* import */ var
|
|
26269
|
-
/* import */ var
|
|
26270
|
-
/* import */ var
|
|
26271
|
-
/* import */ var
|
|
26272
|
-
/* import */ var
|
|
26273
|
-
/* import */ var
|
|
26274
|
-
/* import */ var
|
|
26387
|
+
/* import */ var _utilities_areaAnnotationShapeUtils_js__rspack_import_15 = __webpack_require__(98512);
|
|
26388
|
+
/* import */ var _utilities_math_ellipse_index_js__rspack_import_16 = __webpack_require__(88688);
|
|
26389
|
+
/* import */ var _cursors_elementCursor_js__rspack_import_17 = __webpack_require__(30905);
|
|
26390
|
+
/* import */ var _utilities_triggerAnnotationRenderForViewportIds_js__rspack_import_18 = __webpack_require__(74128);
|
|
26391
|
+
/* import */ var _utilities_getPixelValueUnits_js__rspack_import_19 = __webpack_require__(56922);
|
|
26392
|
+
/* import */ var _utilities_viewportCapabilities_js__rspack_import_20 = __webpack_require__(82718);
|
|
26393
|
+
/* import */ var _utilities_viewport_isViewportPreScaled_js__rspack_import_21 = __webpack_require__(18414);
|
|
26394
|
+
/* import */ var _utilities_math_basic_index_js__rspack_import_22 = __webpack_require__(51342);
|
|
26395
|
+
/* import */ var gl_matrix__rspack_import_23 = __webpack_require__(50341);
|
|
26396
|
+
/* import */ var _stateManagement_annotation_config_helpers_js__rspack_import_24 = __webpack_require__(91336);
|
|
26275
26397
|
var _a;
|
|
26276
26398
|
|
|
26277
26399
|
|
|
@@ -26296,6 +26418,7 @@ var _a;
|
|
|
26296
26418
|
|
|
26297
26419
|
|
|
26298
26420
|
|
|
26421
|
+
|
|
26299
26422
|
|
|
26300
26423
|
|
|
26301
26424
|
const cs3dLogger = _cornerstonejs_core__rspack_import_1.utilities.logger.toolsLog.getLogger('tools.annotation.EllipticalROITool');
|
|
@@ -26311,7 +26434,7 @@ class EllipticalROITool extends _base_index_js__rspack_import_0/* .AnnotationToo
|
|
|
26311
26434
|
centerPointRadius: 0,
|
|
26312
26435
|
calculateStats: true,
|
|
26313
26436
|
getTextLines: defaultGetTextLines,
|
|
26314
|
-
statsCalculator:
|
|
26437
|
+
statsCalculator: _utilities_math_basic_index_js__rspack_import_22.BasicStatsCalculator,
|
|
26315
26438
|
},
|
|
26316
26439
|
}) {
|
|
26317
26440
|
super(toolProps, defaultToolProps);
|
|
@@ -26337,9 +26460,9 @@ class EllipticalROITool extends _base_index_js__rspack_import_0/* .AnnotationToo
|
|
|
26337
26460
|
hasMoved: false,
|
|
26338
26461
|
};
|
|
26339
26462
|
this._activateDraw(element);
|
|
26340
|
-
(0,
|
|
26463
|
+
(0,_cursors_elementCursor_js__rspack_import_17.hideElementCursor)(element);
|
|
26341
26464
|
evt.preventDefault();
|
|
26342
|
-
(0,
|
|
26465
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds_js__rspack_import_18/* ["default"] */.A)(viewportIdsToRender);
|
|
26343
26466
|
return annotation;
|
|
26344
26467
|
};
|
|
26345
26468
|
this.isPointNearTool = (element, annotation, canvasCoords, proximity) => {
|
|
@@ -26382,11 +26505,11 @@ class EllipticalROITool extends _base_index_js__rspack_import_0/* .AnnotationToo
|
|
|
26382
26505
|
viewportIdsToRender,
|
|
26383
26506
|
movingTextBox: false,
|
|
26384
26507
|
};
|
|
26385
|
-
(0,
|
|
26508
|
+
(0,_cursors_elementCursor_js__rspack_import_17.hideElementCursor)(element);
|
|
26386
26509
|
this._activateModify(element);
|
|
26387
26510
|
const enabledElement = (0,_cornerstonejs_core__rspack_import_1.getEnabledElement)(element);
|
|
26388
26511
|
const { renderingEngine } = enabledElement;
|
|
26389
|
-
(0,
|
|
26512
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds_js__rspack_import_18/* ["default"] */.A)(viewportIdsToRender);
|
|
26390
26513
|
evt.preventDefault();
|
|
26391
26514
|
};
|
|
26392
26515
|
this.handleSelectedCallback = (evt, annotation, handle) => {
|
|
@@ -26431,8 +26554,8 @@ class EllipticalROITool extends _base_index_js__rspack_import_0/* .AnnotationToo
|
|
|
26431
26554
|
movingTextBox,
|
|
26432
26555
|
};
|
|
26433
26556
|
this._activateModify(element);
|
|
26434
|
-
(0,
|
|
26435
|
-
(0,
|
|
26557
|
+
(0,_cursors_elementCursor_js__rspack_import_17.hideElementCursor)(element);
|
|
26558
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds_js__rspack_import_18/* ["default"] */.A)(viewportIdsToRender);
|
|
26436
26559
|
evt.preventDefault();
|
|
26437
26560
|
};
|
|
26438
26561
|
this._endCallback = (evt) => {
|
|
@@ -26448,14 +26571,14 @@ class EllipticalROITool extends _base_index_js__rspack_import_0/* .AnnotationToo
|
|
|
26448
26571
|
data.handles.activeHandleIndex = null;
|
|
26449
26572
|
this._deactivateModify(element);
|
|
26450
26573
|
this._deactivateDraw(element);
|
|
26451
|
-
(0,
|
|
26574
|
+
(0,_cursors_elementCursor_js__rspack_import_17.resetElementCursor)(element);
|
|
26452
26575
|
this.editData = null;
|
|
26453
26576
|
this.isDrawing = false;
|
|
26454
26577
|
if (this.isHandleOutsideImage &&
|
|
26455
26578
|
this.configuration.preventHandleOutsideImage) {
|
|
26456
26579
|
(0,_stateManagement_annotation_annotationState_js__rspack_import_4.removeAnnotation)(annotation.annotationUID);
|
|
26457
26580
|
}
|
|
26458
|
-
(0,
|
|
26581
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds_js__rspack_import_18/* ["default"] */.A)(viewportIdsToRender);
|
|
26459
26582
|
if (newAnnotation) {
|
|
26460
26583
|
(0,_stateManagement_annotation_helpers_state_js__rspack_import_7.triggerAnnotationCompleted)(annotation);
|
|
26461
26584
|
}
|
|
@@ -26487,7 +26610,7 @@ class EllipticalROITool extends _base_index_js__rspack_import_0/* .AnnotationToo
|
|
|
26487
26610
|
];
|
|
26488
26611
|
annotation.invalidated = true;
|
|
26489
26612
|
this.editData.hasMoved = true;
|
|
26490
|
-
(0,
|
|
26613
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds_js__rspack_import_18/* ["default"] */.A)(viewportIdsToRender);
|
|
26491
26614
|
(0,_stateManagement_annotation_helpers_state_js__rspack_import_7.triggerAnnotationModified)(annotation, element, _enums_index_js__rspack_import_10.ChangeTypes.HandlesUpdated);
|
|
26492
26615
|
};
|
|
26493
26616
|
this._dragModifyCallback = (evt) => {
|
|
@@ -26524,7 +26647,7 @@ class EllipticalROITool extends _base_index_js__rspack_import_0/* .AnnotationToo
|
|
|
26524
26647
|
}
|
|
26525
26648
|
const enabledElement = (0,_cornerstonejs_core__rspack_import_1.getEnabledElement)(element);
|
|
26526
26649
|
const { renderingEngine } = enabledElement;
|
|
26527
|
-
(0,
|
|
26650
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds_js__rspack_import_18/* ["default"] */.A)(viewportIdsToRender);
|
|
26528
26651
|
if (annotation.invalidated) {
|
|
26529
26652
|
(0,_stateManagement_annotation_helpers_state_js__rspack_import_7.triggerAnnotationModified)(annotation, element, _enums_index_js__rspack_import_10.ChangeTypes.HandlesUpdated);
|
|
26530
26653
|
}
|
|
@@ -26596,12 +26719,12 @@ class EllipticalROITool extends _base_index_js__rspack_import_0/* .AnnotationToo
|
|
|
26596
26719
|
this.isDrawing = false;
|
|
26597
26720
|
this._deactivateDraw(element);
|
|
26598
26721
|
this._deactivateModify(element);
|
|
26599
|
-
(0,
|
|
26722
|
+
(0,_cursors_elementCursor_js__rspack_import_17.resetElementCursor)(element);
|
|
26600
26723
|
const { annotation, viewportIdsToRender, newAnnotation } = this.editData;
|
|
26601
26724
|
const { data } = annotation;
|
|
26602
26725
|
annotation.highlighted = false;
|
|
26603
26726
|
data.handles.activeHandleIndex = null;
|
|
26604
|
-
(0,
|
|
26727
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds_js__rspack_import_18/* ["default"] */.A)(viewportIdsToRender);
|
|
26605
26728
|
if (newAnnotation) {
|
|
26606
26729
|
(0,_stateManagement_annotation_helpers_state_js__rspack_import_7.triggerAnnotationCompleted)(annotation);
|
|
26607
26730
|
}
|
|
@@ -26677,7 +26800,7 @@ class EllipticalROITool extends _base_index_js__rspack_import_0/* .AnnotationToo
|
|
|
26677
26800
|
styleSpecifier,
|
|
26678
26801
|
});
|
|
26679
26802
|
const canvasCoordinates = points.map((p) => viewport.worldToCanvas(p));
|
|
26680
|
-
const canvasCorners = ((0,
|
|
26803
|
+
const canvasCorners = ((0,_utilities_math_ellipse_index_js__rspack_import_16.getCanvasEllipseCorners)(canvasCoordinates));
|
|
26681
26804
|
const { centerPointRadius } = this.configuration;
|
|
26682
26805
|
if (!data.cachedStats[targetId] ||
|
|
26683
26806
|
data.cachedStats[targetId].areaUnit == null) {
|
|
@@ -26699,7 +26822,7 @@ class EllipticalROITool extends _base_index_js__rspack_import_0/* .AnnotationToo
|
|
|
26699
26822
|
if (targetId.startsWith('imageId')) {
|
|
26700
26823
|
const viewports = renderingEngine
|
|
26701
26824
|
.getViewports()
|
|
26702
|
-
.filter(
|
|
26825
|
+
.filter(_utilities_viewportCapabilities_js__rspack_import_20/* .viewportSupportsImageSlices */.hz);
|
|
26703
26826
|
const invalidatedStack = viewports.find((vp) => {
|
|
26704
26827
|
const referencedImageURI = _cornerstonejs_core__rspack_import_1.utilities.imageIdToURI(referencedImageId);
|
|
26705
26828
|
const hasImageURI = vp.hasImageURI(referencedImageURI);
|
|
@@ -26726,7 +26849,7 @@ class EllipticalROITool extends _base_index_js__rspack_import_0/* .AnnotationToo
|
|
|
26726
26849
|
activeHandleIndex !== null) {
|
|
26727
26850
|
activeHandleCanvasCoords = [canvasCoordinates[activeHandleIndex]];
|
|
26728
26851
|
}
|
|
26729
|
-
const showHandlesAlways = Boolean((0,
|
|
26852
|
+
const showHandlesAlways = Boolean((0,_stateManagement_annotation_config_helpers_js__rspack_import_24/* .getStyleProperty */.h)('showHandlesAlways', {}));
|
|
26730
26853
|
if (activeHandleCanvasCoords || showHandlesAlways) {
|
|
26731
26854
|
const handleGroupUID = '0';
|
|
26732
26855
|
(0,_drawingSvg_index_js__rspack_import_8.drawHandles)(svgDrawingHelper, annotationUID, handleGroupUID, showHandlesAlways ? canvasCoordinates : activeHandleCanvasCoords, {
|
|
@@ -26779,7 +26902,7 @@ class EllipticalROITool extends _base_index_js__rspack_import_0/* .AnnotationToo
|
|
|
26779
26902
|
const { points } = data.handles;
|
|
26780
26903
|
const canvasCoordinates = points.map((p) => viewport.worldToCanvas(p));
|
|
26781
26904
|
const { viewPlaneNormal, viewUp } = (0,_utilities_getViewportICamera_js__rspack_import_12/* ["default"] */.A)(viewport);
|
|
26782
|
-
const [topLeftCanvas, bottomRightCanvas] = ((0,
|
|
26905
|
+
const [topLeftCanvas, bottomRightCanvas] = ((0,_utilities_math_ellipse_index_js__rspack_import_16.getCanvasEllipseCorners)(canvasCoordinates));
|
|
26783
26906
|
const topLeftWorld = viewport.canvasToWorld(topLeftCanvas);
|
|
26784
26907
|
const bottomRightWorld = viewport.canvasToWorld(bottomRightCanvas);
|
|
26785
26908
|
const { cachedStats } = data;
|
|
@@ -26813,12 +26936,12 @@ class EllipticalROITool extends _base_index_js__rspack_import_0/* .AnnotationToo
|
|
|
26813
26936
|
const height = _a.calculateLengthInIndex(calibrate, indexHandles.slice(0, 2));
|
|
26814
26937
|
const area = Math.abs(Math.PI * (width / 2) * (height / aspect / 2));
|
|
26815
26938
|
const pixelUnitsOptions = {
|
|
26816
|
-
isPreScaled: (0,
|
|
26939
|
+
isPreScaled: (0,_utilities_viewport_isViewportPreScaled_js__rspack_import_21/* .isViewportPreScaled */.u)(viewport, targetId),
|
|
26817
26940
|
isSuvScaled: this.isSuvScaled(viewport, targetId, annotation.metadata.referencedImageId),
|
|
26818
26941
|
};
|
|
26819
|
-
const modalityUnit = (0,
|
|
26820
|
-
const majorRadius =
|
|
26821
|
-
const minorRadius =
|
|
26942
|
+
const modalityUnit = (0,_utilities_getPixelValueUnits_js__rspack_import_19/* .getPixelValueUnits */.j)(metadata.Modality, annotation.metadata.referencedImageId, pixelUnitsOptions);
|
|
26943
|
+
const majorRadius = gl_matrix__rspack_import_23/* .vec3.distance */.eR.Io(points[2], points[3]) / 2;
|
|
26944
|
+
const minorRadius = gl_matrix__rspack_import_23/* .vec3.distance */.eR.Io(points[0], points[1]) / 2;
|
|
26822
26945
|
const pointsInShape = (0,_utilities_sampleAreaAnnotationVoxels_js__rspack_import_14/* ["default"] */.A)({
|
|
26823
26946
|
annotation,
|
|
26824
26947
|
image,
|
|
@@ -26826,15 +26949,15 @@ class EllipticalROITool extends _base_index_js__rspack_import_0/* .AnnotationToo
|
|
|
26826
26949
|
points: points,
|
|
26827
26950
|
boundsMargin: Math.max(majorRadius, minorRadius),
|
|
26828
26951
|
createShape: ({ volume, planePoint, viewPlaneNormal: normal }) => {
|
|
26829
|
-
if (!(
|
|
26952
|
+
if (!(0,_utilities_areaAnnotationShapeUtils_js__rspack_import_15/* .hasValidAreaAnnotationDimensions */.k)(majorRadius, minorRadius)) {
|
|
26830
26953
|
return null;
|
|
26831
26954
|
}
|
|
26832
|
-
const majorAxis =
|
|
26955
|
+
const majorAxis = gl_matrix__rspack_import_23/* .vec3.sub */.eR.jb(gl_matrix__rspack_import_23/* .vec3.create */.eR.vt(), points[3], points[2]);
|
|
26833
26956
|
return createEllipseShape({
|
|
26834
26957
|
volume,
|
|
26835
26958
|
planePoint,
|
|
26836
26959
|
viewPlaneNormal: normal,
|
|
26837
|
-
centerWorld:
|
|
26960
|
+
centerWorld: gl_matrix__rspack_import_23/* .vec3.lerp */.eR.Cc(gl_matrix__rspack_import_23/* .vec3.create */.eR.vt(), points[2], points[3], 0.5),
|
|
26838
26961
|
majorAxis,
|
|
26839
26962
|
majorRadius,
|
|
26840
26963
|
minorRadius,
|
|
@@ -26881,7 +27004,7 @@ class EllipticalROITool extends _base_index_js__rspack_import_0/* .AnnotationToo
|
|
|
26881
27004
|
}
|
|
26882
27005
|
_pointInEllipseCanvas(ellipse, location) {
|
|
26883
27006
|
const { xRadius, yRadius, center, angle } = ellipse;
|
|
26884
|
-
const rotLocation =
|
|
27007
|
+
const rotLocation = gl_matrix__rspack_import_23/* .vec2.rotate */.Zc.e$(gl_matrix__rspack_import_23/* .vec2.create */.Zc.vt(), location, center, -angle);
|
|
26885
27008
|
if (xRadius <= 0.0 || yRadius <= 0.0) {
|
|
26886
27009
|
return false;
|
|
26887
27010
|
}
|
|
@@ -26934,7 +27057,7 @@ EllipticalROITool.hydrate = (viewportId, points, options) => {
|
|
|
26934
27057
|
},
|
|
26935
27058
|
};
|
|
26936
27059
|
(0,_stateManagement_annotation_annotationState_js__rspack_import_4.addAnnotation)(annotation, viewport.element);
|
|
26937
|
-
(0,
|
|
27060
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds_js__rspack_import_18/* ["default"] */.A)([viewport.id]);
|
|
26938
27061
|
};
|
|
26939
27062
|
function defaultGetTextLines(data, targetId) {
|
|
26940
27063
|
const cachedVolumeStats = data.cachedStats[targetId];
|
|
@@ -34913,19 +35036,19 @@ class CircleROIStartEndThresholdTool extends _annotation_CircleROITool_js__rspac
|
|
|
34913
35036
|
const worldPos = currentPoints.world;
|
|
34914
35037
|
const enabledElement = (0,_cornerstonejs_core__rspack_import_0.getEnabledElement)(element);
|
|
34915
35038
|
const { viewport } = enabledElement;
|
|
34916
|
-
this.isDrawing = true;
|
|
34917
35039
|
const camera = viewport.getCamera();
|
|
34918
35040
|
const { viewPlaneNormal, viewUp } = camera;
|
|
34919
|
-
let referencedImageId, imageVolume, volumeId;
|
|
34920
35041
|
if (viewport instanceof _cornerstonejs_core__rspack_import_0.StackViewport) {
|
|
34921
35042
|
throw new Error('Stack Viewport Not implemented');
|
|
34922
35043
|
}
|
|
34923
|
-
|
|
34924
|
-
|
|
34925
|
-
|
|
34926
|
-
imageVolume = _cornerstonejs_core__rspack_import_0.cache.getVolume(volumeId);
|
|
34927
|
-
referencedImageId = _cornerstonejs_core__rspack_import_0.utilities.getClosestImageId(imageVolume, worldPos, viewPlaneNormal);
|
|
35044
|
+
const target = this.getTargetVolume(viewport);
|
|
35045
|
+
if (!target) {
|
|
35046
|
+
return null;
|
|
34928
35047
|
}
|
|
35048
|
+
const volumeId = _cornerstonejs_core__rspack_import_0.utilities.getVolumeId(target.targetId);
|
|
35049
|
+
const imageVolume = target.imageVolume;
|
|
35050
|
+
const referencedImageId = _cornerstonejs_core__rspack_import_0.utilities.getClosestImageId(imageVolume, worldPos, viewPlaneNormal);
|
|
35051
|
+
this.isDrawing = true;
|
|
34929
35052
|
const spacingInNormal = _cornerstonejs_core__rspack_import_0.utilities.getSpacingInNormalDirection(imageVolume, viewPlaneNormal);
|
|
34930
35053
|
const startCoord = this._getStartCoordinate(worldPos, spacingInNormal, viewPlaneNormal);
|
|
34931
35054
|
const endCoord = this._getEndCoordinate(worldPos, spacingInNormal, viewPlaneNormal);
|
|
@@ -35017,9 +35140,10 @@ class CircleROIStartEndThresholdTool extends _annotation_CircleROITool_js__rspac
|
|
|
35017
35140
|
this.configuration.preventHandleOutsideImage) {
|
|
35018
35141
|
(0,_stateManagement_annotation_annotationState_js__rspack_import_2.removeAnnotation)(annotation.annotationUID);
|
|
35019
35142
|
}
|
|
35020
|
-
const
|
|
35021
|
-
|
|
35022
|
-
|
|
35143
|
+
const target = this.getTargetVolume(enabledElement.viewport);
|
|
35144
|
+
if (target) {
|
|
35145
|
+
this._computePointsInsideVolume(annotation, target.imageVolume, target.targetId, enabledElement);
|
|
35146
|
+
}
|
|
35023
35147
|
(0,_utilities_triggerAnnotationRenderForViewportIds_js__rspack_import_11/* ["default"] */.A)(viewportIdsToRender);
|
|
35024
35148
|
if (newAnnotation) {
|
|
35025
35149
|
(0,_stateManagement_annotation_helpers_state_js__rspack_import_12.triggerAnnotationCompleted)(annotation);
|
|
@@ -35090,12 +35214,10 @@ class CircleROIStartEndThresholdTool extends _annotation_CircleROITool_js__rspac
|
|
|
35090
35214
|
isMiddleSlice = true;
|
|
35091
35215
|
}
|
|
35092
35216
|
data.handles.points[0][this._getIndexOfCoordinatesForViewplaneNormal(viewplaneNormal)] = middleCoordinate;
|
|
35093
|
-
const
|
|
35094
|
-
|
|
35095
|
-
|
|
35096
|
-
|
|
35097
|
-
this._throttledCalculateCachedStats(annotation, annotationEnabledElement);
|
|
35098
|
-
}
|
|
35217
|
+
const annotationViewport = annotationEnabledElement?.viewport;
|
|
35218
|
+
if (annotation.invalidated &&
|
|
35219
|
+
annotationViewport?.hasVolumeId?.(metadata.volumeId)) {
|
|
35220
|
+
this._throttledCalculateCachedStats(annotation, annotationEnabledElement);
|
|
35099
35221
|
}
|
|
35100
35222
|
if (!viewport.getRenderingEngine()) {
|
|
35101
35223
|
cs3dLogger.warn('Rendering Engine has been destroyed');
|
|
@@ -35233,7 +35355,8 @@ class CircleROIStartEndThresholdTool extends _annotation_CircleROITool_js__rspac
|
|
|
35233
35355
|
const basePos1 = viewport.canvasToWorld(baseTopLeftCanvas);
|
|
35234
35356
|
const basePos2 = viewport.canvasToWorld(baseBottomRightCanvas);
|
|
35235
35357
|
const { worldWidth, worldHeight } = (0,_utilities_planar_getWorldWidthAndHeightFromTwoPoints_js__rspack_import_6/* ["default"] */.A)(viewPlaneNormal, viewUp, basePos1, basePos2);
|
|
35236
|
-
const
|
|
35358
|
+
const indexCoordinates = data.handles.points.map((point) => image.imageData.worldToIndex(point));
|
|
35359
|
+
const measureInfo = (0,_utilities_getCalibratedUnits_js__rspack_import_15/* .getCalibratedLengthUnitsAndScale */.Op)(image, indexCoordinates);
|
|
35237
35360
|
const aspect = (0,_utilities_getCalibratedUnits_js__rspack_import_15/* .getCalibratedAspect */.CQ)(image);
|
|
35238
35361
|
const area = Math.abs(Math.PI *
|
|
35239
35362
|
(worldWidth / measureInfo.scale / 2) *
|
|
@@ -35242,7 +35365,8 @@ class CircleROIStartEndThresholdTool extends _annotation_CircleROITool_js__rspac
|
|
|
35242
35365
|
isPreScaled: (0,_utilities_viewport_isViewportPreScaled_js__rspack_import_16/* .isViewportPreScaled */.u)(viewport, targetId),
|
|
35243
35366
|
isSuvScaled: this.isSuvScaled(viewport, targetId, annotation.metadata.referencedImageId),
|
|
35244
35367
|
};
|
|
35245
|
-
const
|
|
35368
|
+
const modality = imageVolume?.metadata?.Modality;
|
|
35369
|
+
const modalityUnit = (0,_utilities_getPixelValueUnits_js__rspack_import_20/* .getPixelValueUnits */.j)(modality, annotation.metadata.referencedImageId, modalityUnitOptions);
|
|
35246
35370
|
for (let i = 0; i < projectionPoints.length; i++) {
|
|
35247
35371
|
if (!imageVolume) {
|
|
35248
35372
|
continue;
|
|
@@ -35306,7 +35430,7 @@ class CircleROIStartEndThresholdTool extends _annotation_CircleROITool_js__rspac
|
|
|
35306
35430
|
const stats = this.configuration.statsCalculator.getStatistics();
|
|
35307
35431
|
data.cachedStats.pointsInVolume = pointsInsideVolume;
|
|
35308
35432
|
data.cachedStats.statistics = {
|
|
35309
|
-
Modality:
|
|
35433
|
+
Modality: modality,
|
|
35310
35434
|
area,
|
|
35311
35435
|
mean: stats.mean?.value,
|
|
35312
35436
|
stdDev: stats.stdDev?.value,
|
|
@@ -35320,8 +35444,12 @@ class CircleROIStartEndThresholdTool extends _annotation_CircleROITool_js__rspac
|
|
|
35320
35444
|
const data = annotation.data;
|
|
35321
35445
|
const { viewport } = enabledElement;
|
|
35322
35446
|
const { cachedStats } = data;
|
|
35323
|
-
const
|
|
35324
|
-
|
|
35447
|
+
const target = this.getTargetVolume(viewport);
|
|
35448
|
+
if (!target) {
|
|
35449
|
+
annotation.invalidated = false;
|
|
35450
|
+
return cachedStats;
|
|
35451
|
+
}
|
|
35452
|
+
const { targetId, imageVolume } = target;
|
|
35325
35453
|
this._computeProjectionPoints(annotation, imageVolume);
|
|
35326
35454
|
this._computePointsInsideVolume(annotation, imageVolume, targetId, enabledElement);
|
|
35327
35455
|
annotation.invalidated = false;
|
|
@@ -35386,7 +35514,7 @@ CircleROIStartEndThresholdTool.toolName = 'CircleROIStartEndThreshold';
|
|
|
35386
35514
|
/* import */ var _cursors_elementCursor_js__rspack_import_6 = __webpack_require__(30905);
|
|
35387
35515
|
/* import */ var _utilities_triggerAnnotationRenderForViewportIds_js__rspack_import_7 = __webpack_require__(74128);
|
|
35388
35516
|
/* import */ var _utilities_getViewportICamera_js__rspack_import_8 = __webpack_require__(40196);
|
|
35389
|
-
/* import */ var _stateManagement_segmentation_index_js__rspack_import_9 = __webpack_require__(
|
|
35517
|
+
/* import */ var _stateManagement_segmentation_index_js__rspack_import_9 = __webpack_require__(86274);
|
|
35390
35518
|
/* import */ var _stateManagement_segmentation_segmentationState_js__rspack_import_10 = __webpack_require__(61342);
|
|
35391
35519
|
/* import */ var _stateManagement_segmentation_helpers_getViewportLabelmapRenderMode_js__rspack_import_11 = __webpack_require__(15422);
|
|
35392
35520
|
/* import */ var _LabelmapBaseTool_js__rspack_import_12 = __webpack_require__(82607);
|
|
@@ -35625,8 +35753,13 @@ CircleScissorsTool.toolName = 'CircleScissor';
|
|
|
35625
35753
|
/* import */ var _cornerstonejs_core__rspack_import_1 = __webpack_require__(62721);
|
|
35626
35754
|
/* import */ var _annotation_PlanarFreehandContourSegmentationTool_js__rspack_import_2 = __webpack_require__(31382);
|
|
35627
35755
|
/* import */ var _BrushTool_js__rspack_import_3 = __webpack_require__(48480);
|
|
35628
|
-
/* import */ var _stateManagement_segmentation_index_js__rspack_import_4 = __webpack_require__(
|
|
35756
|
+
/* import */ var _stateManagement_segmentation_index_js__rspack_import_4 = __webpack_require__(86274);
|
|
35629
35757
|
/* import */ var _stateManagement_segmentation_getSegmentationRepresentation_js__rspack_import_5 = __webpack_require__(47290);
|
|
35758
|
+
/* import */ var _stateManagement_segmentation_getActiveSegmentIndex_js__rspack_import_6 = __webpack_require__(72676);
|
|
35759
|
+
/* import */ var _stateManagement_segmentation_segmentLocking_js__rspack_import_7 = __webpack_require__(65419);
|
|
35760
|
+
/* import */ var _stateManagement_segmentation_config_segmentationVisibility_js__rspack_import_8 = __webpack_require__(64540);
|
|
35761
|
+
|
|
35762
|
+
|
|
35630
35763
|
|
|
35631
35764
|
|
|
35632
35765
|
|
|
@@ -35636,6 +35769,13 @@ CircleScissorsTool.toolName = 'CircleScissor';
|
|
|
35636
35769
|
|
|
35637
35770
|
const cs3dLogger = _cornerstonejs_core__rspack_import_1.utilities.logger.toolsLog.getLogger('tools.segmentation.LabelmapEditWithContour');
|
|
35638
35771
|
class LabelMapEditWithContourTool extends _annotation_PlanarFreehandContourSegmentationTool_js__rspack_import_2/* ["default"] */.A {
|
|
35772
|
+
static clearTemporaryContourRecords() {
|
|
35773
|
+
LabelMapEditWithContourTool.temporaryContourData.clear();
|
|
35774
|
+
LabelMapEditWithContourTool.temporaryContourViewports.clear();
|
|
35775
|
+
}
|
|
35776
|
+
static getViewportContourKey(viewportId, segmentationId) {
|
|
35777
|
+
return `${viewportId}\u0000${segmentationId}`;
|
|
35778
|
+
}
|
|
35639
35779
|
constructor(toolProps = {}) {
|
|
35640
35780
|
const initialProps = _cornerstonejs_core__rspack_import_1.utilities.deepMerge({
|
|
35641
35781
|
configuration: {
|
|
@@ -35644,74 +35784,81 @@ class LabelMapEditWithContourTool extends _annotation_PlanarFreehandContourSegme
|
|
|
35644
35784
|
},
|
|
35645
35785
|
}, toolProps);
|
|
35646
35786
|
super(initialProps);
|
|
35647
|
-
this.
|
|
35648
|
-
|
|
35649
|
-
|
|
35787
|
+
this.initializeAddNewAnnotationHandler();
|
|
35788
|
+
}
|
|
35789
|
+
initializeAddNewAnnotationHandler() {
|
|
35790
|
+
const originalAddNewAnnotation = this.addNewAnnotation.bind(this);
|
|
35791
|
+
this.addNewAnnotation = (evt) => {
|
|
35792
|
+
const { element } = evt.detail;
|
|
35793
|
+
const enabledElement = (0,_cornerstonejs_core__rspack_import_1.getEnabledElement)(element);
|
|
35794
|
+
if (enabledElement) {
|
|
35795
|
+
const viewportId = enabledElement.viewport.id;
|
|
35796
|
+
const activeSeg = _stateManagement_segmentation_index_js__rspack_import_4.getActiveSegmentation(viewportId);
|
|
35797
|
+
if (!activeSeg) {
|
|
35798
|
+
return null;
|
|
35799
|
+
}
|
|
35800
|
+
const activeSegIndex = (0,_stateManagement_segmentation_getActiveSegmentIndex_js__rspack_import_6/* .getActiveSegmentIndex */.Q)(activeSeg.segmentationId);
|
|
35801
|
+
if (activeSegIndex === undefined) {
|
|
35802
|
+
return null;
|
|
35803
|
+
}
|
|
35804
|
+
const isSegmentLocked = (0,_stateManagement_segmentation_segmentLocking_js__rspack_import_7.isSegmentIndexLocked)(activeSeg.segmentationId, activeSegIndex);
|
|
35805
|
+
const isSegmentHidden = !(0,_stateManagement_segmentation_config_segmentationVisibility_js__rspack_import_8.getSegmentIndexVisibility)(viewportId, {
|
|
35806
|
+
segmentationId: activeSeg.segmentationId,
|
|
35807
|
+
type: _enums_index_js__rspack_import_0.SegmentationRepresentations.Labelmap,
|
|
35808
|
+
}, activeSegIndex);
|
|
35809
|
+
if (isSegmentLocked || isSegmentHidden) {
|
|
35810
|
+
return null;
|
|
35811
|
+
}
|
|
35812
|
+
LabelMapEditWithContourTool.clearTemporaryContourRecords();
|
|
35813
|
+
this.checkContourSegmentation(viewportId, activeSeg).catch((error) => {
|
|
35814
|
+
cs3dLogger.warn('Failed to add the temporary contour representation:', error);
|
|
35815
|
+
});
|
|
35816
|
+
}
|
|
35817
|
+
return originalAddNewAnnotation(evt);
|
|
35818
|
+
};
|
|
35650
35819
|
}
|
|
35651
35820
|
initializeListeners() {
|
|
35652
35821
|
LabelMapEditWithContourTool.annotationsToViewportMap.clear();
|
|
35653
|
-
LabelMapEditWithContourTool.viewportIdsChecked = [];
|
|
35654
35822
|
_cornerstonejs_core__rspack_import_1.eventTarget.addEventListener(_enums_index_js__rspack_import_0.Events.ANNOTATION_MODIFIED, this.annotationModified);
|
|
35655
35823
|
_cornerstonejs_core__rspack_import_1.eventTarget.addEventListener(_enums_index_js__rspack_import_0.Events.ANNOTATION_COMPLETED, this.annotationCompleted);
|
|
35656
|
-
_cornerstonejs_core__rspack_import_1.eventTarget.addEventListener(_enums_index_js__rspack_import_0.Events.TOOLGROUP_VIEWPORT_ADDED, this.onViewportAddedToToolGroupBinded);
|
|
35657
|
-
_cornerstonejs_core__rspack_import_1.eventTarget.addEventListener(_enums_index_js__rspack_import_0.Events.SEGMENTATION_MODIFIED, this.onSegmentationModifiedBinded);
|
|
35658
|
-
_cornerstonejs_core__rspack_import_1.eventTarget.addEventListener(_enums_index_js__rspack_import_0.Events.SEGMENTATION_REPRESENTATION_MODIFIED, this.onSegmentationModifiedBinded);
|
|
35659
35824
|
}
|
|
35660
35825
|
cleanUpListeners() {
|
|
35661
35826
|
LabelMapEditWithContourTool.annotationsToViewportMap.clear();
|
|
35662
|
-
LabelMapEditWithContourTool.
|
|
35827
|
+
LabelMapEditWithContourTool.clearTemporaryContourRecords();
|
|
35663
35828
|
_cornerstonejs_core__rspack_import_1.eventTarget.removeEventListener(_enums_index_js__rspack_import_0.Events.ANNOTATION_MODIFIED, this.annotationModified);
|
|
35664
35829
|
_cornerstonejs_core__rspack_import_1.eventTarget.removeEventListener(_enums_index_js__rspack_import_0.Events.ANNOTATION_COMPLETED, this.annotationCompleted);
|
|
35665
|
-
_cornerstonejs_core__rspack_import_1.eventTarget.removeEventListener(_enums_index_js__rspack_import_0.Events.TOOLGROUP_VIEWPORT_ADDED, this.onViewportAddedToToolGroup.bind(this));
|
|
35666
|
-
_cornerstonejs_core__rspack_import_1.eventTarget.removeEventListener(_enums_index_js__rspack_import_0.Events.SEGMENTATION_MODIFIED, this.onSegmentationModified.bind(this));
|
|
35667
|
-
_cornerstonejs_core__rspack_import_1.eventTarget.removeEventListener(_enums_index_js__rspack_import_0.Events.SEGMENTATION_REPRESENTATION_MODIFIED, this.onSegmentationModified.bind(this));
|
|
35668
35830
|
}
|
|
35669
|
-
async checkContourSegmentation(viewportId) {
|
|
35670
|
-
if (LabelMapEditWithContourTool.viewportIdsChecked.includes(viewportId)) {
|
|
35671
|
-
return;
|
|
35672
|
-
}
|
|
35673
|
-
const activeSeg = _stateManagement_segmentation_index_js__rspack_import_4.getActiveSegmentation(viewportId);
|
|
35831
|
+
async checkContourSegmentation(viewportId, activeSeg) {
|
|
35674
35832
|
if (!activeSeg) {
|
|
35675
35833
|
cs3dLogger.info('No active segmentation detected');
|
|
35676
35834
|
return false;
|
|
35677
35835
|
}
|
|
35678
35836
|
const segmentationId = activeSeg.segmentationId;
|
|
35679
35837
|
if (!activeSeg.representationData.Contour) {
|
|
35680
|
-
LabelMapEditWithContourTool.viewportIdsChecked.push(viewportId);
|
|
35681
|
-
await _stateManagement_segmentation_index_js__rspack_import_4.addContourRepresentationToViewport(viewportId, [
|
|
35682
|
-
{
|
|
35683
|
-
segmentationId,
|
|
35684
|
-
type: _enums_index_js__rspack_import_0.SegmentationRepresentations.Contour,
|
|
35685
|
-
},
|
|
35686
|
-
]);
|
|
35687
35838
|
_stateManagement_segmentation_index_js__rspack_import_4.addRepresentationData({
|
|
35688
35839
|
segmentationId,
|
|
35689
35840
|
type: _enums_index_js__rspack_import_0.SegmentationRepresentations.Contour,
|
|
35690
35841
|
data: {},
|
|
35691
35842
|
});
|
|
35843
|
+
LabelMapEditWithContourTool.temporaryContourData.add(segmentationId);
|
|
35692
35844
|
}
|
|
35693
|
-
|
|
35694
|
-
|
|
35845
|
+
const hasViewportContour = (0,_stateManagement_segmentation_getSegmentationRepresentation_js__rspack_import_5/* .getSegmentationRepresentation */.Ut)(viewportId, {
|
|
35846
|
+
segmentationId,
|
|
35847
|
+
type: _enums_index_js__rspack_import_0.SegmentationRepresentations.Contour,
|
|
35848
|
+
});
|
|
35849
|
+
if (!hasViewportContour) {
|
|
35850
|
+
await _stateManagement_segmentation_index_js__rspack_import_4.addContourRepresentationToViewport(viewportId, [
|
|
35851
|
+
{
|
|
35852
|
+
segmentationId,
|
|
35853
|
+
type: _enums_index_js__rspack_import_0.SegmentationRepresentations.Contour,
|
|
35854
|
+
},
|
|
35855
|
+
]);
|
|
35856
|
+
LabelMapEditWithContourTool.temporaryContourViewports.add(LabelMapEditWithContourTool.getViewportContourKey(viewportId, segmentationId));
|
|
35695
35857
|
}
|
|
35696
35858
|
return true;
|
|
35697
35859
|
}
|
|
35698
|
-
|
|
35699
|
-
|
|
35700
|
-
if (toolGroupId !== this.toolGroupId) {
|
|
35701
|
-
return;
|
|
35702
|
-
}
|
|
35703
|
-
this.checkContourSegmentation(viewportId);
|
|
35704
|
-
}
|
|
35705
|
-
onSegmentationModified(evt) {
|
|
35706
|
-
const { segmentationId } = evt.detail || {};
|
|
35707
|
-
if (!segmentationId) {
|
|
35708
|
-
return;
|
|
35709
|
-
}
|
|
35710
|
-
const representations = (0,_stateManagement_segmentation_getSegmentationRepresentation_js__rspack_import_5/* .getSegmentationRepresentationsBySegmentationId */.ny)(segmentationId);
|
|
35711
|
-
if (!representations) {
|
|
35712
|
-
return;
|
|
35713
|
-
}
|
|
35714
|
-
representations.forEach(async ({ viewportId }) => await this.checkContourSegmentation(viewportId));
|
|
35860
|
+
createMemo(element, annotation, options) {
|
|
35861
|
+
return;
|
|
35715
35862
|
}
|
|
35716
35863
|
onSetToolEnabled() {
|
|
35717
35864
|
this.initializeListeners();
|
|
@@ -35724,32 +35871,99 @@ class LabelMapEditWithContourTool extends _annotation_PlanarFreehandContourSegme
|
|
|
35724
35871
|
}
|
|
35725
35872
|
annotationModified(evt) {
|
|
35726
35873
|
const { annotation, renderingEngineId, viewportId } = evt.detail;
|
|
35874
|
+
if (annotation?.metadata?.toolName !== LabelMapEditWithContourTool.toolName) {
|
|
35875
|
+
return;
|
|
35876
|
+
}
|
|
35727
35877
|
const viewport = (0,_cornerstonejs_core__rspack_import_1.getRenderingEngine)(renderingEngineId)?.getViewport(viewportId);
|
|
35728
35878
|
if (!viewport) {
|
|
35729
35879
|
return;
|
|
35730
35880
|
}
|
|
35731
35881
|
LabelMapEditWithContourTool.annotationsToViewportMap.set(annotation.annotationUID, viewport);
|
|
35732
35882
|
}
|
|
35883
|
+
static hasContourContent(contourData) {
|
|
35884
|
+
if (contourData.geometryIds?.length) {
|
|
35885
|
+
return true;
|
|
35886
|
+
}
|
|
35887
|
+
const { annotationUIDsMap } = contourData;
|
|
35888
|
+
if (!annotationUIDsMap) {
|
|
35889
|
+
return false;
|
|
35890
|
+
}
|
|
35891
|
+
for (const annotationUIDs of annotationUIDsMap.values()) {
|
|
35892
|
+
if (annotationUIDs.size) {
|
|
35893
|
+
return true;
|
|
35894
|
+
}
|
|
35895
|
+
}
|
|
35896
|
+
return false;
|
|
35897
|
+
}
|
|
35898
|
+
static cleanupTemporaryContourRepresentation(viewport, annotation) {
|
|
35899
|
+
const segmentationId = annotation?.data?.segmentation?.segmentationId;
|
|
35900
|
+
if (!segmentationId) {
|
|
35901
|
+
return;
|
|
35902
|
+
}
|
|
35903
|
+
const viewportKey = LabelMapEditWithContourTool.getViewportContourKey(viewport.id, segmentationId);
|
|
35904
|
+
const ownsViewportContour = LabelMapEditWithContourTool.temporaryContourViewports.has(viewportKey);
|
|
35905
|
+
const ownsContourData = LabelMapEditWithContourTool.temporaryContourData.has(segmentationId);
|
|
35906
|
+
if (!ownsViewportContour && !ownsContourData) {
|
|
35907
|
+
return;
|
|
35908
|
+
}
|
|
35909
|
+
const segmentationState = _stateManagement_segmentation_index_js__rspack_import_4.state.getSegmentation(segmentationId);
|
|
35910
|
+
const contourData = segmentationState?.representationData?.Contour;
|
|
35911
|
+
if (contourData &&
|
|
35912
|
+
LabelMapEditWithContourTool.hasContourContent(contourData)) {
|
|
35913
|
+
return;
|
|
35914
|
+
}
|
|
35915
|
+
if (ownsViewportContour) {
|
|
35916
|
+
LabelMapEditWithContourTool.temporaryContourViewports.delete(viewportKey);
|
|
35917
|
+
_stateManagement_segmentation_index_js__rspack_import_4.removeContourRepresentation(viewport.id, segmentationId);
|
|
35918
|
+
}
|
|
35919
|
+
if (!ownsContourData || !segmentationState) {
|
|
35920
|
+
return;
|
|
35921
|
+
}
|
|
35922
|
+
LabelMapEditWithContourTool.temporaryContourData.delete(segmentationId);
|
|
35923
|
+
const representationData = _cornerstonejs_core__rspack_import_1.utilities.deepClone(segmentationState.representationData);
|
|
35924
|
+
delete representationData.Contour;
|
|
35925
|
+
_stateManagement_segmentation_index_js__rspack_import_4.updateSegmentations([
|
|
35926
|
+
{
|
|
35927
|
+
segmentationId,
|
|
35928
|
+
payload: {
|
|
35929
|
+
representationData,
|
|
35930
|
+
},
|
|
35931
|
+
},
|
|
35932
|
+
], true);
|
|
35933
|
+
}
|
|
35733
35934
|
annotationCompleted(evt) {
|
|
35734
35935
|
const { annotation } = evt.detail;
|
|
35735
|
-
const { polyline } = annotation.data?.contour || {};
|
|
35736
35936
|
if (annotation?.metadata?.toolName !== LabelMapEditWithContourTool.toolName) {
|
|
35737
35937
|
return;
|
|
35738
35938
|
}
|
|
35739
|
-
|
|
35939
|
+
const annotationUID = annotation.annotationUID;
|
|
35940
|
+
const viewport = LabelMapEditWithContourTool.annotationsToViewportMap.get(annotationUID);
|
|
35941
|
+
if (!viewport) {
|
|
35740
35942
|
return;
|
|
35741
35943
|
}
|
|
35742
|
-
|
|
35743
|
-
|
|
35744
|
-
|
|
35745
|
-
|
|
35746
|
-
|
|
35944
|
+
const polyline = annotation.data?.contour?.polyline;
|
|
35945
|
+
const segmentationData = annotation.data
|
|
35946
|
+
?.segmentation;
|
|
35947
|
+
if (polyline?.length >= 3 && segmentationData) {
|
|
35948
|
+
_BrushTool_js__rspack_import_3/* ["default"].viewportContoursToLabelmap */.A.viewportContoursToLabelmap(viewport, {
|
|
35949
|
+
strokeStartPoint: polyline[0],
|
|
35950
|
+
annotationFilter: (annotations) => annotations.filter((candidate) => {
|
|
35951
|
+
const candidateSegmentation = candidate.data?.segmentation;
|
|
35952
|
+
return (candidateSegmentation?.segmentationId ===
|
|
35953
|
+
segmentationData.segmentationId &&
|
|
35954
|
+
candidateSegmentation?.segmentIndex ===
|
|
35955
|
+
segmentationData.segmentIndex);
|
|
35956
|
+
}),
|
|
35957
|
+
});
|
|
35747
35958
|
}
|
|
35959
|
+
LabelMapEditWithContourTool.cleanupTemporaryContourRepresentation(viewport, annotation);
|
|
35960
|
+
LabelMapEditWithContourTool.annotationsToViewportMap.delete(annotationUID);
|
|
35748
35961
|
}
|
|
35749
35962
|
}
|
|
35750
35963
|
LabelMapEditWithContourTool.toolName = 'LabelMapEditWithContour';
|
|
35751
35964
|
LabelMapEditWithContourTool.annotationsToViewportMap = new Map();
|
|
35752
|
-
LabelMapEditWithContourTool.
|
|
35965
|
+
LabelMapEditWithContourTool.temporaryContourData = new Set();
|
|
35966
|
+
LabelMapEditWithContourTool.temporaryContourViewports = new Set();
|
|
35753
35967
|
/* export default */ __webpack_exports__.A = (LabelMapEditWithContourTool);
|
|
35754
35968
|
|
|
35755
35969
|
|
|
@@ -35759,7 +35973,7 @@ LabelMapEditWithContourTool.viewportIdsChecked = [];
|
|
|
35759
35973
|
/* import */ var _base_index_js__rspack_import_1 = __webpack_require__(59865);
|
|
35760
35974
|
/* import */ var _enums_index_js__rspack_import_2 = __webpack_require__(36776);
|
|
35761
35975
|
/* import */ var _stateManagement_segmentation_triggerSegmentationEvents_js__rspack_import_3 = __webpack_require__(11815);
|
|
35762
|
-
/* import */ var _stateManagement_segmentation_index_js__rspack_import_4 = __webpack_require__(
|
|
35976
|
+
/* import */ var _stateManagement_segmentation_index_js__rspack_import_4 = __webpack_require__(86274);
|
|
35763
35977
|
/* import */ var _utilities_segmentation_floodFill_js__rspack_import_5 = __webpack_require__(78226);
|
|
35764
35978
|
/* import */ var _stateManagement_segmentation_segmentationState_js__rspack_import_6 = __webpack_require__(61342);
|
|
35765
35979
|
/* import */ var _stateManagement_segmentation_helpers_getViewportLabelmapRenderMode_js__rspack_import_7 = __webpack_require__(15422);
|
|
@@ -36069,19 +36283,19 @@ class RectangleROIStartEndThresholdTool extends _annotation_RectangleROITool_js_
|
|
|
36069
36283
|
const worldPos = currentPoints.world;
|
|
36070
36284
|
const enabledElement = (0,_cornerstonejs_core__rspack_import_0.getEnabledElement)(element);
|
|
36071
36285
|
const { viewport, renderingEngine } = enabledElement;
|
|
36072
|
-
this.isDrawing = true;
|
|
36073
36286
|
const camera = viewport.getCamera();
|
|
36074
36287
|
const { viewPlaneNormal, viewUp } = camera;
|
|
36075
|
-
let referencedImageId, imageVolume, volumeId;
|
|
36076
36288
|
if (viewport instanceof _cornerstonejs_core__rspack_import_0.StackViewport) {
|
|
36077
36289
|
throw new Error('Stack Viewport Not implemented');
|
|
36078
36290
|
}
|
|
36079
|
-
|
|
36080
|
-
|
|
36081
|
-
|
|
36082
|
-
imageVolume = _cornerstonejs_core__rspack_import_0.cache.getVolume(volumeId);
|
|
36083
|
-
referencedImageId = _cornerstonejs_core__rspack_import_0.utilities.getClosestImageId(imageVolume, worldPos, viewPlaneNormal);
|
|
36291
|
+
const target = this.getTargetVolume(viewport);
|
|
36292
|
+
if (!target) {
|
|
36293
|
+
return null;
|
|
36084
36294
|
}
|
|
36295
|
+
const volumeId = _cornerstonejs_core__rspack_import_0.utilities.getVolumeId(target.targetId);
|
|
36296
|
+
const imageVolume = target.imageVolume;
|
|
36297
|
+
const referencedImageId = _cornerstonejs_core__rspack_import_0.utilities.getClosestImageId(imageVolume, worldPos, viewPlaneNormal);
|
|
36298
|
+
this.isDrawing = true;
|
|
36085
36299
|
const spacingInNormal = _cornerstonejs_core__rspack_import_0.utilities.getSpacingInNormalDirection(imageVolume, viewPlaneNormal);
|
|
36086
36300
|
const startCoord = this._getStartCoordinate(worldPos, viewPlaneNormal);
|
|
36087
36301
|
const endCoord = this._getEndCoordinate(worldPos, spacingInNormal, viewPlaneNormal);
|
|
@@ -36166,10 +36380,11 @@ class RectangleROIStartEndThresholdTool extends _annotation_RectangleROITool_js_
|
|
|
36166
36380
|
this.configuration.preventHandleOutsideImage) {
|
|
36167
36381
|
(0,_stateManagement_index_js__rspack_import_3/* .removeAnnotation */.O8)(annotation.annotationUID);
|
|
36168
36382
|
}
|
|
36169
|
-
const
|
|
36170
|
-
|
|
36171
|
-
|
|
36172
|
-
|
|
36383
|
+
const target = this.getTargetVolume(enabledElement.viewport);
|
|
36384
|
+
if (target) {
|
|
36385
|
+
this._computeProjectionPoints(annotation, target.imageVolume);
|
|
36386
|
+
this._computePointsInsideVolume(annotation, target.targetId, target.imageVolume, enabledElement);
|
|
36387
|
+
}
|
|
36173
36388
|
(0,_utilities_triggerAnnotationRenderForViewportIds_js__rspack_import_12/* ["default"] */.A)(viewportIdsToRender);
|
|
36174
36389
|
if (newAnnotation) {
|
|
36175
36390
|
(0,_stateManagement_annotation_helpers_state_js__rspack_import_13.triggerAnnotationCompleted)(annotation);
|
|
@@ -36224,12 +36439,10 @@ class RectangleROIStartEndThresholdTool extends _annotation_RectangleROITool_js_
|
|
|
36224
36439
|
roundedCoord > Math.max(roundedStartCoord, roundedEndCoord)) {
|
|
36225
36440
|
continue;
|
|
36226
36441
|
}
|
|
36227
|
-
const
|
|
36228
|
-
|
|
36229
|
-
|
|
36230
|
-
|
|
36231
|
-
this._throttledCalculateCachedStats(annotation, annotationEnabledElement);
|
|
36232
|
-
}
|
|
36442
|
+
const annotationViewport = annotationEnabledElement?.viewport;
|
|
36443
|
+
if (annotation.invalidated &&
|
|
36444
|
+
annotationViewport?.hasVolumeId?.(metadata.volumeId)) {
|
|
36445
|
+
this._throttledCalculateCachedStats(annotation, annotationEnabledElement);
|
|
36233
36446
|
}
|
|
36234
36447
|
let firstOrLastSlice = false;
|
|
36235
36448
|
if (roundedCoord === roundedStartCoord ||
|
|
@@ -36352,14 +36565,16 @@ class RectangleROIStartEndThresholdTool extends _annotation_RectangleROITool_js_
|
|
|
36352
36565
|
const worldPos1 = data.handles.points[0];
|
|
36353
36566
|
const worldPos2 = data.handles.points[3];
|
|
36354
36567
|
const { worldWidth, worldHeight } = (0,_utilities_planar_getWorldWidthAndHeightFromCorners_js__rspack_import_9/* ["default"] */.A)(viewPlaneNormal, viewUp, worldPos1, worldPos2);
|
|
36355
|
-
const
|
|
36568
|
+
const indexCoordinates = data.handles.points.map((point) => image.imageData.worldToIndex(point));
|
|
36569
|
+
const measureInfo = (0,_utilities_getCalibratedUnits_js__rspack_import_1/* .getCalibratedLengthUnitsAndScale */.Op)(image, indexCoordinates);
|
|
36356
36570
|
const area = Math.abs(worldWidth * worldHeight) /
|
|
36357
36571
|
(measureInfo.scale * measureInfo.scale);
|
|
36358
36572
|
const modalityUnitOptions = {
|
|
36359
36573
|
isPreScaled: (0,_utilities_viewport_isViewportPreScaled_js__rspack_import_15/* .isViewportPreScaled */.u)(viewport, targetId),
|
|
36360
36574
|
isSuvScaled: this.isSuvScaled(viewport, targetId, annotation.metadata.referencedImageId),
|
|
36361
36575
|
};
|
|
36362
|
-
const
|
|
36576
|
+
const modality = imageVolume?.metadata?.Modality;
|
|
36577
|
+
const modalityUnit = (0,_utilities_getPixelValueUnits_js__rspack_import_18/* .getPixelValueUnits */.j)(modality, annotation.metadata.referencedImageId, modalityUnitOptions);
|
|
36363
36578
|
for (let i = 0; i < projectionPoints.length; i++) {
|
|
36364
36579
|
if (!imageVolume) {
|
|
36365
36580
|
continue;
|
|
@@ -36404,7 +36619,7 @@ class RectangleROIStartEndThresholdTool extends _annotation_RectangleROITool_js_
|
|
|
36404
36619
|
const stats = this.configuration.statsCalculator.getStatistics();
|
|
36405
36620
|
data.cachedStats.pointsInVolume = pointsInsideVolume;
|
|
36406
36621
|
data.cachedStats.statistics = {
|
|
36407
|
-
Modality:
|
|
36622
|
+
Modality: modality,
|
|
36408
36623
|
area,
|
|
36409
36624
|
mean: stats.mean?.value,
|
|
36410
36625
|
stdDev: stats.stdDev?.value,
|
|
@@ -36418,8 +36633,12 @@ class RectangleROIStartEndThresholdTool extends _annotation_RectangleROITool_js_
|
|
|
36418
36633
|
const data = annotation.data;
|
|
36419
36634
|
const { viewport } = enabledElement;
|
|
36420
36635
|
const { cachedStats } = data;
|
|
36421
|
-
const
|
|
36422
|
-
|
|
36636
|
+
const target = this.getTargetVolume(viewport);
|
|
36637
|
+
if (!target) {
|
|
36638
|
+
annotation.invalidated = false;
|
|
36639
|
+
return cachedStats;
|
|
36640
|
+
}
|
|
36641
|
+
const { targetId, imageVolume } = target;
|
|
36423
36642
|
this._computeProjectionPoints(annotation, imageVolume);
|
|
36424
36643
|
this._computePointsInsideVolume(annotation, targetId, imageVolume, enabledElement);
|
|
36425
36644
|
annotation.invalidated = false;
|
|
@@ -36642,7 +36861,7 @@ RectangleROIThresholdTool.toolName = 'RectangleROIThreshold';
|
|
|
36642
36861
|
/* import */ var _cursors_elementCursor_js__rspack_import_7 = __webpack_require__(30905);
|
|
36643
36862
|
/* import */ var _utilities_triggerAnnotationRenderForViewportIds_js__rspack_import_8 = __webpack_require__(74128);
|
|
36644
36863
|
/* import */ var _utilities_getViewportICamera_js__rspack_import_9 = __webpack_require__(40196);
|
|
36645
|
-
/* import */ var _stateManagement_segmentation_index_js__rspack_import_10 = __webpack_require__(
|
|
36864
|
+
/* import */ var _stateManagement_segmentation_index_js__rspack_import_10 = __webpack_require__(86274);
|
|
36646
36865
|
/* import */ var _stateManagement_segmentation_segmentationState_js__rspack_import_11 = __webpack_require__(61342);
|
|
36647
36866
|
/* import */ var _stateManagement_segmentation_helpers_getViewportLabelmapRenderMode_js__rspack_import_12 = __webpack_require__(15422);
|
|
36648
36867
|
/* import */ var _LabelmapBaseTool_js__rspack_import_13 = __webpack_require__(82607);
|
|
@@ -36826,6 +37045,7 @@ class RectangleScissorsTool extends _LabelmapBaseTool_js__rspack_import_13/* ["d
|
|
|
36826
37045
|
const { element } = eventDetail;
|
|
36827
37046
|
const { annotation, newAnnotation, hasMoved } = this.editData;
|
|
36828
37047
|
const { data } = annotation;
|
|
37048
|
+
const { viewPlaneNormal, viewUp } = annotation.metadata;
|
|
36829
37049
|
if (newAnnotation && !hasMoved) {
|
|
36830
37050
|
return;
|
|
36831
37051
|
}
|
|
@@ -36836,6 +37056,8 @@ class RectangleScissorsTool extends _LabelmapBaseTool_js__rspack_import_13/* ["d
|
|
|
36836
37056
|
const operationData = {
|
|
36837
37057
|
...this.editData,
|
|
36838
37058
|
points: data.handles.points,
|
|
37059
|
+
viewPlaneNormal,
|
|
37060
|
+
viewUp,
|
|
36839
37061
|
createMemo: this.createMemo.bind(this),
|
|
36840
37062
|
};
|
|
36841
37063
|
this.editData = null;
|
|
@@ -37154,7 +37376,7 @@ SegmentBidirectionalTool.hydrate = (viewportId, axis, options) => {
|
|
|
37154
37376
|
},
|
|
37155
37377
|
10619(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
37156
37378
|
/* import */ var _cornerstonejs_core__rspack_import_0 = __webpack_require__(62721);
|
|
37157
|
-
/* import */ var _stateManagement_segmentation_index_js__rspack_import_1 = __webpack_require__(
|
|
37379
|
+
/* import */ var _stateManagement_segmentation_index_js__rspack_import_1 = __webpack_require__(86274);
|
|
37158
37380
|
/* import */ var _base_index_js__rspack_import_2 = __webpack_require__(59865);
|
|
37159
37381
|
/* import */ var _stateManagement_segmentation_triggerSegmentationEvents_js__rspack_import_3 = __webpack_require__(11815);
|
|
37160
37382
|
/* import */ var _utilities_triggerAnnotationRenderForViewportIds_js__rspack_import_4 = __webpack_require__(74128);
|
|
@@ -37458,7 +37680,7 @@ SegmentSelectTool.toolName = 'SegmentSelectTool';
|
|
|
37458
37680
|
/* import */ var _drawingSvg_index_js__rspack_import_4 = __webpack_require__(88741);
|
|
37459
37681
|
/* import */ var _cursors_elementCursor_js__rspack_import_5 = __webpack_require__(30905);
|
|
37460
37682
|
/* import */ var _utilities_triggerAnnotationRenderForViewportIds_js__rspack_import_6 = __webpack_require__(74128);
|
|
37461
|
-
/* import */ var _stateManagement_segmentation_index_js__rspack_import_7 = __webpack_require__(
|
|
37683
|
+
/* import */ var _stateManagement_segmentation_index_js__rspack_import_7 = __webpack_require__(86274);
|
|
37462
37684
|
/* import */ var _stateManagement_segmentation_segmentationState_js__rspack_import_8 = __webpack_require__(61342);
|
|
37463
37685
|
/* import */ var _LabelmapBaseTool_js__rspack_import_9 = __webpack_require__(82607);
|
|
37464
37686
|
/* import */ var _utilities_getViewportICamera_js__rspack_import_10 = __webpack_require__(40196);
|
|
@@ -37759,6 +37981,10 @@ SphereScissorsTool.toolName = 'SphereScissor';
|
|
|
37759
37981
|
/* import */ var _enums_index_js__rspack_import_4 = __webpack_require__(36776);
|
|
37760
37982
|
/* import */ var _compositions_index_js__rspack_import_5 = __webpack_require__(68292);
|
|
37761
37983
|
/* import */ var _utilities_math_sphere_index_js__rspack_import_6 = __webpack_require__(95515);
|
|
37984
|
+
/* import */ var _utils_brushVoxelSlab_js__rspack_import_7 = __webpack_require__(90058);
|
|
37985
|
+
/* import */ var _utilities_genericViewportToolHelpers_js__rspack_import_8 = __webpack_require__(73820);
|
|
37986
|
+
|
|
37987
|
+
|
|
37762
37988
|
|
|
37763
37989
|
|
|
37764
37990
|
|
|
@@ -37777,19 +38003,23 @@ function getEllipseCornersFromCanvasCoordinates(canvasCoordinates) {
|
|
|
37777
38003
|
}
|
|
37778
38004
|
function createCircleCornersForCenter(center, viewUp, viewRight, yRadius, xRadius) {
|
|
37779
38005
|
const centerVec = gl_matrix__rspack_import_0/* .vec3.fromValues */.eR.fA(center[0], center[1], center[2]);
|
|
37780
|
-
const
|
|
37781
|
-
gl_matrix__rspack_import_0/* .vec3.scaleAndAdd */.eR.Ln(
|
|
37782
|
-
|
|
37783
|
-
gl_matrix__rspack_import_0/* .vec3.
|
|
37784
|
-
|
|
37785
|
-
gl_matrix__rspack_import_0/* .vec3.scaleAndAdd */.eR.Ln(
|
|
37786
|
-
const
|
|
37787
|
-
gl_matrix__rspack_import_0/* .vec3.scaleAndAdd */.eR.Ln(
|
|
38006
|
+
const topRight = gl_matrix__rspack_import_0/* .vec3.create */.eR.vt();
|
|
38007
|
+
gl_matrix__rspack_import_0/* .vec3.scaleAndAdd */.eR.Ln(topRight, centerVec, viewUp, yRadius);
|
|
38008
|
+
gl_matrix__rspack_import_0/* .vec3.scaleAndAdd */.eR.Ln(topRight, topRight, viewRight, xRadius);
|
|
38009
|
+
const topLeft = gl_matrix__rspack_import_0/* .vec3.create */.eR.vt();
|
|
38010
|
+
gl_matrix__rspack_import_0/* .vec3.scaleAndAdd */.eR.Ln(topLeft, centerVec, viewUp, yRadius);
|
|
38011
|
+
gl_matrix__rspack_import_0/* .vec3.scaleAndAdd */.eR.Ln(topLeft, topLeft, viewRight, -xRadius);
|
|
38012
|
+
const bottomRight = gl_matrix__rspack_import_0/* .vec3.create */.eR.vt();
|
|
38013
|
+
gl_matrix__rspack_import_0/* .vec3.scaleAndAdd */.eR.Ln(bottomRight, centerVec, viewUp, -yRadius);
|
|
38014
|
+
gl_matrix__rspack_import_0/* .vec3.scaleAndAdd */.eR.Ln(bottomRight, bottomRight, viewRight, xRadius);
|
|
38015
|
+
const bottomLeft = gl_matrix__rspack_import_0/* .vec3.create */.eR.vt();
|
|
38016
|
+
gl_matrix__rspack_import_0/* .vec3.scaleAndAdd */.eR.Ln(bottomLeft, centerVec, viewUp, -yRadius);
|
|
38017
|
+
gl_matrix__rspack_import_0/* .vec3.scaleAndAdd */.eR.Ln(bottomLeft, bottomLeft, viewRight, -xRadius);
|
|
37788
38018
|
return [
|
|
37789
|
-
|
|
37790
|
-
|
|
37791
|
-
|
|
37792
|
-
|
|
38019
|
+
topRight,
|
|
38020
|
+
topLeft,
|
|
38021
|
+
bottomRight,
|
|
38022
|
+
bottomLeft,
|
|
37793
38023
|
];
|
|
37794
38024
|
}
|
|
37795
38025
|
function createStrokePredicate(centers, xRadius, yRadius) {
|
|
@@ -37902,32 +38132,59 @@ const initializeCircle = {
|
|
|
37902
38132
|
xRadius,
|
|
37903
38133
|
yRadius,
|
|
37904
38134
|
aspectRatio,
|
|
38135
|
+
viewRight,
|
|
38136
|
+
viewUp: normalizedViewUp,
|
|
38137
|
+
viewNormal: normalizedPlaneNormal,
|
|
37905
38138
|
});
|
|
37906
38139
|
operationData.isInObjectBoundsIJK = boundsIJK;
|
|
38140
|
+
const viewThicknessWorld = (0,_utilities_genericViewportToolHelpers_js__rspack_import_8/* .getViewSlabDepthOfViewport */._U)(viewport);
|
|
38141
|
+
(0,_utils_brushVoxelSlab_js__rspack_import_7/* .applyBrushFill */.Ws)(operationData, (0,_utils_brushVoxelSlab_js__rspack_import_7/* .createCircleBrushFill */.SH)({
|
|
38142
|
+
segmentationImageData,
|
|
38143
|
+
viewUp: normalizedViewUp,
|
|
38144
|
+
viewPlaneNormal: normalizedPlaneNormal,
|
|
38145
|
+
centerWorld: operationData.centerWorld,
|
|
38146
|
+
xRadius,
|
|
38147
|
+
yRadius,
|
|
38148
|
+
strokeCentersWorld: strokeCenters,
|
|
38149
|
+
viewThicknessWorld,
|
|
38150
|
+
}));
|
|
37907
38151
|
},
|
|
37908
38152
|
};
|
|
37909
38153
|
function createPointInEllipse(cornersInWorld = [], options = {}) {
|
|
37910
38154
|
if (!cornersInWorld || cornersInWorld.length !== 4) {
|
|
37911
38155
|
throw new Error('createPointInEllipse: cornersInWorld must have 4 points');
|
|
37912
38156
|
}
|
|
37913
|
-
const [topLeft, bottomRight,
|
|
38157
|
+
const [topLeft, bottomRight, , topRight] = cornersInWorld;
|
|
37914
38158
|
const aspectRatio = options.aspectRatio || [1, 1];
|
|
38159
|
+
const segmentationImageData = options.segmentationImageData;
|
|
38160
|
+
const { viewRight, viewUp, viewNormal } = options;
|
|
38161
|
+
const spacing = segmentationImageData?.getSpacing?.();
|
|
38162
|
+
const direction = segmentationImageData?.getDirection?.();
|
|
38163
|
+
const spacingInNormal = spacing && direction && viewNormal
|
|
38164
|
+
? _cornerstonejs_core__rspack_import_1.utilities.getSpacingInNormalDirection({ spacing, direction }, viewNormal)
|
|
38165
|
+
: spacing
|
|
38166
|
+
? Math.max(...spacing, Number.EPSILON)
|
|
38167
|
+
: 1;
|
|
38168
|
+
const planeTolerance = Math.max(spacingInNormal / 2, Number.EPSILON);
|
|
37915
38169
|
const center = gl_matrix__rspack_import_0/* .vec3.create */.eR.vt();
|
|
37916
38170
|
gl_matrix__rspack_import_0/* .vec3.add */.eR.WQ(center, topLeft, bottomRight);
|
|
37917
38171
|
gl_matrix__rspack_import_0/* .vec3.scale */.eR.hs(center, center, 0.5);
|
|
37918
38172
|
const majorAxisVec = gl_matrix__rspack_import_0/* .vec3.create */.eR.vt();
|
|
37919
38173
|
gl_matrix__rspack_import_0/* .vec3.subtract */.eR.Re(majorAxisVec, topRight, topLeft);
|
|
37920
38174
|
const originalRadius = gl_matrix__rspack_import_0/* .vec3.length */.eR.Bw(majorAxisVec) / 2;
|
|
37921
|
-
gl_matrix__rspack_import_0/* .vec3.normalize */.eR.S8(majorAxisVec, majorAxisVec);
|
|
37922
|
-
const minorAxisVec = gl_matrix__rspack_import_0/* .vec3.create */.eR.vt();
|
|
37923
|
-
gl_matrix__rspack_import_0/* .vec3.subtract */.eR.Re(minorAxisVec, bottomLeft, topLeft);
|
|
37924
|
-
gl_matrix__rspack_import_0/* .vec3.normalize */.eR.S8(minorAxisVec, minorAxisVec);
|
|
37925
38175
|
const xRadius = originalRadius / aspectRatio[0];
|
|
37926
38176
|
const yRadius = originalRadius / aspectRatio[1];
|
|
38177
|
+
const invXRadiusSquared = 1 / (xRadius * xRadius);
|
|
38178
|
+
const invYRadiusSquared = 1 / (yRadius * yRadius);
|
|
38179
|
+
const invZRadiusSquared = options.depthRadius > 0
|
|
38180
|
+
? 1 / (options.depthRadius * options.depthRadius)
|
|
38181
|
+
: null;
|
|
37927
38182
|
const xRadiusForStroke = options.xRadius ?? xRadius;
|
|
37928
38183
|
const yRadiusForStroke = options.yRadius ?? yRadius;
|
|
37929
38184
|
const strokePredicate = createStrokePredicate(options.strokePointsWorld || [], xRadiusForStroke, yRadiusForStroke);
|
|
37930
|
-
|
|
38185
|
+
const isSphere = isEqual(xRadius, yRadius) &&
|
|
38186
|
+
(invZRadiusSquared === null || isEqual(options.depthRadius, xRadius));
|
|
38187
|
+
if (isSphere) {
|
|
37931
38188
|
const radius = xRadius;
|
|
37932
38189
|
const sphereObj = {
|
|
37933
38190
|
center,
|
|
@@ -37961,9 +38218,18 @@ function createPointInEllipse(cornersInWorld = [], options = {}) {
|
|
|
37961
38218
|
}
|
|
37962
38219
|
const pointVec = gl_matrix__rspack_import_0/* .vec3.create */.eR.vt();
|
|
37963
38220
|
gl_matrix__rspack_import_0/* .vec3.subtract */.eR.Re(pointVec, worldPoint, center);
|
|
37964
|
-
const
|
|
37965
|
-
const
|
|
37966
|
-
|
|
38221
|
+
const xDist = gl_matrix__rspack_import_0/* .vec3.dot */.eR.Om(pointVec, viewRight);
|
|
38222
|
+
const yDist = gl_matrix__rspack_import_0/* .vec3.dot */.eR.Om(pointVec, viewUp);
|
|
38223
|
+
const xTerm = xDist * xDist * invXRadiusSquared;
|
|
38224
|
+
const yTerm = yDist * yDist * invYRadiusSquared;
|
|
38225
|
+
const zDist = gl_matrix__rspack_import_0/* .vec3.dot */.eR.Om(pointVec, viewNormal);
|
|
38226
|
+
if (invZRadiusSquared !== null) {
|
|
38227
|
+
return xTerm + yTerm + zDist * zDist * invZRadiusSquared <= 1;
|
|
38228
|
+
}
|
|
38229
|
+
if (xTerm + yTerm <= 1) {
|
|
38230
|
+
return Math.abs(zDist) <= planeTolerance;
|
|
38231
|
+
}
|
|
38232
|
+
return false;
|
|
37967
38233
|
};
|
|
37968
38234
|
}
|
|
37969
38235
|
const CIRCLE_STRATEGY = new _BrushStrategy_js__rspack_import_3/* ["default"] */.A('Circle', _compositions_index_js__rspack_import_5/* ["default"].regionFill */.A.regionFill, _compositions_index_js__rspack_import_5/* ["default"].setValue */.A.setValue, initializeCircle, _compositions_index_js__rspack_import_5/* ["default"].determineSegmentIndex */.A.determineSegmentIndex, _compositions_index_js__rspack_import_5/* ["default"].preview */.A.preview, _compositions_index_js__rspack_import_5/* ["default"].labelmapStatistics */.A.labelmapStatistics);
|
|
@@ -37990,12 +38256,10 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
37990
38256
|
65704(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
37991
38257
|
/* import */ var gl_matrix__rspack_import_0 = __webpack_require__(50341);
|
|
37992
38258
|
/* import */ var _cornerstonejs_core__rspack_import_1 = __webpack_require__(62721);
|
|
37993
|
-
/* import */ var
|
|
37994
|
-
/* import */ var
|
|
37995
|
-
/* import */ var
|
|
37996
|
-
/* import */ var
|
|
37997
|
-
/* import */ var _compositions_index_js__rspack_import_6 = __webpack_require__(68292);
|
|
37998
|
-
|
|
38259
|
+
/* import */ var _BrushStrategy_js__rspack_import_2 = __webpack_require__(33699);
|
|
38260
|
+
/* import */ var _enums_index_js__rspack_import_3 = __webpack_require__(36776);
|
|
38261
|
+
/* import */ var _compositions_index_js__rspack_import_4 = __webpack_require__(68292);
|
|
38262
|
+
/* import */ var _utils_brushVoxelSlab_js__rspack_import_5 = __webpack_require__(90058);
|
|
37999
38263
|
|
|
38000
38264
|
|
|
38001
38265
|
|
|
@@ -38003,9 +38267,45 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
38003
38267
|
|
|
38004
38268
|
|
|
38005
38269
|
const { transformWorldToIndex } = _cornerstonejs_core__rspack_import_1.utilities;
|
|
38270
|
+
function orderRectangleCorners(pts) {
|
|
38271
|
+
if (pts.length < 3) {
|
|
38272
|
+
return [...pts];
|
|
38273
|
+
}
|
|
38274
|
+
const center = gl_matrix__rspack_import_0/* .vec3.create */.eR.vt();
|
|
38275
|
+
pts.forEach((p) => gl_matrix__rspack_import_0/* .vec3.add */.eR.WQ(center, center, p));
|
|
38276
|
+
gl_matrix__rspack_import_0/* .vec3.scale */.eR.hs(center, center, 1 / pts.length);
|
|
38277
|
+
const radials = pts.map((p) => gl_matrix__rspack_import_0/* .vec3.subtract */.eR.Re(gl_matrix__rspack_import_0/* .vec3.create */.eR.vt(), p, center));
|
|
38278
|
+
let axisInPlane = radials[0];
|
|
38279
|
+
let maxLenSq = gl_matrix__rspack_import_0/* .vec3.squaredLength */.eR.m3(axisInPlane);
|
|
38280
|
+
for (const radial of radials) {
|
|
38281
|
+
const lenSq = gl_matrix__rspack_import_0/* .vec3.squaredLength */.eR.m3(radial);
|
|
38282
|
+
if (lenSq > maxLenSq) {
|
|
38283
|
+
maxLenSq = lenSq;
|
|
38284
|
+
axisInPlane = radial;
|
|
38285
|
+
}
|
|
38286
|
+
}
|
|
38287
|
+
const e1 = gl_matrix__rspack_import_0/* .vec3.normalize */.eR.S8(gl_matrix__rspack_import_0/* .vec3.create */.eR.vt(), axisInPlane);
|
|
38288
|
+
const normal = gl_matrix__rspack_import_0/* .vec3.create */.eR.vt();
|
|
38289
|
+
const candidate = gl_matrix__rspack_import_0/* .vec3.create */.eR.vt();
|
|
38290
|
+
for (const radial of radials) {
|
|
38291
|
+
gl_matrix__rspack_import_0/* .vec3.cross */.eR.$A(candidate, e1, radial);
|
|
38292
|
+
if (gl_matrix__rspack_import_0/* .vec3.squaredLength */.eR.m3(candidate) > gl_matrix__rspack_import_0/* .vec3.squaredLength */.eR.m3(normal)) {
|
|
38293
|
+
gl_matrix__rspack_import_0/* .vec3.copy */.eR.C(normal, candidate);
|
|
38294
|
+
}
|
|
38295
|
+
}
|
|
38296
|
+
gl_matrix__rspack_import_0/* .vec3.normalize */.eR.S8(normal, normal);
|
|
38297
|
+
const e2 = gl_matrix__rspack_import_0/* .vec3.normalize */.eR.S8(gl_matrix__rspack_import_0/* .vec3.create */.eR.vt(), gl_matrix__rspack_import_0/* .vec3.cross */.eR.$A(gl_matrix__rspack_import_0/* .vec3.create */.eR.vt(), normal, e1));
|
|
38298
|
+
return [...pts].sort((a, b) => {
|
|
38299
|
+
const ra = gl_matrix__rspack_import_0/* .vec3.subtract */.eR.Re(gl_matrix__rspack_import_0/* .vec3.create */.eR.vt(), a, center);
|
|
38300
|
+
const rb = gl_matrix__rspack_import_0/* .vec3.subtract */.eR.Re(gl_matrix__rspack_import_0/* .vec3.create */.eR.vt(), b, center);
|
|
38301
|
+
const angleA = Math.atan2(gl_matrix__rspack_import_0/* .vec3.dot */.eR.Om(ra, e2), gl_matrix__rspack_import_0/* .vec3.dot */.eR.Om(ra, e1));
|
|
38302
|
+
const angleB = Math.atan2(gl_matrix__rspack_import_0/* .vec3.dot */.eR.Om(rb, e2), gl_matrix__rspack_import_0/* .vec3.dot */.eR.Om(rb, e1));
|
|
38303
|
+
return angleA - angleB;
|
|
38304
|
+
});
|
|
38305
|
+
}
|
|
38006
38306
|
const initializeRectangle = {
|
|
38007
|
-
[
|
|
38008
|
-
const { points,
|
|
38307
|
+
[_enums_index_js__rspack_import_3.StrategyCallbacks.Initialize]: (operationData) => {
|
|
38308
|
+
const { points, segmentationImageData, viewPlaneNormal, } = operationData;
|
|
38009
38309
|
if (!points) {
|
|
38010
38310
|
return;
|
|
38011
38311
|
}
|
|
@@ -38016,22 +38316,38 @@ const initializeRectangle = {
|
|
|
38016
38316
|
gl_matrix__rspack_import_0/* .vec3.scale */.eR.hs(center, center, 1 / points.length);
|
|
38017
38317
|
operationData.centerWorld = center;
|
|
38018
38318
|
operationData.centerIJK = transformWorldToIndex(segmentationImageData, center);
|
|
38019
|
-
const
|
|
38319
|
+
const orderedPoints = orderRectangleCorners(points);
|
|
38320
|
+
const { boundsIJK, pointInShapeFn } = createPointInRectangle(orderedPoints, segmentationImageData);
|
|
38020
38321
|
operationData.isInObject = pointInShapeFn;
|
|
38021
38322
|
operationData.isInObjectBoundsIJK = boundsIJK;
|
|
38323
|
+
(0,_utils_brushVoxelSlab_js__rspack_import_5/* .applyBrushFill */.Ws)(operationData, (0,_utils_brushVoxelSlab_js__rspack_import_5/* .createRectangleBrushFill */.LY)({
|
|
38324
|
+
segmentationImageData,
|
|
38325
|
+
cornersWorld: orderedPoints,
|
|
38326
|
+
viewPlaneNormal: viewPlaneNormal,
|
|
38327
|
+
}));
|
|
38022
38328
|
},
|
|
38023
38329
|
};
|
|
38024
|
-
function createPointInRectangle(
|
|
38025
|
-
|
|
38026
|
-
|
|
38027
|
-
|
|
38028
|
-
|
|
38029
|
-
|
|
38030
|
-
|
|
38031
|
-
|
|
38032
|
-
|
|
38033
|
-
|
|
38034
|
-
|
|
38330
|
+
function createPointInRectangle(orderedPoints, segmentationImageData) {
|
|
38331
|
+
const [p0, p1, , p3] = orderedPoints;
|
|
38332
|
+
const rectangleCornersIJK = orderedPoints.map((world) => transformWorldToIndex(segmentationImageData, world));
|
|
38333
|
+
const dims = segmentationImageData.getDimensions();
|
|
38334
|
+
const cornerIValues = rectangleCornersIJK.map((p) => p[0]);
|
|
38335
|
+
const cornerJValues = rectangleCornersIJK.map((p) => p[1]);
|
|
38336
|
+
const cornerKValues = rectangleCornersIJK.map((p) => p[2]);
|
|
38337
|
+
const boundsIJK = [
|
|
38338
|
+
[
|
|
38339
|
+
Math.max(0, Math.floor(Math.min(...cornerIValues))),
|
|
38340
|
+
Math.min(dims[0] - 1, Math.ceil(Math.max(...cornerIValues))),
|
|
38341
|
+
],
|
|
38342
|
+
[
|
|
38343
|
+
Math.max(0, Math.floor(Math.min(...cornerJValues))),
|
|
38344
|
+
Math.min(dims[1] - 1, Math.ceil(Math.max(...cornerJValues))),
|
|
38345
|
+
],
|
|
38346
|
+
[
|
|
38347
|
+
Math.max(0, Math.floor(Math.min(...cornerKValues))),
|
|
38348
|
+
Math.min(dims[2] - 1, Math.ceil(Math.max(...cornerKValues))),
|
|
38349
|
+
],
|
|
38350
|
+
];
|
|
38035
38351
|
const axisU = gl_matrix__rspack_import_0/* .vec3.create */.eR.vt();
|
|
38036
38352
|
const axisV = gl_matrix__rspack_import_0/* .vec3.create */.eR.vt();
|
|
38037
38353
|
gl_matrix__rspack_import_0/* .vec3.subtract */.eR.Re(axisU, p1, p0);
|
|
@@ -38043,29 +38359,31 @@ function createPointInRectangle(viewport, points, segmentationImageData) {
|
|
|
38043
38359
|
const normal = gl_matrix__rspack_import_0/* .vec3.create */.eR.vt();
|
|
38044
38360
|
gl_matrix__rspack_import_0/* .vec3.cross */.eR.$A(normal, axisU, axisV);
|
|
38045
38361
|
gl_matrix__rspack_import_0/* .vec3.normalize */.eR.S8(normal, normal);
|
|
38046
|
-
const direction = segmentationImageData.getDirection();
|
|
38047
38362
|
const spacing = segmentationImageData.getSpacing();
|
|
38048
|
-
const
|
|
38049
|
-
const
|
|
38363
|
+
const direction = segmentationImageData.getDirection();
|
|
38364
|
+
const projectedSpacing = _cornerstonejs_core__rspack_import_1.utilities.getSpacingInNormalDirection({
|
|
38050
38365
|
direction,
|
|
38051
38366
|
spacing,
|
|
38052
|
-
},
|
|
38367
|
+
}, normal);
|
|
38368
|
+
const thickness = projectedSpacing;
|
|
38369
|
+
const inPlaneSpacing = Math.min(spacing[0], spacing[1]);
|
|
38370
|
+
const inPlaneTolerance = inPlaneSpacing / 2;
|
|
38053
38371
|
const pointInShapeFn = (pointLPS) => {
|
|
38054
38372
|
const v = gl_matrix__rspack_import_0/* .vec3.create */.eR.vt();
|
|
38055
38373
|
gl_matrix__rspack_import_0/* .vec3.subtract */.eR.Re(v, pointLPS, p0);
|
|
38056
38374
|
const u = gl_matrix__rspack_import_0/* .vec3.dot */.eR.Om(v, axisU);
|
|
38057
38375
|
const vproj = gl_matrix__rspack_import_0/* .vec3.dot */.eR.Om(v, axisV);
|
|
38058
|
-
const
|
|
38059
|
-
return (u >= -
|
|
38060
|
-
u <= uLen +
|
|
38061
|
-
vproj >= -
|
|
38062
|
-
vproj <= vLen +
|
|
38063
|
-
|
|
38376
|
+
const distanceToPlane = Math.abs(gl_matrix__rspack_import_0/* .vec3.dot */.eR.Om(v, normal));
|
|
38377
|
+
return (u >= -inPlaneTolerance &&
|
|
38378
|
+
u <= uLen + inPlaneTolerance &&
|
|
38379
|
+
vproj >= -inPlaneTolerance &&
|
|
38380
|
+
vproj <= vLen + inPlaneTolerance &&
|
|
38381
|
+
distanceToPlane <= thickness);
|
|
38064
38382
|
};
|
|
38065
38383
|
return { boundsIJK, pointInShapeFn };
|
|
38066
38384
|
}
|
|
38067
|
-
const RECTANGLE_STRATEGY = new
|
|
38068
|
-
const RECTANGLE_THRESHOLD_STRATEGY = new
|
|
38385
|
+
const RECTANGLE_STRATEGY = new _BrushStrategy_js__rspack_import_2/* ["default"] */.A('Rectangle', _compositions_index_js__rspack_import_4/* ["default"].regionFill */.A.regionFill, _compositions_index_js__rspack_import_4/* ["default"].setValue */.A.setValue, initializeRectangle, _compositions_index_js__rspack_import_4/* ["default"].determineSegmentIndex */.A.determineSegmentIndex, _compositions_index_js__rspack_import_4/* ["default"].preview */.A.preview, _compositions_index_js__rspack_import_4/* ["default"].labelmapStatistics */.A.labelmapStatistics);
|
|
38386
|
+
const RECTANGLE_THRESHOLD_STRATEGY = new _BrushStrategy_js__rspack_import_2/* ["default"] */.A('RectangleThreshold', _compositions_index_js__rspack_import_4/* ["default"].regionFill */.A.regionFill, _compositions_index_js__rspack_import_4/* ["default"].setValue */.A.setValue, initializeRectangle, _compositions_index_js__rspack_import_4/* ["default"].determineSegmentIndex */.A.determineSegmentIndex, _compositions_index_js__rspack_import_4/* ["default"].dynamicThreshold */.A.dynamicThreshold, _compositions_index_js__rspack_import_4/* ["default"].threshold */.A.threshold, _compositions_index_js__rspack_import_4/* ["default"].preview */.A.preview, _compositions_index_js__rspack_import_4/* ["default"].islandRemoval */.A.islandRemoval, _compositions_index_js__rspack_import_4/* ["default"].labelmapStatistics */.A.labelmapStatistics);
|
|
38069
38387
|
const fillInsideRectangle = RECTANGLE_STRATEGY.strategyFunction;
|
|
38070
38388
|
const thresholdInsideRectangle = RECTANGLE_THRESHOLD_STRATEGY.strategyFunction;
|
|
38071
38389
|
|
|
@@ -40830,7 +41148,7 @@ function findContoursFromReducedSet(lines) {
|
|
|
40830
41148
|
},
|
|
40831
41149
|
83753(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
40832
41150
|
/* import */ var _math_polyline_isClosed_js__rspack_import_0 = __webpack_require__(89102);
|
|
40833
|
-
/* import */ var _math_polyline_index_js__rspack_import_1 = __webpack_require__(
|
|
41151
|
+
/* import */ var _math_polyline_index_js__rspack_import_1 = __webpack_require__(1109);
|
|
40834
41152
|
|
|
40835
41153
|
|
|
40836
41154
|
function findIslands(polylines, threshold) {
|
|
@@ -41616,6 +41934,13 @@ function getSlabThicknessOrDefault(viewport) {
|
|
|
41616
41934
|
}
|
|
41617
41935
|
return viewport.getSlabThickness();
|
|
41618
41936
|
}
|
|
41937
|
+
function getViewSlabDepthOfViewport(viewport) {
|
|
41938
|
+
const slabThickness = viewport.getSlabThickness?.();
|
|
41939
|
+
if (!Number.isFinite(slabThickness)) {
|
|
41940
|
+
return undefined;
|
|
41941
|
+
}
|
|
41942
|
+
return _cornerstonejs_core__rspack_import_0.utilities.getViewSlabDepth(_cornerstonejs_core__rspack_import_0.utilities.isGenericViewport(viewport) ? slabThickness : slabThickness * 2);
|
|
41943
|
+
}
|
|
41619
41944
|
function jumpToFocalPoint(viewport, cameraFocalPoint) {
|
|
41620
41945
|
if (_cornerstonejs_core__rspack_import_0.utilities.isGenericViewport(viewport)) {
|
|
41621
41946
|
viewport.setViewReference({ cameraFocalPoint });
|
|
@@ -41678,6 +42003,7 @@ function getNativeSourceProperties(viewport) {
|
|
|
41678
42003
|
|
|
41679
42004
|
__webpack_require__.d(__webpack_exports__, {
|
|
41680
42005
|
NT: () => (getSlabThicknessOrDefault),
|
|
42006
|
+
_U: () => (getViewSlabDepthOfViewport),
|
|
41681
42007
|
du: () => (navigatePlanarViewportToPoint),
|
|
41682
42008
|
pY: () => (jumpToFocalPoint),
|
|
41683
42009
|
sH: () => (getNativeSourceProperties)
|
|
@@ -42156,6 +42482,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
42156
42482
|
getPixelValueUnitsImageId: () => (/* reexport safe */ _getPixelValueUnits_js__rspack_import_39.N),
|
|
42157
42483
|
getSlabIntensityPickContext: () => (/* reexport safe */ _pickIntensityPointInSlab_js__rspack_import_47.y),
|
|
42158
42484
|
getSphereBoundsInfo: () => (/* reexport safe */ _getSphereBoundsInfo_js__rspack_import_10.R),
|
|
42485
|
+
getViewSlabDepthOfViewport: () => (/* reexport safe */ _genericViewportToolHelpers_js__rspack_import_46._U),
|
|
42159
42486
|
getViewportForAnnotation: () => (/* reexport safe */ _getViewportForAnnotation_js__rspack_import_14.A),
|
|
42160
42487
|
isObject: () => (/* reexport safe */ _isObject_js__rspack_import_4.A),
|
|
42161
42488
|
jumpToFocalPoint: () => (/* reexport safe */ _genericViewportToolHelpers_js__rspack_import_46.pY),
|
|
@@ -42425,9 +42752,10 @@ const precalculatePointInEllipse = (ellipse, inverts = {}) => {
|
|
|
42425
42752
|
|
|
42426
42753
|
;// CONCATENATED MODULE: ../../node_modules/@cornerstonejs/tools/dist/esm/utilities/math/ellipse/getCanvasEllipseCorners.js
|
|
42427
42754
|
function getCanvasEllipseCorners(ellipseCanvasPoints) {
|
|
42428
|
-
const
|
|
42429
|
-
const
|
|
42430
|
-
const
|
|
42755
|
+
const xs = ellipseCanvasPoints.map((point) => point[0]);
|
|
42756
|
+
const ys = ellipseCanvasPoints.map((point) => point[1]);
|
|
42757
|
+
const topLeft = [Math.min(...xs), Math.min(...ys)];
|
|
42758
|
+
const bottomRight = [Math.max(...xs), Math.max(...ys)];
|
|
42431
42759
|
return [topLeft, bottomRight];
|
|
42432
42760
|
}
|
|
42433
42761
|
|
|
@@ -42485,8 +42813,8 @@ var ellipse = __webpack_require__(88688);
|
|
|
42485
42813
|
var line = __webpack_require__(48682);
|
|
42486
42814
|
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/tools/dist/esm/utilities/math/point/index.js + 1 modules
|
|
42487
42815
|
var point = __webpack_require__(3756);
|
|
42488
|
-
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/tools/dist/esm/utilities/math/polyline/index.js +
|
|
42489
|
-
var polyline = __webpack_require__(
|
|
42816
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/tools/dist/esm/utilities/math/polyline/index.js + 3 modules
|
|
42817
|
+
var polyline = __webpack_require__(1109);
|
|
42490
42818
|
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/tools/dist/esm/utilities/math/rectangle/index.js
|
|
42491
42819
|
var rectangle = __webpack_require__(3001);
|
|
42492
42820
|
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/tools/dist/esm/utilities/math/vec2/index.js
|
|
@@ -43479,7 +43807,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
43479
43807
|
|
|
43480
43808
|
|
|
43481
43809
|
},
|
|
43482
|
-
|
|
43810
|
+
1109(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
43483
43811
|
// ESM COMPAT FLAG
|
|
43484
43812
|
__webpack_require__.r(__webpack_exports__);
|
|
43485
43813
|
|
|
@@ -43505,11 +43833,11 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
43505
43833
|
intersectPolyline: () => (/* reexport */ intersectPolyline/* ["default"] */.A),
|
|
43506
43834
|
intersectPolylines: () => (/* reexport */ intersectPolylines/* ["default"] */.A),
|
|
43507
43835
|
isClosed: () => (/* reexport */ isClosed/* ["default"] */.A),
|
|
43508
|
-
isPointInsidePolyline3D: () => (/* reexport */ isPointInsidePolyline3D
|
|
43836
|
+
isPointInsidePolyline3D: () => (/* reexport */ isPointInsidePolyline3D),
|
|
43509
43837
|
mergePolylines: () => (/* reexport */ combinePolyline/* .mergePolylines */.S),
|
|
43510
43838
|
pointCanProjectOnLine: () => (/* reexport */ pointCanProjectOnLine/* ["default"] */.A),
|
|
43511
43839
|
pointsAreWithinCloseContourProximity: () => (/* reexport */ pointsAreWithinCloseContourProximity/* ["default"] */.A),
|
|
43512
|
-
projectTo2D: () => (/* reexport */ projectTo2D
|
|
43840
|
+
projectTo2D: () => (/* reexport */ projectTo2D),
|
|
43513
43841
|
subtractPolylines: () => (/* reexport */ subtractPolylines/* ["default"] */.A)
|
|
43514
43842
|
});
|
|
43515
43843
|
|
|
@@ -43557,10 +43885,62 @@ var pointsAreWithinCloseContourProximity = __webpack_require__(41177);
|
|
|
43557
43885
|
var addCanvasPointsToArray = __webpack_require__(13248);
|
|
43558
43886
|
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/tools/dist/esm/utilities/math/polyline/pointCanProjectOnLine.js
|
|
43559
43887
|
var pointCanProjectOnLine = __webpack_require__(94018);
|
|
43560
|
-
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/
|
|
43561
|
-
var
|
|
43562
|
-
|
|
43563
|
-
|
|
43888
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/index.js
|
|
43889
|
+
var esm = __webpack_require__(62721);
|
|
43890
|
+
;// CONCATENATED MODULE: ../../node_modules/@cornerstonejs/tools/dist/esm/utilities/math/polyline/projectTo2D.js
|
|
43891
|
+
|
|
43892
|
+
const epsilon = 1e-6;
|
|
43893
|
+
function projectTo2D(polyline) {
|
|
43894
|
+
let sharedDimensionIndex;
|
|
43895
|
+
const testPoints = esm.utilities.getRandomSampleFromArray(polyline, 50);
|
|
43896
|
+
for (let i = 0; i < 3; i++) {
|
|
43897
|
+
if (testPoints.every((point, index, array) => Math.abs(point[i] - array[0][i]) < epsilon)) {
|
|
43898
|
+
sharedDimensionIndex = i;
|
|
43899
|
+
break;
|
|
43900
|
+
}
|
|
43901
|
+
}
|
|
43902
|
+
if (sharedDimensionIndex === undefined) {
|
|
43903
|
+
throw new Error('Cannot find a shared dimension index for polyline, probably oblique plane');
|
|
43904
|
+
}
|
|
43905
|
+
const points2D = [];
|
|
43906
|
+
const firstDim = (sharedDimensionIndex + 1) % 3;
|
|
43907
|
+
const secondDim = (sharedDimensionIndex + 2) % 3;
|
|
43908
|
+
for (let i = 0; i < polyline.length; i++) {
|
|
43909
|
+
points2D.push([polyline[i][firstDim], polyline[i][secondDim]]);
|
|
43910
|
+
}
|
|
43911
|
+
return {
|
|
43912
|
+
sharedDimensionIndex,
|
|
43913
|
+
projectedPolyline: points2D,
|
|
43914
|
+
};
|
|
43915
|
+
}
|
|
43916
|
+
|
|
43917
|
+
;// CONCATENATED MODULE: ../../node_modules/@cornerstonejs/tools/dist/esm/utilities/math/polyline/isPointInsidePolyline3D.js
|
|
43918
|
+
|
|
43919
|
+
|
|
43920
|
+
function isPointInsidePolyline3D(point, polyline, options = {}) {
|
|
43921
|
+
const { sharedDimensionIndex, projectedPolyline } = projectTo2D(polyline);
|
|
43922
|
+
const { holes } = options;
|
|
43923
|
+
const projectedHoles = [];
|
|
43924
|
+
if (holes) {
|
|
43925
|
+
for (let i = 0; i < holes.length; i++) {
|
|
43926
|
+
const hole = holes[i];
|
|
43927
|
+
const hole2D = [];
|
|
43928
|
+
for (let j = 0; j < hole.length; j++) {
|
|
43929
|
+
hole2D.push([
|
|
43930
|
+
hole[j][(sharedDimensionIndex + 1) % 3],
|
|
43931
|
+
hole[j][(sharedDimensionIndex + 2) % 3],
|
|
43932
|
+
]);
|
|
43933
|
+
}
|
|
43934
|
+
projectedHoles.push(hole2D);
|
|
43935
|
+
}
|
|
43936
|
+
}
|
|
43937
|
+
const point2D = [
|
|
43938
|
+
point[(sharedDimensionIndex + 1) % 3],
|
|
43939
|
+
point[(sharedDimensionIndex + 2) % 3],
|
|
43940
|
+
];
|
|
43941
|
+
return (0,containsPoint/* ["default"] */.A)(projectedPolyline, point2D, { holes: projectedHoles });
|
|
43942
|
+
}
|
|
43943
|
+
|
|
43564
43944
|
;// CONCATENATED MODULE: ../../node_modules/@cornerstonejs/tools/dist/esm/utilities/math/polyline/convexHull.js
|
|
43565
43945
|
function convexHull(pts) {
|
|
43566
43946
|
if (pts.length < 3) {
|
|
@@ -43934,41 +44314,6 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
43934
44314
|
});
|
|
43935
44315
|
|
|
43936
44316
|
|
|
43937
|
-
},
|
|
43938
|
-
44745(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
43939
|
-
/* import */ var _containsPoint_js__rspack_import_0 = __webpack_require__(45393);
|
|
43940
|
-
/* import */ var _projectTo2D_js__rspack_import_1 = __webpack_require__(11542);
|
|
43941
|
-
|
|
43942
|
-
|
|
43943
|
-
function isPointInsidePolyline3D(point, polyline, options = {}) {
|
|
43944
|
-
const { sharedDimensionIndex, projectedPolyline } = (0,_projectTo2D_js__rspack_import_1/* .projectTo2D */.p)(polyline);
|
|
43945
|
-
const { holes } = options;
|
|
43946
|
-
const projectedHoles = [];
|
|
43947
|
-
if (holes) {
|
|
43948
|
-
for (let i = 0; i < holes.length; i++) {
|
|
43949
|
-
const hole = holes[i];
|
|
43950
|
-
const hole2D = [];
|
|
43951
|
-
for (let j = 0; j < hole.length; j++) {
|
|
43952
|
-
hole2D.push([
|
|
43953
|
-
hole[j][(sharedDimensionIndex + 1) % 3],
|
|
43954
|
-
hole[j][(sharedDimensionIndex + 2) % 3],
|
|
43955
|
-
]);
|
|
43956
|
-
}
|
|
43957
|
-
projectedHoles.push(hole2D);
|
|
43958
|
-
}
|
|
43959
|
-
}
|
|
43960
|
-
const point2D = [
|
|
43961
|
-
point[(sharedDimensionIndex + 1) % 3],
|
|
43962
|
-
point[(sharedDimensionIndex + 2) % 3],
|
|
43963
|
-
];
|
|
43964
|
-
return (0,_containsPoint_js__rspack_import_0/* ["default"] */.A)(projectedPolyline, point2D, { holes: projectedHoles });
|
|
43965
|
-
}
|
|
43966
|
-
|
|
43967
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
43968
|
-
i: () => (isPointInsidePolyline3D)
|
|
43969
|
-
});
|
|
43970
|
-
|
|
43971
|
-
|
|
43972
44317
|
},
|
|
43973
44318
|
94018(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
43974
44319
|
/* import */ var gl_matrix__rspack_import_0 = __webpack_require__(50341);
|
|
@@ -44016,40 +44361,6 @@ const pointsAreWithinCloseContourProximity = (p1, p2, closeContourProximity) =>
|
|
|
44016
44361
|
/* export default */ __webpack_exports__.A = (pointsAreWithinCloseContourProximity);
|
|
44017
44362
|
|
|
44018
44363
|
|
|
44019
|
-
},
|
|
44020
|
-
11542(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
44021
|
-
/* import */ var _cornerstonejs_core__rspack_import_0 = __webpack_require__(62721);
|
|
44022
|
-
|
|
44023
|
-
const epsilon = 1e-6;
|
|
44024
|
-
function projectTo2D(polyline) {
|
|
44025
|
-
let sharedDimensionIndex;
|
|
44026
|
-
const testPoints = _cornerstonejs_core__rspack_import_0.utilities.getRandomSampleFromArray(polyline, 50);
|
|
44027
|
-
for (let i = 0; i < 3; i++) {
|
|
44028
|
-
if (testPoints.every((point, index, array) => Math.abs(point[i] - array[0][i]) < epsilon)) {
|
|
44029
|
-
sharedDimensionIndex = i;
|
|
44030
|
-
break;
|
|
44031
|
-
}
|
|
44032
|
-
}
|
|
44033
|
-
if (sharedDimensionIndex === undefined) {
|
|
44034
|
-
throw new Error('Cannot find a shared dimension index for polyline, probably oblique plane');
|
|
44035
|
-
}
|
|
44036
|
-
const points2D = [];
|
|
44037
|
-
const firstDim = (sharedDimensionIndex + 1) % 3;
|
|
44038
|
-
const secondDim = (sharedDimensionIndex + 2) % 3;
|
|
44039
|
-
for (let i = 0; i < polyline.length; i++) {
|
|
44040
|
-
points2D.push([polyline[i][firstDim], polyline[i][secondDim]]);
|
|
44041
|
-
}
|
|
44042
|
-
return {
|
|
44043
|
-
sharedDimensionIndex,
|
|
44044
|
-
projectedPolyline: points2D,
|
|
44045
|
-
};
|
|
44046
|
-
}
|
|
44047
|
-
|
|
44048
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
44049
|
-
p: () => (projectTo2D)
|
|
44050
|
-
});
|
|
44051
|
-
|
|
44052
|
-
|
|
44053
44364
|
},
|
|
44054
44365
|
99047(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
44055
44366
|
/* import */ var _cornerstonejs_core__rspack_import_0 = __webpack_require__(62721);
|
|
@@ -48983,7 +49294,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
48983
49294
|
|
|
48984
49295
|
},
|
|
48985
49296
|
72563() {
|
|
48986
|
-
const version = '5.
|
|
49297
|
+
const version = '5.12.0';
|
|
48987
49298
|
|
|
48988
49299
|
|
|
48989
49300
|
},
|