@ohif/app 3.12.0-beta.98 → 3.12.0
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/{1403.bundle.3735409c5ee10bad1b58.js → 1403.bundle.1c9ce804d1e88033e276.js} +4 -2
- package/dist/{147.bundle.205350dc3d21478277b1.js → 147.bundle.37d627289453cb6c3937.js} +6 -15
- package/dist/{1608.bundle.f855c4bdb7f00eb66fca.js → 1608.bundle.0687c661f1c9edfb3b8a.js} +4 -4
- package/dist/{1730.bundle.69d51c8fd41cca9480e9.js → 1730.bundle.66a5e554ab20dab97b11.js} +7 -5
- package/dist/{1927.bundle.019331c266d306772371.js → 1927.bundle.3050588e95f43cf57cdd.js} +1 -1
- package/dist/{1933.bundle.a6092b5dc308587f7e9f.js → 1933.bundle.682f142e3217d4c7fbf7.js} +7 -3
- package/dist/{2018.bundle.9edfbe64e426c42945d3.js → 2018.bundle.c06693143228cc034cb9.js} +47 -47
- package/dist/{213.bundle.d45e5272c3ead34527d9.js → 213.bundle.c2d4d7370c26b0823880.js} +2 -2
- package/dist/{2424.bundle.90cb57b13d0eb58bf9ea.js → 2424.bundle.c1e287e752f352b76543.js} +2 -2
- package/dist/{2701.bundle.aca0d4f24a6f2094c3c3.js → 2701.bundle.12bd01a80a9f8ea4cd94.js} +4 -4
- package/dist/{2842.bundle.7852a204d3510fca8b27.js → 2842.bundle.860b9f10fcdd9656947a.js} +330 -123
- package/dist/{1903.bundle.b2d00c41d30d9dee2235.js → 3081.bundle.41838985e0472851eadb.js} +644 -322
- package/dist/{3343.bundle.f8fe9316b0ff68d087f7.js → 3343.bundle.d7578ce8f75d158c0bab.js} +2 -0
- package/dist/{3461.bundle.fa6d8be868e17123ff37.js → 3461.bundle.a8fcefd1c6e389d905fc.js} +21 -17
- package/dist/{3584.bundle.839a16d349815b3f7c97.js → 3584.bundle.8cc0750425513433e9cc.js} +15 -17
- package/dist/{4019.bundle.01f63d5dd5b96ded0c00.js → 4019.bundle.83a604779f7da0101ced.js} +196 -366
- package/dist/{4202.bundle.790706560c6edb303476.js → 4202.bundle.5a0f8e4004c5d8a68548.js} +2 -2
- package/dist/{5448.bundle.9a36e001169ea3bfeb6c.js → 4410.bundle.c5224cd7d6238a7d4660.js} +313 -57
- package/dist/{4775.bundle.31f05d287dee80955ac8.js → 4775.bundle.70bc407db26afaa4331a.js} +24 -16
- package/dist/{4819.bundle.5dbd25ed97d60cbef3ed.js → 4819.bundle.47e7aa44747ddab3a39a.js} +8 -6
- package/dist/{5028.bundle.46c429226b0d3850bec6.js → 5028.bundle.274945a9ae69c6b6ad51.js} +6 -6
- package/dist/{5462.bundle.a81a691eeef782ab95b9.js → 5462.bundle.21beddaca145b7465c72.js} +2 -0
- package/dist/{5485.bundle.9800ceb06b364d3b27f5.js → 5485.bundle.4e0ec03c61ec5cadd9bb.js} +3 -3
- package/dist/{5802.bundle.28ab859d9b48a5b2c31c.js → 5802.bundle.3bf5e6b3ab330a594a47.js} +6 -12
- package/dist/{6163.bundle.c2ea625c42d12160225c.js → 6163.bundle.ca93a4e6501880901f94.js} +4 -2
- package/dist/{3353.bundle.a0f1654c642395bbbbbc.js → 6347.bundle.784c48912700f281de1d.js} +323 -179
- package/dist/{5400.bundle.de97508611da1c00d58a.js → 6409.bundle.b36048896cb11c8571fb.js} +450 -79
- package/dist/{7412.bundle.aec4834a71fc27c4ce06.js → 7412.bundle.fab1742191b7fe937330.js} +251 -197
- package/dist/{7431.bundle.999b2b65d4973bc56218.js → 7431.bundle.b01791d10e6cf9f503b0.js} +10 -4
- package/dist/{7639.bundle.1fa23b3995e153f7173a.js → 7639.bundle.32152cacb059089ed7d7.js} +24 -20
- package/dist/{8305.bundle.f3c535c1a73ab7f616f1.js → 8305.bundle.2ede68ba3c075928c9f4.js} +47 -29
- package/dist/{8558.bundle.215c129b8285e7100e9f.js → 8558.bundle.3e84c4ba2c7ec6fce52c.js} +33 -3
- package/dist/{8583.bundle.f55a6843d8a64b56def5.js → 8583.bundle.2908eee785e7e4595d14.js} +28 -23
- package/dist/{9195.bundle.892af745c4b465dc458d.js → 9195.bundle.606ca286a0fed8a43f58.js} +151 -78
- package/dist/{9845.bundle.31aec3fe7a5cdc247f4e.js → 9845.bundle.255e7c7f7a88193b4e47.js} +16 -8
- package/dist/{9862.bundle.3ca0ad5f54db87ccf91e.js → 9862.bundle.3a8958a82c572015d25d.js} +2 -2
- package/dist/{9927.bundle.f459d6c6282f24377a9a.js → 9927.bundle.e798a347dfe1f241578f.js} +16 -16
- package/dist/{5549.bundle.d5def6a3124a3a481b7c.js → 997.bundle.822b33e561263084e18c.js} +961 -290
- package/dist/{app.bundle.f5ecd8673a5dc4323740.js → app.bundle.26b7eafdf05b5445414b.js} +6000 -2284
- package/dist/app.bundle.css +1 -1
- package/dist/{compute.bundle.fdee4a0f193ee2e1b6da.js → compute.bundle.64280c7af19ff567465f.js} +3 -3
- package/dist/dicom-microscopy-viewer/dicomMicroscopyViewer.min.js +3254 -1792
- package/dist/dicom-microscopy-viewer/dicomMicroscopyViewer.min.js.map +1 -1
- package/dist/index.html +1 -1
- package/dist/{polySeg.bundle.11f9746cd60c9811a412.js → polySeg.bundle.a5aa9130b4191253c410.js} +3 -3
- package/dist/sw.js +1 -1
- package/package.json +24 -24
- /package/dist/{1459.bundle.3a7ac3457326eff48547.js → 1459.bundle.e8802999a4d7f7edf628.js} +0 -0
- /package/dist/{5457.bundle.9d64aa81cc3f52968f3c.js → 5457.bundle.f7de73bcfe1012a73b9f.js} +0 -0
- /package/dist/{5858.bundle.d5f4bf849aaeebf5025c.js → 5858.bundle.ff6b340cf7457db76a1a.js} +0 -0
- /package/dist/{6027.bundle.57cd87592e825389ec2a.js → 6027.bundle.2b12862684b0cb3af4b4.js} +0 -0
- /package/dist/{85.bundle.1c671081e8c662c66b7a.js → 85.bundle.05591d5a14d74a502dfe.js} +0 -0
|
@@ -2486,21 +2486,25 @@ var getViewportIdsWithSegmentation = __webpack_require__(58859);
|
|
|
2486
2486
|
|
|
2487
2487
|
|
|
2488
2488
|
|
|
2489
|
+
const getViewportByViewportId = (viewportId) => {
|
|
2490
|
+
const enabledElement = (0,esm.getEnabledElementByViewportId)(viewportId);
|
|
2491
|
+
return enabledElement?.viewport ?? undefined;
|
|
2492
|
+
};
|
|
2489
2493
|
const onLabelmapSegmentationDataModified = function (evt) {
|
|
2490
2494
|
const { segmentationId, modifiedSlicesToUse } = evt.detail;
|
|
2491
2495
|
const { representationData } = (0,getSegmentation/* getSegmentation */.T)(segmentationId);
|
|
2492
2496
|
const viewportIds = (0,getViewportIdsWithSegmentation/* getViewportIdsWithSegmentation */.P)(segmentationId);
|
|
2493
2497
|
const hasVolumeViewport = viewportIds.some((viewportId) => {
|
|
2494
|
-
const
|
|
2498
|
+
const viewport = getViewportByViewportId(viewportId);
|
|
2495
2499
|
return viewport instanceof esm.VolumeViewport;
|
|
2496
2500
|
});
|
|
2497
2501
|
const hasStackViewport = viewportIds.some((viewportId) => {
|
|
2498
|
-
const
|
|
2502
|
+
const viewport = getViewportByViewportId(viewportId);
|
|
2499
2503
|
return viewport instanceof esm.StackViewport;
|
|
2500
2504
|
});
|
|
2501
2505
|
const hasBothStackAndVolume = hasVolumeViewport && hasStackViewport;
|
|
2502
2506
|
viewportIds.forEach((viewportId) => {
|
|
2503
|
-
const
|
|
2507
|
+
const viewport = getViewportByViewportId(viewportId);
|
|
2504
2508
|
if (viewport instanceof esm.VolumeViewport) {
|
|
2505
2509
|
performVolumeLabelmapUpdate({
|
|
2506
2510
|
modifiedSlicesToUse: hasBothStackAndVolume ? [] : modifiedSlicesToUse,
|
|
@@ -3766,7 +3770,8 @@ function addAnnotation(annotation, annotationGroupSelector) {
|
|
|
3766
3770
|
annotation.annotationUID = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.utilities.uuidv4();
|
|
3767
3771
|
}
|
|
3768
3772
|
const manager = getAnnotationManager();
|
|
3769
|
-
if (annotationGroupSelector instanceof HTMLDivElement
|
|
3773
|
+
if (annotationGroupSelector instanceof HTMLDivElement &&
|
|
3774
|
+
(0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.getEnabledElement)(annotationGroupSelector)) {
|
|
3770
3775
|
const groupKey = manager.getGroupKey(annotationGroupSelector);
|
|
3771
3776
|
manager.addAnnotation(annotation, groupKey);
|
|
3772
3777
|
(0,_helpers_state__WEBPACK_IMPORTED_MODULE_1__.triggerAnnotationAddedForElement)(annotation, annotationGroupSelector);
|
|
@@ -5510,6 +5515,9 @@ function getColorLUT(index) {
|
|
|
5510
5515
|
|
|
5511
5516
|
function getCurrentLabelmapImageIdForViewport(viewportId, segmentationId) {
|
|
5512
5517
|
const imageIds = getCurrentLabelmapImageIdsForViewport(viewportId, segmentationId);
|
|
5518
|
+
if (!imageIds?.length) {
|
|
5519
|
+
return;
|
|
5520
|
+
}
|
|
5513
5521
|
return imageIds[0];
|
|
5514
5522
|
}
|
|
5515
5523
|
function getCurrentLabelmapImageIdsForViewport(viewportId, segmentationId) {
|
|
@@ -5933,6 +5941,7 @@ function setSegmentIndexVisibility(viewportId, specifier, segmentIndex, visibili
|
|
|
5933
5941
|
if (!representation.segments || !representation.segments[segmentIndex]) {
|
|
5934
5942
|
return;
|
|
5935
5943
|
}
|
|
5944
|
+
representation.visible ||= visibility;
|
|
5936
5945
|
representation.segments[segmentIndex].visible = visibility;
|
|
5937
5946
|
});
|
|
5938
5947
|
(0,SegmentationRenderingEngine/* triggerSegmentationRenderBySegmentationId */.fy)(specifier.segmentationId);
|
|
@@ -6020,11 +6029,15 @@ var computeVolumeLabelmapFromStack = __webpack_require__(6994);
|
|
|
6020
6029
|
var esm = __webpack_require__(15327);
|
|
6021
6030
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/getSegmentation.js
|
|
6022
6031
|
var getSegmentation = __webpack_require__(33283);
|
|
6032
|
+
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/segmentation/createLabelmapMemo.js
|
|
6033
|
+
var createLabelmapMemo = __webpack_require__(2397);
|
|
6023
6034
|
;// ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/helpers/clearSegmentValue.js
|
|
6024
6035
|
|
|
6025
6036
|
|
|
6026
6037
|
|
|
6027
|
-
|
|
6038
|
+
|
|
6039
|
+
const { DefaultHistoryMemo } = esm.utilities.HistoryMemo;
|
|
6040
|
+
function clearSegmentValue(segmentationId, segmentIndex, options) {
|
|
6028
6041
|
const segmentation = (0,getSegmentation/* getSegmentation */.T)(segmentationId);
|
|
6029
6042
|
if (segmentation.representationData.Labelmap) {
|
|
6030
6043
|
const { representationData } = segmentation;
|
|
@@ -6038,11 +6051,18 @@ function clearSegmentValue(segmentationId, segmentIndex) {
|
|
|
6038
6051
|
return;
|
|
6039
6052
|
}
|
|
6040
6053
|
const { voxelManager } = item;
|
|
6054
|
+
const memo = options?.recordHistory
|
|
6055
|
+
? (0,createLabelmapMemo.createLabelmapMemo)(segmentationId, voxelManager)
|
|
6056
|
+
: null;
|
|
6057
|
+
const useVoxelManager = memo?.voxelManager ?? voxelManager;
|
|
6041
6058
|
voxelManager.forEach(({ value, index }) => {
|
|
6042
6059
|
if (value === segmentIndex) {
|
|
6043
|
-
|
|
6060
|
+
useVoxelManager.setAtIndex(index, 0);
|
|
6044
6061
|
}
|
|
6045
6062
|
});
|
|
6063
|
+
if (memo?.commitMemo()) {
|
|
6064
|
+
DefaultHistoryMemo.push(memo);
|
|
6065
|
+
}
|
|
6046
6066
|
});
|
|
6047
6067
|
}
|
|
6048
6068
|
(0,triggerSegmentationEvents.triggerSegmentationDataModified)(segmentationId);
|
|
@@ -6060,27 +6080,46 @@ var getActiveSegmentIndex = __webpack_require__(60740);
|
|
|
6060
6080
|
var getViewportIdsWithSegmentation = __webpack_require__(58859);
|
|
6061
6081
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/annotation/annotationState.js
|
|
6062
6082
|
var annotationState = __webpack_require__(82056);
|
|
6083
|
+
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/tools/base/AnnotationTool.js
|
|
6084
|
+
var AnnotationTool = __webpack_require__(91350);
|
|
6063
6085
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contourSegmentation/index.js + 1 modules
|
|
6064
6086
|
var contourSegmentation = __webpack_require__(56534);
|
|
6065
6087
|
;// ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/helpers/removeSegmentAnnotations.js
|
|
6066
6088
|
|
|
6067
6089
|
|
|
6068
6090
|
|
|
6069
|
-
|
|
6091
|
+
|
|
6092
|
+
function removeContourSegmentAnnotations(segmentationId, segmentIndex, options) {
|
|
6070
6093
|
const annotationUIDsMap = (0,utilities.getAnnotationsUIDMapFromSegmentation)(segmentationId);
|
|
6071
6094
|
if (!annotationUIDsMap) {
|
|
6072
6095
|
return;
|
|
6073
6096
|
}
|
|
6074
|
-
const
|
|
6075
|
-
if (!
|
|
6097
|
+
const annotationUIDsSet = annotationUIDsMap.get(segmentIndex);
|
|
6098
|
+
if (!annotationUIDsSet) {
|
|
6076
6099
|
return;
|
|
6077
6100
|
}
|
|
6078
|
-
annotationUIDs.
|
|
6101
|
+
const annotationUIDs = Array.from(annotationUIDsSet);
|
|
6102
|
+
const annotations = [];
|
|
6103
|
+
for (const annotationUID of annotationUIDs) {
|
|
6079
6104
|
const annotation = (0,annotationState.getAnnotation)(annotationUID);
|
|
6080
6105
|
if ((0,contourSegmentation.isContourSegmentationAnnotation)(annotation)) {
|
|
6081
|
-
|
|
6106
|
+
annotations.push(annotation);
|
|
6082
6107
|
}
|
|
6083
|
-
}
|
|
6108
|
+
}
|
|
6109
|
+
if (annotations.length === 0) {
|
|
6110
|
+
return;
|
|
6111
|
+
}
|
|
6112
|
+
for (const annotation of annotations) {
|
|
6113
|
+
if (annotation.parentAnnotationUID) {
|
|
6114
|
+
continue;
|
|
6115
|
+
}
|
|
6116
|
+
if (options?.recordHistory) {
|
|
6117
|
+
AnnotationTool/* default */.A.createAnnotationMemo(null, annotation, {
|
|
6118
|
+
deleting: true,
|
|
6119
|
+
});
|
|
6120
|
+
}
|
|
6121
|
+
(0,utilities.removeCompleteContourAnnotation)(annotation);
|
|
6122
|
+
}
|
|
6084
6123
|
}
|
|
6085
6124
|
|
|
6086
6125
|
;// ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/removeSegment.js
|
|
@@ -6097,10 +6136,14 @@ function removeSegment(segmentationId, segmentIndex, options = {
|
|
|
6097
6136
|
}) {
|
|
6098
6137
|
const segmentation = (0,getSegmentation/* getSegmentation */.T)(segmentationId);
|
|
6099
6138
|
if (segmentation?.representationData.Contour) {
|
|
6100
|
-
removeContourSegmentAnnotations(segmentationId, segmentIndex
|
|
6139
|
+
removeContourSegmentAnnotations(segmentationId, segmentIndex, {
|
|
6140
|
+
recordHistory: options.recordHistory,
|
|
6141
|
+
});
|
|
6101
6142
|
}
|
|
6102
6143
|
else if (segmentation?.representationData.Labelmap) {
|
|
6103
|
-
clearSegmentValue(segmentationId, segmentIndex
|
|
6144
|
+
clearSegmentValue(segmentationId, segmentIndex, {
|
|
6145
|
+
recordHistory: options.recordHistory,
|
|
6146
|
+
});
|
|
6104
6147
|
}
|
|
6105
6148
|
else {
|
|
6106
6149
|
throw new Error('Invalid segmentation type');
|
|
@@ -6119,7 +6162,7 @@ function removeSegment(segmentationId, segmentIndex, options = {
|
|
|
6119
6162
|
},
|
|
6120
6163
|
},
|
|
6121
6164
|
]);
|
|
6122
|
-
if (isThisSegmentActive && options.setNextSegmentAsActive) {
|
|
6165
|
+
if (isThisSegmentActive && options.setNextSegmentAsActive !== false) {
|
|
6123
6166
|
const segmentIndices = Object.keys(segments)
|
|
6124
6167
|
.map(Number)
|
|
6125
6168
|
.sort((a, b) => a - b);
|
|
@@ -6491,6 +6534,9 @@ function setActiveSegmentIndex(segmentationId, segmentIndex) {
|
|
|
6491
6534
|
});
|
|
6492
6535
|
viewportIds.forEach((viewportId) => {
|
|
6493
6536
|
const toolGroup = (0,_store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_0__.getToolGroupForViewport)(viewportId);
|
|
6537
|
+
if (!toolGroup) {
|
|
6538
|
+
return;
|
|
6539
|
+
}
|
|
6494
6540
|
(0,_utilities_segmentation_invalidateBrushCursor__WEBPACK_IMPORTED_MODULE_1__/* .invalidateBrushCursor */ .E)(toolGroup.id);
|
|
6495
6541
|
});
|
|
6496
6542
|
}
|
|
@@ -7462,7 +7508,7 @@ class Synchronizer {
|
|
|
7462
7508
|
}
|
|
7463
7509
|
const eventSource = this._eventSource === 'element' ? viewport.element : _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.eventTarget;
|
|
7464
7510
|
eventSource.addEventListener(this._eventName, this._onEvent.bind(this));
|
|
7465
|
-
this._auxiliaryEvents.forEach(({ name, source }) => {
|
|
7511
|
+
this._auxiliaryEvents.forEach(({ name, source = 'element' }) => {
|
|
7466
7512
|
const target = source === 'element' ? viewport.element : _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.eventTarget;
|
|
7467
7513
|
target.addEventListener(name, this._onEvent.bind(this));
|
|
7468
7514
|
});
|
|
@@ -8017,9 +8063,11 @@ class ToolGroup {
|
|
|
8017
8063
|
const cursor = cursors.MouseCursor.getDefinedCursor('default');
|
|
8018
8064
|
this._setCursorForViewports(cursor);
|
|
8019
8065
|
}
|
|
8066
|
+
toolInstance.isPrimary = false;
|
|
8020
8067
|
}
|
|
8021
8068
|
else {
|
|
8022
8069
|
this.setViewportsCursorByToolName(toolName);
|
|
8070
|
+
toolInstance.isPrimary = true;
|
|
8023
8071
|
}
|
|
8024
8072
|
if (this._hasMousePrimaryButtonBinding(toolBindingsOptions)) {
|
|
8025
8073
|
if (this.prevActivePrimaryToolName === null) {
|
|
@@ -8066,6 +8114,7 @@ class ToolGroup {
|
|
|
8066
8114
|
}
|
|
8067
8115
|
this.toolOptions[toolName] = toolOptions;
|
|
8068
8116
|
toolInstance.mode = mode;
|
|
8117
|
+
toolInstance.isPrimary = false;
|
|
8069
8118
|
if (typeof toolInstance.onSetToolPassive === 'function') {
|
|
8070
8119
|
toolInstance.onSetToolPassive();
|
|
8071
8120
|
}
|
|
@@ -9239,7 +9288,7 @@ class AdvancedMagnifyTool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .Annotati
|
|
|
9239
9288
|
const canvasPos = currentPoints.canvas;
|
|
9240
9289
|
const { magnifyingGlass: config } = this.configuration;
|
|
9241
9290
|
const { radius, zoomFactor, autoPan } = config;
|
|
9242
|
-
const
|
|
9291
|
+
const worldHandlePoints = this._getWorldHandlePoints(viewport, canvasPos, radius);
|
|
9243
9292
|
const camera = viewport.getCamera();
|
|
9244
9293
|
const { viewPlaneNormal, viewUp } = camera;
|
|
9245
9294
|
const referencedImageId = this.getReferencedImageId(viewport, worldPos, viewPlaneNormal, viewUp);
|
|
@@ -9261,9 +9310,9 @@ class AdvancedMagnifyTool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .Annotati
|
|
|
9261
9310
|
sourceViewportId: viewport.id,
|
|
9262
9311
|
magnifyViewportId,
|
|
9263
9312
|
zoomFactor,
|
|
9264
|
-
isCanvasAnnotation:
|
|
9313
|
+
isCanvasAnnotation: false,
|
|
9265
9314
|
handles: {
|
|
9266
|
-
points:
|
|
9315
|
+
points: worldHandlePoints,
|
|
9267
9316
|
activeHandleIndex: null,
|
|
9268
9317
|
},
|
|
9269
9318
|
},
|
|
@@ -9279,13 +9328,14 @@ class AdvancedMagnifyTool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .Annotati
|
|
|
9279
9328
|
padding: autoPan.padding,
|
|
9280
9329
|
callback: (data) => {
|
|
9281
9330
|
const annotationPoints = annotation.data.handles.points;
|
|
9282
|
-
const {
|
|
9331
|
+
const { world: worldDelta } = data.delta;
|
|
9283
9332
|
for (let i = 0, len = annotationPoints.length; i < len; i++) {
|
|
9284
9333
|
const point = annotationPoints[i];
|
|
9285
|
-
point[0] +=
|
|
9286
|
-
point[1] +=
|
|
9287
|
-
|
|
9334
|
+
point[0] += worldDelta[0];
|
|
9335
|
+
point[1] += worldDelta[1];
|
|
9336
|
+
point[2] += worldDelta[2];
|
|
9288
9337
|
}
|
|
9338
|
+
annotation.invalidated = true;
|
|
9289
9339
|
},
|
|
9290
9340
|
},
|
|
9291
9341
|
});
|
|
@@ -9305,17 +9355,9 @@ class AdvancedMagnifyTool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .Annotati
|
|
|
9305
9355
|
});
|
|
9306
9356
|
};
|
|
9307
9357
|
this.isPointNearTool = (element, annotation, canvasCoords, proximity) => {
|
|
9308
|
-
const {
|
|
9309
|
-
const { points } = data.handles;
|
|
9310
|
-
const
|
|
9311
|
-
const canvasTop = canvasCoordinates[0];
|
|
9312
|
-
const canvasBottom = canvasCoordinates[2];
|
|
9313
|
-
const canvasLeft = canvasCoordinates[3];
|
|
9314
|
-
const radius = Math.abs(canvasBottom[1] - canvasTop[1]) * 0.5;
|
|
9315
|
-
const center = [
|
|
9316
|
-
canvasLeft[0] + radius,
|
|
9317
|
-
canvasTop[1] + radius,
|
|
9318
|
-
];
|
|
9358
|
+
const { viewport } = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getEnabledElement)(element);
|
|
9359
|
+
const { points } = annotation.data.handles;
|
|
9360
|
+
const { radius, center } = this._getCanvasCircleData(viewport, points);
|
|
9319
9361
|
const radiusPoint = (0,_utilities_math_circle__WEBPACK_IMPORTED_MODULE_12__.getCanvasCircleRadius)([center, canvasCoords]);
|
|
9320
9362
|
if (Math.abs(radiusPoint - radius) < proximity * 2) {
|
|
9321
9363
|
return true;
|
|
@@ -9372,14 +9414,14 @@ class AdvancedMagnifyTool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .Annotati
|
|
|
9372
9414
|
this._dragDrawCallback = (evt) => {
|
|
9373
9415
|
this.isDrawing = true;
|
|
9374
9416
|
const eventDetail = evt.detail;
|
|
9417
|
+
const { element } = eventDetail;
|
|
9418
|
+
const { viewport } = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getEnabledElement)(element);
|
|
9375
9419
|
const { deltaPoints } = eventDetail;
|
|
9376
9420
|
const canvasDelta = deltaPoints?.canvas ?? [0, 0, 0];
|
|
9377
9421
|
const { annotation, viewportIdsToRender } = this.editData;
|
|
9378
9422
|
const { points } = annotation.data.handles;
|
|
9379
|
-
|
|
9380
|
-
|
|
9381
|
-
point[1] += canvasDelta[1];
|
|
9382
|
-
});
|
|
9423
|
+
const worldDelta = this._getWorldDeltaFromCanvasDelta(viewport, points, canvasDelta);
|
|
9424
|
+
this._applyWorldDelta(points, worldDelta);
|
|
9383
9425
|
annotation.invalidated = true;
|
|
9384
9426
|
this.editData.hasMoved = true;
|
|
9385
9427
|
(0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .A)(viewportIdsToRender);
|
|
@@ -9392,12 +9434,10 @@ class AdvancedMagnifyTool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .Annotati
|
|
|
9392
9434
|
const { data } = annotation;
|
|
9393
9435
|
if (handleIndex === undefined) {
|
|
9394
9436
|
const { deltaPoints } = eventDetail;
|
|
9395
|
-
const canvasDelta = deltaPoints.canvas;
|
|
9437
|
+
const canvasDelta = deltaPoints.canvas ?? [0, 0, 0];
|
|
9396
9438
|
const points = data.handles.points;
|
|
9397
|
-
|
|
9398
|
-
|
|
9399
|
-
point[1] += canvasDelta[1];
|
|
9400
|
-
});
|
|
9439
|
+
const worldDelta = this._getWorldDeltaFromCanvasDelta((0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getEnabledElement)(element).viewport, points, canvasDelta);
|
|
9440
|
+
this._applyWorldDelta(points, worldDelta);
|
|
9401
9441
|
annotation.invalidated = true;
|
|
9402
9442
|
}
|
|
9403
9443
|
else {
|
|
@@ -9408,18 +9448,12 @@ class AdvancedMagnifyTool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .Annotati
|
|
|
9408
9448
|
};
|
|
9409
9449
|
this._dragHandle = (evt) => {
|
|
9410
9450
|
const eventDetail = evt.detail;
|
|
9451
|
+
const { element } = eventDetail;
|
|
9452
|
+
const { viewport } = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getEnabledElement)(element);
|
|
9411
9453
|
const { annotation } = this.editData;
|
|
9412
9454
|
const { data } = annotation;
|
|
9413
9455
|
const { points } = data.handles;
|
|
9414
|
-
const
|
|
9415
|
-
const canvasTop = canvasCoordinates[0];
|
|
9416
|
-
const canvasBottom = canvasCoordinates[2];
|
|
9417
|
-
const canvasLeft = canvasCoordinates[3];
|
|
9418
|
-
const radius = Math.abs(canvasBottom[1] - canvasTop[1]) * 0.5;
|
|
9419
|
-
const canvasCenter = [
|
|
9420
|
-
canvasLeft[0] + radius,
|
|
9421
|
-
canvasTop[1] + radius,
|
|
9422
|
-
];
|
|
9456
|
+
const { center: canvasCenter } = this._getCanvasCircleData(viewport, points);
|
|
9423
9457
|
const { currentPoints } = eventDetail;
|
|
9424
9458
|
const currentCanvasPoints = currentPoints.canvas;
|
|
9425
9459
|
const newRadius = (0,_utilities_math_circle__WEBPACK_IMPORTED_MODULE_12__.getCanvasCircleRadius)([
|
|
@@ -9427,10 +9461,11 @@ class AdvancedMagnifyTool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .Annotati
|
|
|
9427
9461
|
currentCanvasPoints,
|
|
9428
9462
|
]);
|
|
9429
9463
|
const newCanvasHandlePoints = this._getCanvasHandlePoints(canvasCenter, newRadius);
|
|
9430
|
-
|
|
9431
|
-
points[
|
|
9432
|
-
points[
|
|
9433
|
-
points[
|
|
9464
|
+
const newWorldHandlePoints = newCanvasHandlePoints.map((handle) => viewport.canvasToWorld(handle));
|
|
9465
|
+
points[0] = newWorldHandlePoints[0];
|
|
9466
|
+
points[1] = newWorldHandlePoints[1];
|
|
9467
|
+
points[2] = newWorldHandlePoints[2];
|
|
9468
|
+
points[3] = newWorldHandlePoints[3];
|
|
9434
9469
|
};
|
|
9435
9470
|
this.cancel = (element) => {
|
|
9436
9471
|
if (!this.isDrawing) {
|
|
@@ -9492,19 +9527,11 @@ class AdvancedMagnifyTool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .Annotati
|
|
|
9492
9527
|
const { annotationUID, data } = annotation;
|
|
9493
9528
|
const { magnifyViewportId, zoomFactor, handles } = data;
|
|
9494
9529
|
const { points, activeHandleIndex } = handles;
|
|
9530
|
+
const { center, radius, canvasPoints } = this._getCanvasCircleData(viewport, points);
|
|
9495
9531
|
styleSpecifier.annotationUID = annotationUID;
|
|
9496
9532
|
const lineWidth = this.getStyle('lineWidth', styleSpecifier, annotation);
|
|
9497
9533
|
const lineDash = this.getStyle('lineDash', styleSpecifier, annotation);
|
|
9498
9534
|
const color = this.getStyle('color', styleSpecifier, annotation);
|
|
9499
|
-
const canvasCoordinates = points;
|
|
9500
|
-
const canvasTop = canvasCoordinates[0];
|
|
9501
|
-
const canvasBottom = canvasCoordinates[2];
|
|
9502
|
-
const canvasLeft = canvasCoordinates[3];
|
|
9503
|
-
const radius = Math.abs(canvasBottom[1] - canvasTop[1]) * 0.5;
|
|
9504
|
-
const center = [
|
|
9505
|
-
canvasLeft[0] + radius,
|
|
9506
|
-
canvasTop[1] + radius,
|
|
9507
|
-
];
|
|
9508
9535
|
if (!viewport.getRenderingEngine()) {
|
|
9509
9536
|
console.warn('Rendering Engine has been destroyed');
|
|
9510
9537
|
return renderStatus;
|
|
@@ -9516,7 +9543,10 @@ class AdvancedMagnifyTool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .Annotati
|
|
|
9516
9543
|
if (!(0,_stateManagement_annotation_annotationLocking__WEBPACK_IMPORTED_MODULE_3__.isAnnotationLocked)(annotationUID) &&
|
|
9517
9544
|
!this.editData &&
|
|
9518
9545
|
activeHandleIndex !== null) {
|
|
9519
|
-
|
|
9546
|
+
const activeHandle = canvasPoints[activeHandleIndex];
|
|
9547
|
+
activeHandleCanvasCoords = [
|
|
9548
|
+
[activeHandle[0], activeHandle[1], 0],
|
|
9549
|
+
];
|
|
9520
9550
|
}
|
|
9521
9551
|
if (activeHandleCanvasCoords) {
|
|
9522
9552
|
const handleGroupUID = '0';
|
|
@@ -9539,6 +9569,22 @@ class AdvancedMagnifyTool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .Annotati
|
|
|
9539
9569
|
}
|
|
9540
9570
|
return renderStatus;
|
|
9541
9571
|
};
|
|
9572
|
+
this._getWorldHandlePoints = (viewport, canvasCenterPos, canvasRadius) => {
|
|
9573
|
+
const canvasHandlePoints = this._getCanvasHandlePoints(canvasCenterPos, canvasRadius);
|
|
9574
|
+
return canvasHandlePoints.map((handlePoint) => viewport.canvasToWorld(handlePoint));
|
|
9575
|
+
};
|
|
9576
|
+
this._getCanvasCircleData = (viewport, points) => {
|
|
9577
|
+
const canvasPoints = points.map((point) => viewport.worldToCanvas(point));
|
|
9578
|
+
const canvasTop = canvasPoints[0];
|
|
9579
|
+
const canvasBottom = canvasPoints[2];
|
|
9580
|
+
const canvasLeft = canvasPoints[3];
|
|
9581
|
+
const radius = Math.abs(canvasBottom[1] - canvasTop[1]) * 0.5;
|
|
9582
|
+
const center = [
|
|
9583
|
+
canvasLeft[0] + radius,
|
|
9584
|
+
canvasTop[1] + radius,
|
|
9585
|
+
];
|
|
9586
|
+
return { canvasPoints, center, radius };
|
|
9587
|
+
};
|
|
9542
9588
|
this._getCanvasHandlePoints = (canvasCenterPos, canvasRadius) => {
|
|
9543
9589
|
return [
|
|
9544
9590
|
[canvasCenterPos[0], canvasCenterPos[1] - canvasRadius, 0],
|
|
@@ -9605,6 +9651,33 @@ class AdvancedMagnifyTool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .Annotati
|
|
|
9605
9651
|
});
|
|
9606
9652
|
return dropdown;
|
|
9607
9653
|
}
|
|
9654
|
+
_getWorldDeltaFromCanvasDelta(viewport, points, canvasDelta) {
|
|
9655
|
+
if (!canvasDelta) {
|
|
9656
|
+
return [0, 0, 0];
|
|
9657
|
+
}
|
|
9658
|
+
const referencePoint = points[0];
|
|
9659
|
+
const referenceCanvasPoint = viewport.worldToCanvas(referencePoint);
|
|
9660
|
+
const movedWorldPoint = viewport.canvasToWorld([
|
|
9661
|
+
referenceCanvasPoint[0] + canvasDelta[0],
|
|
9662
|
+
referenceCanvasPoint[1] + canvasDelta[1],
|
|
9663
|
+
]);
|
|
9664
|
+
return [
|
|
9665
|
+
movedWorldPoint[0] - referencePoint[0],
|
|
9666
|
+
movedWorldPoint[1] - referencePoint[1],
|
|
9667
|
+
movedWorldPoint[2] - referencePoint[2],
|
|
9668
|
+
];
|
|
9669
|
+
}
|
|
9670
|
+
_applyWorldDelta(points, worldDelta) {
|
|
9671
|
+
if (!worldDelta) {
|
|
9672
|
+
return;
|
|
9673
|
+
}
|
|
9674
|
+
for (let i = 0, len = points.length; i < len; i++) {
|
|
9675
|
+
const point = points[i];
|
|
9676
|
+
point[0] += worldDelta[0];
|
|
9677
|
+
point[1] += worldDelta[1];
|
|
9678
|
+
point[2] += worldDelta[2];
|
|
9679
|
+
}
|
|
9680
|
+
}
|
|
9608
9681
|
}
|
|
9609
9682
|
class AdvancedMagnifyViewportManager {
|
|
9610
9683
|
constructor() {
|
|
@@ -12514,6 +12587,9 @@ class PanTool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .BaseTool */ .oS {
|
|
|
12514
12587
|
supportedInteractionTypes: ['Mouse', 'Touch'],
|
|
12515
12588
|
configuration: {
|
|
12516
12589
|
limitToViewport: false,
|
|
12590
|
+
ignoreX: false,
|
|
12591
|
+
ignoreY: false,
|
|
12592
|
+
ignoreZ: false
|
|
12517
12593
|
},
|
|
12518
12594
|
}) {
|
|
12519
12595
|
super(toolProps, defaultToolProps);
|
|
@@ -12588,6 +12664,15 @@ class PanTool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .BaseTool */ .oS {
|
|
|
12588
12664
|
deltaPointsWorld[2] === 0) {
|
|
12589
12665
|
return;
|
|
12590
12666
|
}
|
|
12667
|
+
if (this.configuration.ignoreX) {
|
|
12668
|
+
deltaPointsWorld[0] = 0;
|
|
12669
|
+
}
|
|
12670
|
+
if (this.configuration.ignoreY) {
|
|
12671
|
+
deltaPointsWorld[1] = 0;
|
|
12672
|
+
}
|
|
12673
|
+
if (this.configuration.ignoreZ) {
|
|
12674
|
+
deltaPointsWorld[2] = 0;
|
|
12675
|
+
}
|
|
12591
12676
|
const viewport = enabledElement.viewport;
|
|
12592
12677
|
const camera = viewport.getCamera();
|
|
12593
12678
|
const { focalPoint, position } = camera;
|
|
@@ -13334,7 +13419,7 @@ class ScaleOverlayTool extends _base_AnnotationDisplayTool__WEBPACK_IMPORTED_MOD
|
|
|
13334
13419
|
let annotation = this.editData?.annotation;
|
|
13335
13420
|
const annotations = (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_3__.getAnnotations)(this.getToolName(), viewport.element);
|
|
13336
13421
|
if (annotations.length) {
|
|
13337
|
-
annotation = annotations.filter((thisAnnotation) => thisAnnotation.data
|
|
13422
|
+
annotation = annotations.filter((thisAnnotation) => thisAnnotation.data?.viewportId == viewport.id)[0];
|
|
13338
13423
|
}
|
|
13339
13424
|
enabledElements.forEach((element) => {
|
|
13340
13425
|
const { viewport } = element;
|
|
@@ -13580,10 +13665,10 @@ class ScaleOverlayTool extends _base_AnnotationDisplayTool__WEBPACK_IMPORTED_MOD
|
|
|
13580
13665
|
const location = this.configuration.scaleLocation;
|
|
13581
13666
|
const { viewport } = enabledElement;
|
|
13582
13667
|
const annotations = (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_3__.getAnnotations)(this.getToolName(), viewport.element);
|
|
13583
|
-
const annotation = annotations.filter((thisAnnotation) => thisAnnotation.data
|
|
13668
|
+
const annotation = annotations.filter((thisAnnotation) => thisAnnotation.data?.viewportId == viewport.id)[0];
|
|
13584
13669
|
const canvas = enabledElement.viewport.canvas;
|
|
13585
13670
|
const renderStatus = false;
|
|
13586
|
-
if (!viewport) {
|
|
13671
|
+
if (!viewport || !annotation) {
|
|
13587
13672
|
return renderStatus;
|
|
13588
13673
|
}
|
|
13589
13674
|
const styleSpecifier = {
|
|
@@ -13738,6 +13823,7 @@ class SculptorTool extends _base__WEBPACK_IMPORTED_MODULE_2__/* .BaseTool */ .oS
|
|
|
13738
13823
|
],
|
|
13739
13824
|
toolShape: 'circle',
|
|
13740
13825
|
referencedToolName: 'PlanarFreehandROI',
|
|
13826
|
+
updateCursorSize: 'dynamic',
|
|
13741
13827
|
},
|
|
13742
13828
|
}) {
|
|
13743
13829
|
super(toolProps, defaultToolProps);
|
|
@@ -14050,7 +14136,9 @@ class SculptorTool extends _base__WEBPACK_IMPORTED_MODULE_2__/* .BaseTool */ .oS
|
|
|
14050
14136
|
else {
|
|
14051
14137
|
const cursorShape = this.registeredShapes.get(this.selectedShape);
|
|
14052
14138
|
const canvasCoords = eventData.currentPoints.canvas;
|
|
14053
|
-
|
|
14139
|
+
if (this.configuration.updateCursorSize === 'dynamic') {
|
|
14140
|
+
cursorShape.updateToolSize(canvasCoords, viewport, activeAnnotation);
|
|
14141
|
+
}
|
|
14054
14142
|
}
|
|
14055
14143
|
(0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_6__/* .triggerAnnotationRenderForViewportIds */ .t)(this.commonData.viewportIdsToRender);
|
|
14056
14144
|
}
|
|
@@ -19908,7 +19996,6 @@ class CircleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool
|
|
|
19908
19996
|
if (!annotations?.length) {
|
|
19909
19997
|
return renderStatus;
|
|
19910
19998
|
}
|
|
19911
|
-
const targetId = this.getTargetId(viewport);
|
|
19912
19999
|
const renderingEngine = viewport.getRenderingEngine();
|
|
19913
20000
|
const styleSpecifier = {
|
|
19914
20001
|
toolGroupId: this.toolGroupId,
|
|
@@ -19920,6 +20007,7 @@ class CircleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool
|
|
|
19920
20007
|
const { annotationUID, data } = annotation;
|
|
19921
20008
|
const { handles } = data;
|
|
19922
20009
|
const { points, activeHandleIndex } = handles;
|
|
20010
|
+
const targetId = this.getTargetId(viewport, data);
|
|
19923
20011
|
styleSpecifier.annotationUID = annotationUID;
|
|
19924
20012
|
const { color, lineWidth, lineDash } = this.getAnnotationStyle({
|
|
19925
20013
|
annotation,
|
|
@@ -20069,12 +20157,14 @@ class CircleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool
|
|
|
20069
20157
|
const targetId = targetIds[i];
|
|
20070
20158
|
const image = this.getTargetImageData(targetId);
|
|
20071
20159
|
if (!image) {
|
|
20160
|
+
console.warn('image not found for stats:', targetId);
|
|
20161
|
+
delete cachedStats[targetId];
|
|
20072
20162
|
continue;
|
|
20073
20163
|
}
|
|
20074
20164
|
const { dimensions, imageData, metadata, voxelManager } = image;
|
|
20075
20165
|
const handles = points.map((point) => imageData.worldToIndex(point));
|
|
20076
20166
|
const calibrate = (0,_utilities_getCalibratedUnits__WEBPACK_IMPORTED_MODULE_3__/* .getCalibratedLengthUnitsAndScale */ .Op)(image, handles);
|
|
20077
|
-
const radius = CircleROITool.calculateLengthInIndex(calibrate, handles);
|
|
20167
|
+
const radius = CircleROITool.calculateLengthInIndex(calibrate, handles.slice(0, 2));
|
|
20078
20168
|
const area = Math.PI * radius * radius;
|
|
20079
20169
|
const perimeter = 2 * Math.PI * radius;
|
|
20080
20170
|
const isEmptyArea = radius === 0;
|
|
@@ -20570,7 +20660,6 @@ class CobbAngleTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool
|
|
|
20570
20660
|
if (!annotations?.length) {
|
|
20571
20661
|
return renderStatus;
|
|
20572
20662
|
}
|
|
20573
|
-
const targetId = this.getTargetId(viewport);
|
|
20574
20663
|
const renderingEngine = viewport.getRenderingEngine();
|
|
20575
20664
|
const styleSpecifier = {
|
|
20576
20665
|
toolGroupId: this.toolGroupId,
|
|
@@ -20581,6 +20670,7 @@ class CobbAngleTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool
|
|
|
20581
20670
|
const annotation = annotations[i];
|
|
20582
20671
|
const { annotationUID, data } = annotation;
|
|
20583
20672
|
const { points, activeHandleIndex } = data.handles;
|
|
20673
|
+
const targetId = this.getTargetId(viewport, data);
|
|
20584
20674
|
styleSpecifier.annotationUID = annotationUID;
|
|
20585
20675
|
const { color, lineWidth, lineDash } = this.getAnnotationStyle({
|
|
20586
20676
|
annotation,
|
|
@@ -21043,7 +21133,6 @@ class DragProbeTool extends _ProbeTool__WEBPACK_IMPORTED_MODULE_5__/* ["default"
|
|
|
21043
21133
|
if (!annotations?.length) {
|
|
21044
21134
|
return renderStatus;
|
|
21045
21135
|
}
|
|
21046
|
-
const targetId = this.getTargetId(viewport);
|
|
21047
21136
|
const renderingEngine = viewport.getRenderingEngine();
|
|
21048
21137
|
const styleSpecifier = {
|
|
21049
21138
|
toolGroupId: this.toolGroupId,
|
|
@@ -21055,6 +21144,7 @@ class DragProbeTool extends _ProbeTool__WEBPACK_IMPORTED_MODULE_5__/* ["default"
|
|
|
21055
21144
|
const data = annotation.data;
|
|
21056
21145
|
const point = data.handles.points[0];
|
|
21057
21146
|
const canvasCoordinates = viewport.worldToCanvas(point);
|
|
21147
|
+
const targetId = this.getTargetId(viewport, data);
|
|
21058
21148
|
styleSpecifier.annotationUID = annotationUID;
|
|
21059
21149
|
const { color } = this.getAnnotationStyle({
|
|
21060
21150
|
annotation,
|
|
@@ -21897,7 +21987,6 @@ class EllipticalROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .Annotation
|
|
|
21897
21987
|
if (!annotations?.length) {
|
|
21898
21988
|
return renderStatus;
|
|
21899
21989
|
}
|
|
21900
|
-
const targetId = this.getTargetId(viewport);
|
|
21901
21990
|
const renderingEngine = viewport.getRenderingEngine();
|
|
21902
21991
|
const styleSpecifier = {
|
|
21903
21992
|
toolGroupId: this.toolGroupId,
|
|
@@ -21909,6 +21998,7 @@ class EllipticalROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .Annotation
|
|
|
21909
21998
|
const { annotationUID, data } = annotation;
|
|
21910
21999
|
const { handles } = data;
|
|
21911
22000
|
const { points, activeHandleIndex } = handles;
|
|
22001
|
+
const targetId = this.getTargetId(viewport, data);
|
|
21912
22002
|
styleSpecifier.annotationUID = annotationUID;
|
|
21913
22003
|
const { color, lineWidth, lineDash } = this.getAnnotationStyle({
|
|
21914
22004
|
annotation,
|
|
@@ -23810,7 +23900,7 @@ class LivewireContourSegmentationTool extends _LivewireContourTool__WEBPACK_IMPO
|
|
|
23810
23900
|
});
|
|
23811
23901
|
}
|
|
23812
23902
|
const acceptedPath = new _utilities_livewire_LiveWirePath__WEBPACK_IMPORTED_MODULE_2__/* .LivewirePath */ .j();
|
|
23813
|
-
for (let i = 0; i < count; i++) {
|
|
23903
|
+
for (let i = 0; i < count - 1; i++) {
|
|
23814
23904
|
scissors.startSearch(worldToSlice(points[i]));
|
|
23815
23905
|
const path = scissors.findPathToPoint(worldToSlice(points[(i + 1) % count]));
|
|
23816
23906
|
acceptedPath.addPoints(path);
|
|
@@ -23963,8 +24053,6 @@ class LivewireContourTool extends _base_ContourSegmentationBaseTool__WEBPACK_IMP
|
|
|
23963
24053
|
viewportIdsToRender,
|
|
23964
24054
|
movingTextBox: false,
|
|
23965
24055
|
};
|
|
23966
|
-
const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getEnabledElement)(element);
|
|
23967
|
-
const { renderingEngine } = enabledElement;
|
|
23968
24056
|
this._activateModify(element);
|
|
23969
24057
|
(0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .A)(viewportIdsToRender);
|
|
23970
24058
|
evt.preventDefault();
|
|
@@ -23991,8 +24079,6 @@ class LivewireContourTool extends _base_ContourSegmentationBaseTool__WEBPACK_IMP
|
|
|
23991
24079
|
movingTextBox,
|
|
23992
24080
|
};
|
|
23993
24081
|
this._activateModify(element);
|
|
23994
|
-
const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getEnabledElement)(element);
|
|
23995
|
-
const { renderingEngine } = enabledElement;
|
|
23996
24082
|
(0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .A)(viewportIdsToRender);
|
|
23997
24083
|
evt.preventDefault();
|
|
23998
24084
|
};
|
|
@@ -24041,7 +24127,7 @@ class LivewireContourTool extends _base_ContourSegmentationBaseTool__WEBPACK_IMP
|
|
|
24041
24127
|
const { canvas: canvasPos, world: worldPosOriginal } = currentPoints;
|
|
24042
24128
|
let worldPos = worldPosOriginal;
|
|
24043
24129
|
const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getEnabledElement)(element);
|
|
24044
|
-
const { viewport
|
|
24130
|
+
const { viewport } = enabledElement;
|
|
24045
24131
|
const controlPoints = this.editData.currentPath.getControlPoints();
|
|
24046
24132
|
let closePath = controlPoints.length >= 2 && doubleClick;
|
|
24047
24133
|
this.doneEditMemo();
|
|
@@ -24087,6 +24173,9 @@ class LivewireContourTool extends _base_ContourSegmentationBaseTool__WEBPACK_IMP
|
|
|
24087
24173
|
annotation.invalidated = true;
|
|
24088
24174
|
(0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .A)(viewportIdsToRender);
|
|
24089
24175
|
if (this.editData.closed) {
|
|
24176
|
+
if (closePath) {
|
|
24177
|
+
annotation.data.isOpenUShapeContour = 'lineSegment';
|
|
24178
|
+
}
|
|
24090
24179
|
this.updateAnnotation(this.editData.confirmedPath);
|
|
24091
24180
|
this._endCallback(evt);
|
|
24092
24181
|
}
|
|
@@ -24095,7 +24184,6 @@ class LivewireContourTool extends _base_ContourSegmentationBaseTool__WEBPACK_IMP
|
|
|
24095
24184
|
this._mouseMoveCallback = (evt) => {
|
|
24096
24185
|
const { element, currentPoints } = evt.detail;
|
|
24097
24186
|
const { world: worldPos, canvas: canvasPos } = currentPoints;
|
|
24098
|
-
const { renderingEngine } = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getEnabledElement)(element);
|
|
24099
24187
|
const viewportIdsToRender = (0,_utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_14__.getViewportIdsWithToolToRender)(element, this.getToolName());
|
|
24100
24188
|
this.editData.lastCanvasPoint = canvasPos;
|
|
24101
24189
|
const { width: imgWidth, height: imgHeight } = this.scissors;
|
|
@@ -24141,8 +24229,6 @@ class LivewireContourTool extends _base_ContourSegmentationBaseTool__WEBPACK_IMP
|
|
|
24141
24229
|
this.editHandle(worldPos, element, annotation, handleIndex);
|
|
24142
24230
|
}
|
|
24143
24231
|
this.editData.hasMoved = true;
|
|
24144
|
-
const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getEnabledElement)(element);
|
|
24145
|
-
const { renderingEngine } = enabledElement;
|
|
24146
24232
|
(0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .A)(viewportIdsToRender);
|
|
24147
24233
|
};
|
|
24148
24234
|
this.cancel = (element) => {
|
|
@@ -24202,7 +24288,7 @@ class LivewireContourTool extends _base_ContourSegmentationBaseTool__WEBPACK_IMP
|
|
|
24202
24288
|
return;
|
|
24203
24289
|
}
|
|
24204
24290
|
const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getEnabledElement)(element);
|
|
24205
|
-
const { viewport
|
|
24291
|
+
const { viewport } = enabledElement;
|
|
24206
24292
|
const { cachedStats } = data;
|
|
24207
24293
|
const { polyline: points } = data.contour;
|
|
24208
24294
|
const targetIds = Object.keys(cachedStats);
|
|
@@ -24712,7 +24798,6 @@ class ProbeTool extends _base__WEBPACK_IMPORTED_MODULE_2__/* .AnnotationTool */
|
|
|
24712
24798
|
if (!annotations?.length) {
|
|
24713
24799
|
return renderStatus;
|
|
24714
24800
|
}
|
|
24715
|
-
const targetId = this.getTargetId(viewport);
|
|
24716
24801
|
const renderingEngine = viewport.getRenderingEngine();
|
|
24717
24802
|
const styleSpecifier = {
|
|
24718
24803
|
toolGroupId: this.toolGroupId,
|
|
@@ -24725,6 +24810,7 @@ class ProbeTool extends _base__WEBPACK_IMPORTED_MODULE_2__/* .AnnotationTool */
|
|
|
24725
24810
|
const data = annotation.data;
|
|
24726
24811
|
const point = data.handles.points[0];
|
|
24727
24812
|
const canvasCoordinates = viewport.worldToCanvas(point);
|
|
24813
|
+
const targetId = this.getTargetId(viewport, data);
|
|
24728
24814
|
styleSpecifier.annotationUID = annotationUID;
|
|
24729
24815
|
const { color, lineWidth } = this.getAnnotationStyle({
|
|
24730
24816
|
annotation,
|
|
@@ -25167,6 +25253,17 @@ class RegionSegmentTool extends _base_GrowCutBaseTool__WEBPACK_IMPORTED_MODULE_7
|
|
|
25167
25253
|
}
|
|
25168
25254
|
async getGrowCutLabelmap(growCutData) {
|
|
25169
25255
|
const { segmentation: { referencedVolumeId }, renderingEngineId, viewportId, circleCenterPoint, circleBorderPoint, options, } = growCutData;
|
|
25256
|
+
const { positiveSeedVariance, negativeSeedVariance, positiveStdDevMultiplier, } = this.configuration;
|
|
25257
|
+
const baseStdDevMultiplier = positiveStdDevMultiplier ?? 1;
|
|
25258
|
+
const currentStdDevMultiplier = options?.positiveStdDevMultiplier
|
|
25259
|
+
? Math.max(options.positiveStdDevMultiplier, 0.01)
|
|
25260
|
+
: baseStdDevMultiplier;
|
|
25261
|
+
const varianceScale = currentStdDevMultiplier / baseStdDevMultiplier;
|
|
25262
|
+
const growCutOptions = {
|
|
25263
|
+
...options,
|
|
25264
|
+
positiveSeedVariance: Math.max(0.01, (positiveSeedVariance ?? 1) * varianceScale),
|
|
25265
|
+
negativeSeedVariance: Math.max(0.01, (negativeSeedVariance ?? 1) * varianceScale),
|
|
25266
|
+
};
|
|
25170
25267
|
const renderingEngine = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getRenderingEngine)(renderingEngineId);
|
|
25171
25268
|
const viewport = renderingEngine.getViewport(viewportId);
|
|
25172
25269
|
const worldCircleRadius = gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.len */ .eR.len(gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.sub */ .eR.sub(gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.create */ .eR.create(), circleCenterPoint, circleBorderPoint));
|
|
@@ -25174,7 +25271,7 @@ class RegionSegmentTool extends _base_GrowCutBaseTool__WEBPACK_IMPORTED_MODULE_7
|
|
|
25174
25271
|
center: circleCenterPoint,
|
|
25175
25272
|
radius: worldCircleRadius,
|
|
25176
25273
|
};
|
|
25177
|
-
return _utilities_segmentation__WEBPACK_IMPORTED_MODULE_6__.growCut.runGrowCutForSphere(referencedVolumeId, sphereInfo, viewport,
|
|
25274
|
+
return _utilities_segmentation__WEBPACK_IMPORTED_MODULE_6__.growCut.runGrowCutForSphere(referencedVolumeId, sphereInfo, viewport, growCutOptions);
|
|
25178
25275
|
}
|
|
25179
25276
|
_activateDraw(element) {
|
|
25180
25277
|
element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_4__.Events.MOUSE_UP, this._endCallback);
|
|
@@ -29587,6 +29684,9 @@ AnnotationDisplayTool.toolName = 'AnnotationDisplayTool';
|
|
|
29587
29684
|
|
|
29588
29685
|
const { DefaultHistoryMemo } = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.utilities.HistoryMemo;
|
|
29589
29686
|
class BaseTool {
|
|
29687
|
+
get configurationTyped() {
|
|
29688
|
+
return this.configuration;
|
|
29689
|
+
}
|
|
29590
29690
|
static { this.defaults = {
|
|
29591
29691
|
configuration: {
|
|
29592
29692
|
strategies: {},
|
|
@@ -29596,6 +29696,7 @@ class BaseTool {
|
|
|
29596
29696
|
},
|
|
29597
29697
|
}; }
|
|
29598
29698
|
constructor(toolProps, defaultToolProps) {
|
|
29699
|
+
this.isPrimary = false;
|
|
29599
29700
|
const mergedDefaults = BaseTool.mergeDefaultProps(BaseTool.defaults, defaultToolProps);
|
|
29600
29701
|
const initialProps = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.utilities.deepMerge(mergedDefaults, toolProps);
|
|
29601
29702
|
const { configuration = {}, supportedInteractionTypes, toolGroupId, } = initialProps;
|
|
@@ -29610,6 +29711,11 @@ class BaseTool {
|
|
|
29610
29711
|
}
|
|
29611
29712
|
return _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.utilities.deepMerge(defaultProps, additionalProps);
|
|
29612
29713
|
}
|
|
29714
|
+
static isSpecifiedTargetId(desiredVolumeId) {
|
|
29715
|
+
return (_viewport, { targetId }) => {
|
|
29716
|
+
return targetId.includes(desiredVolumeId);
|
|
29717
|
+
};
|
|
29718
|
+
}
|
|
29613
29719
|
get toolName() {
|
|
29614
29720
|
return this.getToolName();
|
|
29615
29721
|
}
|
|
@@ -29669,10 +29775,18 @@ class BaseTool {
|
|
|
29669
29775
|
throw new Error('getTargetIdImage: targetId must start with "imageId:" or "volumeId:"');
|
|
29670
29776
|
}
|
|
29671
29777
|
}
|
|
29672
|
-
getTargetId(viewport) {
|
|
29673
|
-
const
|
|
29674
|
-
if (
|
|
29675
|
-
|
|
29778
|
+
getTargetId(viewport, data) {
|
|
29779
|
+
const { isPreferredTargetId } = this.configurationTyped;
|
|
29780
|
+
if (isPreferredTargetId && data?.cachedStats) {
|
|
29781
|
+
for (const [targetId, cachedStat] of Object.entries(data.cachedStats)) {
|
|
29782
|
+
if (isPreferredTargetId(viewport, { targetId, cachedStat })) {
|
|
29783
|
+
return targetId;
|
|
29784
|
+
}
|
|
29785
|
+
}
|
|
29786
|
+
}
|
|
29787
|
+
const defaultTargetId = viewport.getViewReferenceId?.();
|
|
29788
|
+
if (defaultTargetId) {
|
|
29789
|
+
return defaultTargetId;
|
|
29676
29790
|
}
|
|
29677
29791
|
throw new Error('getTargetId: viewport must have a getViewReferenceId method');
|
|
29678
29792
|
}
|
|
@@ -29820,7 +29934,12 @@ async function render(viewport, contourRepresentation) {
|
|
|
29820
29934
|
(0,_config__WEBPACK_IMPORTED_MODULE_5__/* .getPolySeg */ .Qy)()?.canComputeRequestedRepresentation(segmentationId, _enums_SegmentationRepresentations__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.Contour) &&
|
|
29821
29935
|
!polySegConversionInProgressForViewportId.get(viewport.id)) {
|
|
29822
29936
|
polySegConversionInProgressForViewportId.set(viewport.id, true);
|
|
29823
|
-
|
|
29937
|
+
try {
|
|
29938
|
+
contourData = await (0,_utilities_segmentation_computeAndAddRepresentation__WEBPACK_IMPORTED_MODULE_6__/* .computeAndAddRepresentation */ .d)(segmentationId, _enums_SegmentationRepresentations__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.Contour, () => polySeg.computeContourData(segmentationId, { viewport }));
|
|
29939
|
+
}
|
|
29940
|
+
catch (error) {
|
|
29941
|
+
console.warn('Unable to compute contour data for segmentationId', segmentationId, error);
|
|
29942
|
+
}
|
|
29824
29943
|
polySegConversionInProgressForViewportId.set(viewport.id, false);
|
|
29825
29944
|
}
|
|
29826
29945
|
else if (!contourData && !(0,_config__WEBPACK_IMPORTED_MODULE_5__/* .getPolySeg */ .Qy)()) {
|
|
@@ -30563,12 +30682,10 @@ function getUpdateFunction(viewport) {
|
|
|
30563
30682
|
/* harmony import */ var _strategies_eraseSphere__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1989);
|
|
30564
30683
|
/* harmony import */ var _strategies_fillCircle__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(56789);
|
|
30565
30684
|
/* harmony import */ var _strategies_eraseCircle__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(33852);
|
|
30566
|
-
/* harmony import */ var
|
|
30567
|
-
/* harmony import */ var
|
|
30568
|
-
/* harmony import */ var
|
|
30569
|
-
/* harmony import */ var
|
|
30570
|
-
/* harmony import */ var _strategies_utils_getStrategyData__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(40905);
|
|
30571
|
-
|
|
30685
|
+
/* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(7001);
|
|
30686
|
+
/* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(58640);
|
|
30687
|
+
/* harmony import */ var _LabelmapBaseTool__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(23631);
|
|
30688
|
+
/* harmony import */ var _strategies_utils_getStrategyData__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(40905);
|
|
30572
30689
|
|
|
30573
30690
|
|
|
30574
30691
|
|
|
@@ -30580,7 +30697,7 @@ function getUpdateFunction(viewport) {
|
|
|
30580
30697
|
|
|
30581
30698
|
|
|
30582
30699
|
|
|
30583
|
-
class BrushTool extends
|
|
30700
|
+
class BrushTool extends _LabelmapBaseTool__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .A {
|
|
30584
30701
|
constructor(toolProps = {}, defaultToolProps = {
|
|
30585
30702
|
supportedInteractionTypes: ['Mouse', 'Touch'],
|
|
30586
30703
|
configuration: {
|
|
@@ -30667,7 +30784,7 @@ class BrushTool extends _LabelmapBaseTool__WEBPACK_IMPORTED_MODULE_10__/* ["defa
|
|
|
30667
30784
|
const { viewport } = enabledElement;
|
|
30668
30785
|
this._editData = this.createEditData(element);
|
|
30669
30786
|
this._activateDraw(element);
|
|
30670
|
-
(0,
|
|
30787
|
+
(0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_7__.hideElementCursor)(element);
|
|
30671
30788
|
evt.preventDefault();
|
|
30672
30789
|
this._previewData.isDrag = false;
|
|
30673
30790
|
this._previewData.timerStart = Date.now();
|
|
@@ -30681,7 +30798,7 @@ class BrushTool extends _LabelmapBaseTool__WEBPACK_IMPORTED_MODULE_10__/* ["defa
|
|
|
30681
30798
|
world: gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec3.clone */ .eR.clone(worldPoint),
|
|
30682
30799
|
};
|
|
30683
30800
|
const hoverData = this._hoverData || this.createHoverData(element);
|
|
30684
|
-
(0,
|
|
30801
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .A)(hoverData.viewportIdsToRender);
|
|
30685
30802
|
const operationData = this.getOperationData(element);
|
|
30686
30803
|
if (!operationData) {
|
|
30687
30804
|
return false;
|
|
@@ -30690,6 +30807,9 @@ class BrushTool extends _LabelmapBaseTool__WEBPACK_IMPORTED_MODULE_10__/* ["defa
|
|
|
30690
30807
|
return true;
|
|
30691
30808
|
};
|
|
30692
30809
|
this.mouseMoveCallback = (evt) => {
|
|
30810
|
+
if (!this.isPrimary) {
|
|
30811
|
+
return;
|
|
30812
|
+
}
|
|
30693
30813
|
if (this.mode === _enums__WEBPACK_IMPORTED_MODULE_2__.ToolModes.Active) {
|
|
30694
30814
|
this.updateCursor(evt);
|
|
30695
30815
|
if (!this.configuration.preview.enabled) {
|
|
@@ -30738,7 +30858,7 @@ class BrushTool extends _LabelmapBaseTool__WEBPACK_IMPORTED_MODULE_10__/* ["defa
|
|
|
30738
30858
|
}
|
|
30739
30859
|
const { viewport } = enabledElement;
|
|
30740
30860
|
const activeStrategy = this.configuration.activeStrategy;
|
|
30741
|
-
const strategyData = (0,
|
|
30861
|
+
const strategyData = (0,_strategies_utils_getStrategyData__WEBPACK_IMPORTED_MODULE_10__/* .getStrategyData */ .S)({
|
|
30742
30862
|
operationData,
|
|
30743
30863
|
viewport,
|
|
30744
30864
|
strategy: activeStrategy,
|
|
@@ -30760,7 +30880,7 @@ class BrushTool extends _LabelmapBaseTool__WEBPACK_IMPORTED_MODULE_10__/* ["defa
|
|
|
30760
30880
|
const { viewport } = enabledElement;
|
|
30761
30881
|
this.updateCursor(evt);
|
|
30762
30882
|
const { viewportIdsToRender } = this._hoverData;
|
|
30763
|
-
(0,
|
|
30883
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .A)(viewportIdsToRender);
|
|
30764
30884
|
const delta = gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec2.distance */ .Zc.distance(currentPoints.canvas, this._previewData.startPoint);
|
|
30765
30885
|
const { dragTimeMs, dragMoveDistance } = this.configuration.preview;
|
|
30766
30886
|
if (!this._previewData.isDrag &&
|
|
@@ -30822,7 +30942,7 @@ class BrushTool extends _LabelmapBaseTool__WEBPACK_IMPORTED_MODULE_10__/* ["defa
|
|
|
30822
30942
|
}
|
|
30823
30943
|
this.doneEditMemo();
|
|
30824
30944
|
this._deactivateDraw(element);
|
|
30825
|
-
(0,
|
|
30945
|
+
(0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_7__.resetElementCursor)(element);
|
|
30826
30946
|
this.updateCursor(evt);
|
|
30827
30947
|
this._editData = null;
|
|
30828
30948
|
this._lastDragInfo = null;
|
|
@@ -30856,55 +30976,12 @@ class BrushTool extends _LabelmapBaseTool__WEBPACK_IMPORTED_MODULE_10__/* ["defa
|
|
|
30856
30976
|
if (!this._hoverData) {
|
|
30857
30977
|
return;
|
|
30858
30978
|
}
|
|
30859
|
-
|
|
30979
|
+
BrushTool.activeCursorTool = this;
|
|
30980
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .A)(this._hoverData.viewportIdsToRender);
|
|
30860
30981
|
}
|
|
30861
30982
|
_calculateCursor(element, centerCanvas) {
|
|
30862
30983
|
const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.getEnabledElement)(element);
|
|
30863
|
-
|
|
30864
|
-
const { canvasToWorld } = viewport;
|
|
30865
|
-
const camera = viewport.getCamera();
|
|
30866
|
-
const { brushSize } = this.configuration;
|
|
30867
|
-
const viewUp = gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec3.fromValues */ .eR.fromValues(camera.viewUp[0], camera.viewUp[1], camera.viewUp[2]);
|
|
30868
|
-
const viewPlaneNormal = gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec3.fromValues */ .eR.fromValues(camera.viewPlaneNormal[0], camera.viewPlaneNormal[1], camera.viewPlaneNormal[2]);
|
|
30869
|
-
const viewRight = gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec3.create */ .eR.create();
|
|
30870
|
-
gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec3.cross */ .eR.cross(viewRight, viewUp, viewPlaneNormal);
|
|
30871
|
-
const centerCursorInWorld = canvasToWorld([
|
|
30872
|
-
centerCanvas[0],
|
|
30873
|
-
centerCanvas[1],
|
|
30874
|
-
]);
|
|
30875
|
-
const bottomCursorInWorld = gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec3.create */ .eR.create();
|
|
30876
|
-
const topCursorInWorld = gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec3.create */ .eR.create();
|
|
30877
|
-
const leftCursorInWorld = gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec3.create */ .eR.create();
|
|
30878
|
-
const rightCursorInWorld = gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec3.create */ .eR.create();
|
|
30879
|
-
for (let i = 0; i <= 2; i++) {
|
|
30880
|
-
bottomCursorInWorld[i] = centerCursorInWorld[i] - viewUp[i] * brushSize;
|
|
30881
|
-
topCursorInWorld[i] = centerCursorInWorld[i] + viewUp[i] * brushSize;
|
|
30882
|
-
leftCursorInWorld[i] = centerCursorInWorld[i] - viewRight[i] * brushSize;
|
|
30883
|
-
rightCursorInWorld[i] = centerCursorInWorld[i] + viewRight[i] * brushSize;
|
|
30884
|
-
}
|
|
30885
|
-
if (!this._hoverData) {
|
|
30886
|
-
return;
|
|
30887
|
-
}
|
|
30888
|
-
const { brushCursor } = this._hoverData;
|
|
30889
|
-
const { data } = brushCursor;
|
|
30890
|
-
if (data.handles === undefined) {
|
|
30891
|
-
data.handles = {};
|
|
30892
|
-
}
|
|
30893
|
-
data.handles.points = [
|
|
30894
|
-
bottomCursorInWorld,
|
|
30895
|
-
topCursorInWorld,
|
|
30896
|
-
leftCursorInWorld,
|
|
30897
|
-
rightCursorInWorld,
|
|
30898
|
-
];
|
|
30899
|
-
const activeStrategy = this.configuration.activeStrategy;
|
|
30900
|
-
const strategy = this.configuration.strategies[activeStrategy];
|
|
30901
|
-
if (typeof strategy?.computeInnerCircleRadius === 'function') {
|
|
30902
|
-
strategy.computeInnerCircleRadius({
|
|
30903
|
-
configuration: this.configuration,
|
|
30904
|
-
viewport,
|
|
30905
|
-
});
|
|
30906
|
-
}
|
|
30907
|
-
data.invalidated = false;
|
|
30984
|
+
this.applyActiveStrategyCallback(enabledElement, this.getOperationData(element), _enums__WEBPACK_IMPORTED_MODULE_2__.StrategyCallbacks.CalculateCursorGeometry);
|
|
30908
30985
|
}
|
|
30909
30986
|
getStatistics(element, segmentIndices) {
|
|
30910
30987
|
if (!element) {
|
|
@@ -30952,7 +31029,7 @@ class BrushTool extends _LabelmapBaseTool__WEBPACK_IMPORTED_MODULE_10__/* ["defa
|
|
|
30952
31029
|
this._hoverData.brushCursor.metadata.segmentColor = segmentColor;
|
|
30953
31030
|
}
|
|
30954
31031
|
renderAnnotation(enabledElement, svgDrawingHelper) {
|
|
30955
|
-
if (!this._hoverData) {
|
|
31032
|
+
if (!this._hoverData || BrushTool.activeCursorTool !== this) {
|
|
30956
31033
|
return;
|
|
30957
31034
|
}
|
|
30958
31035
|
const { viewport } = enabledElement;
|
|
@@ -30966,40 +31043,7 @@ class BrushTool extends _LabelmapBaseTool__WEBPACK_IMPORTED_MODULE_10__/* ["defa
|
|
|
30966
31043
|
const { element } = viewport;
|
|
30967
31044
|
this._calculateCursor(element, centerCanvas);
|
|
30968
31045
|
}
|
|
30969
|
-
|
|
30970
|
-
if (!toolMetadata) {
|
|
30971
|
-
return;
|
|
30972
|
-
}
|
|
30973
|
-
const annotationUID = toolMetadata.brushCursorUID;
|
|
30974
|
-
const data = brushCursor.data;
|
|
30975
|
-
const { points } = data.handles;
|
|
30976
|
-
const canvasCoordinates = points.map((p) => viewport.worldToCanvas(p));
|
|
30977
|
-
const bottom = canvasCoordinates[0];
|
|
30978
|
-
const top = canvasCoordinates[1];
|
|
30979
|
-
const center = [
|
|
30980
|
-
Math.floor((bottom[0] + top[0]) / 2),
|
|
30981
|
-
Math.floor((bottom[1] + top[1]) / 2),
|
|
30982
|
-
];
|
|
30983
|
-
const radius = Math.abs(bottom[1] - Math.floor((bottom[1] + top[1]) / 2));
|
|
30984
|
-
const color = `rgb(${toolMetadata.segmentColor?.slice(0, 3) || [0, 0, 0]})`;
|
|
30985
|
-
if (!viewport.getRenderingEngine()) {
|
|
30986
|
-
console.warn('Rendering Engine has been destroyed');
|
|
30987
|
-
return;
|
|
30988
|
-
}
|
|
30989
|
-
const circleUID = '0';
|
|
30990
|
-
(0,_drawingSvg__WEBPACK_IMPORTED_MODULE_7__.drawCircle)(svgDrawingHelper, annotationUID, circleUID, center, radius, {
|
|
30991
|
-
color,
|
|
30992
|
-
lineDash: this.centerSegmentIndexInfo.segmentIndex === 0 ? [1, 2] : null,
|
|
30993
|
-
});
|
|
30994
|
-
const { dynamicRadiusInCanvas } = this.configuration?.threshold || {
|
|
30995
|
-
dynamicRadiusInCanvas: 0,
|
|
30996
|
-
};
|
|
30997
|
-
if (dynamicRadiusInCanvas) {
|
|
30998
|
-
const circleUID1 = '1';
|
|
30999
|
-
(0,_drawingSvg__WEBPACK_IMPORTED_MODULE_7__.drawCircle)(svgDrawingHelper, annotationUID, circleUID1, center, dynamicRadiusInCanvas, {
|
|
31000
|
-
color,
|
|
31001
|
-
});
|
|
31002
|
-
}
|
|
31046
|
+
this.applyActiveStrategyCallback(enabledElement, this.getOperationData(viewport.element), _enums__WEBPACK_IMPORTED_MODULE_2__.StrategyCallbacks.RenderCursor, svgDrawingHelper);
|
|
31003
31047
|
}
|
|
31004
31048
|
}
|
|
31005
31049
|
BrushTool.toolName = 'Brush';
|
|
@@ -34022,7 +34066,7 @@ SphereScissorsTool.toolName = 'SphereScissor';
|
|
|
34022
34066
|
/* harmony import */ var _utilities_boundingBox__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(72282);
|
|
34023
34067
|
/* harmony import */ var _BrushStrategy__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(55887);
|
|
34024
34068
|
/* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29857);
|
|
34025
|
-
/* harmony import */ var _compositions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(
|
|
34069
|
+
/* harmony import */ var _compositions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(64664);
|
|
34026
34070
|
/* harmony import */ var _utilities_math_sphere__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(62783);
|
|
34027
34071
|
|
|
34028
34072
|
|
|
@@ -34250,7 +34294,7 @@ function fillOutsideCircle() {
|
|
|
34250
34294
|
/* harmony import */ var _utilities_boundingBox__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(72282);
|
|
34251
34295
|
/* harmony import */ var _BrushStrategy__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(55887);
|
|
34252
34296
|
/* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29857);
|
|
34253
|
-
/* harmony import */ var _compositions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(
|
|
34297
|
+
/* harmony import */ var _compositions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(64664);
|
|
34254
34298
|
|
|
34255
34299
|
|
|
34256
34300
|
|
|
@@ -38140,7 +38184,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
38140
38184
|
/* harmony export */ getCalibratedLengthUnitsAndScale: () => (/* reexport safe */ _getCalibratedUnits__WEBPACK_IMPORTED_MODULE_6__.Op),
|
|
38141
38185
|
/* harmony export */ getCalibratedProbeUnitsAndValue: () => (/* reexport safe */ _getCalibratedUnits__WEBPACK_IMPORTED_MODULE_6__.Xw),
|
|
38142
38186
|
/* harmony export */ getClosestImageIdForStackViewport: () => (/* reexport safe */ _annotationHydration__WEBPACK_IMPORTED_MODULE_14__.x),
|
|
38143
|
-
/* harmony export */ getOrCreateImageVolume: () => (/* reexport safe */
|
|
38187
|
+
/* harmony export */ getOrCreateImageVolume: () => (/* reexport safe */ _segmentation_getOrCreateImageVolume__WEBPACK_IMPORTED_MODULE_41__.A),
|
|
38144
38188
|
/* harmony export */ getPixelValueUnits: () => (/* reexport safe */ _getPixelValueUnits__WEBPACK_IMPORTED_MODULE_36__.j),
|
|
38145
38189
|
/* harmony export */ getPixelValueUnitsImageId: () => (/* reexport safe */ _getPixelValueUnits__WEBPACK_IMPORTED_MODULE_36__.N),
|
|
38146
38190
|
/* harmony export */ getSphereBoundsInfo: () => (/* reexport safe */ _getSphereBoundsInfo__WEBPACK_IMPORTED_MODULE_10__.R),
|
|
@@ -38157,6 +38201,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
38157
38201
|
/* harmony export */ polyDataUtils: () => (/* reexport module object */ _polyData_utils__WEBPACK_IMPORTED_MODULE_30__),
|
|
38158
38202
|
/* harmony export */ rectangleROITool: () => (/* reexport module object */ _rectangleROITool__WEBPACK_IMPORTED_MODULE_25__),
|
|
38159
38203
|
/* harmony export */ roundNumber: () => (/* binding */ roundNumber),
|
|
38204
|
+
/* harmony export */ safeStructuredClone: () => (/* reexport safe */ _safeStructuredClone__WEBPACK_IMPORTED_MODULE_40__.W),
|
|
38160
38205
|
/* harmony export */ segmentation: () => (/* reexport module object */ _segmentation__WEBPACK_IMPORTED_MODULE_16__),
|
|
38161
38206
|
/* harmony export */ setAnnotationLabel: () => (/* reexport safe */ _setAnnotationLabel__WEBPACK_IMPORTED_MODULE_38__.A),
|
|
38162
38207
|
/* harmony export */ stackContextPrefetch: () => (/* reexport safe */ _stackPrefetch__WEBPACK_IMPORTED_MODULE_26__.N),
|
|
@@ -38167,7 +38212,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
38167
38212
|
/* harmony export */ triggerAnnotationRenderForToolGroupIds: () => (/* reexport safe */ _triggerAnnotationRenderForToolGroupIds__WEBPACK_IMPORTED_MODULE_8__.A),
|
|
38168
38213
|
/* harmony export */ triggerAnnotationRenderForViewportIds: () => (/* reexport safe */ _triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_7__.A),
|
|
38169
38214
|
/* harmony export */ triggerEvent: () => (/* reexport safe */ _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.triggerEvent),
|
|
38170
|
-
/* harmony export */ usFanExtraction: () => (/* reexport module object */
|
|
38215
|
+
/* harmony export */ usFanExtraction: () => (/* reexport module object */ _tools_annotation_UltrasoundPleuraBLineTool_utils_fanExtraction__WEBPACK_IMPORTED_MODULE_42__),
|
|
38171
38216
|
/* harmony export */ viewport: () => (/* reexport module object */ _viewport__WEBPACK_IMPORTED_MODULE_27__),
|
|
38172
38217
|
/* harmony export */ viewportFilters: () => (/* reexport module object */ _viewportFilters__WEBPACK_IMPORTED_MODULE_20__),
|
|
38173
38218
|
/* harmony export */ voi: () => (/* reexport module object */ _voi__WEBPACK_IMPORTED_MODULE_31__)
|
|
@@ -38212,8 +38257,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
38212
38257
|
/* harmony import */ var _geometricSurfaceUtils__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(5565);
|
|
38213
38258
|
/* harmony import */ var _setAnnotationLabel__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(1355);
|
|
38214
38259
|
/* harmony import */ var _moveAnnotationToViewPlane__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(79646);
|
|
38215
|
-
/* harmony import */ var
|
|
38216
|
-
/* harmony import */ var
|
|
38260
|
+
/* harmony import */ var _safeStructuredClone__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(33459);
|
|
38261
|
+
/* harmony import */ var _segmentation_getOrCreateImageVolume__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(83075);
|
|
38262
|
+
/* harmony import */ var _tools_annotation_UltrasoundPleuraBLineTool_utils_fanExtraction__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(58180);
|
|
38217
38263
|
|
|
38218
38264
|
|
|
38219
38265
|
|
|
@@ -38260,6 +38306,7 @@ const roundNumber = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.utilities.r
|
|
|
38260
38306
|
|
|
38261
38307
|
|
|
38262
38308
|
|
|
38309
|
+
|
|
38263
38310
|
/***/ }),
|
|
38264
38311
|
|
|
38265
38312
|
/***/ 95527:
|
|
@@ -39929,8 +39976,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
39929
39976
|
/* harmony export */ });
|
|
39930
39977
|
/* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15327);
|
|
39931
39978
|
/* harmony import */ var _stateManagement_segmentation_triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(49906);
|
|
39932
|
-
/* harmony import */ var _enums_Events__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(94021);
|
|
39933
|
-
|
|
39934
39979
|
|
|
39935
39980
|
|
|
39936
39981
|
const { VoxelManager, RLEVoxelMap } = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.utilities;
|
|
@@ -40390,7 +40435,7 @@ function getHoveredContourSegmentationAnnotation(segmentationId) {
|
|
|
40390
40435
|
/* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15327);
|
|
40391
40436
|
|
|
40392
40437
|
function getOrCreateImageVolume(referencedImageIds) {
|
|
40393
|
-
if (!referencedImageIds
|
|
40438
|
+
if (!referencedImageIds?.length) {
|
|
40394
40439
|
return;
|
|
40395
40440
|
}
|
|
40396
40441
|
const isValidVolume = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.utilities.isValidVolume(referencedImageIds);
|
|
@@ -40423,6 +40468,9 @@ function getOrCreateImageVolume(referencedImageIds) {
|
|
|
40423
40468
|
|
|
40424
40469
|
function getOrCreateSegmentationVolume(segmentationId) {
|
|
40425
40470
|
const { representationData } = (0,_stateManagement_segmentation_getSegmentation__WEBPACK_IMPORTED_MODULE_1__/* .getSegmentation */ .T)(segmentationId);
|
|
40471
|
+
if (!representationData.Labelmap) {
|
|
40472
|
+
return;
|
|
40473
|
+
}
|
|
40426
40474
|
let { volumeId } = representationData.Labelmap;
|
|
40427
40475
|
let segVolume;
|
|
40428
40476
|
if (volumeId) {
|
|
@@ -40433,7 +40481,7 @@ function getOrCreateSegmentationVolume(segmentationId) {
|
|
|
40433
40481
|
}
|
|
40434
40482
|
const { imageIds: labelmapImageIds } = representationData.Labelmap;
|
|
40435
40483
|
volumeId = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.cache.generateVolumeId(labelmapImageIds);
|
|
40436
|
-
if (!labelmapImageIds || labelmapImageIds.length ===
|
|
40484
|
+
if (!labelmapImageIds || labelmapImageIds.length === 0) {
|
|
40437
40485
|
return;
|
|
40438
40486
|
}
|
|
40439
40487
|
const isValidVolume = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.utilities.isValidVolume(labelmapImageIds);
|
|
@@ -40471,7 +40519,10 @@ function getReferenceVolumeForSegmentationVolume(segmentationVolumeId) {
|
|
|
40471
40519
|
const imageIds = segmentationVolume.imageIds;
|
|
40472
40520
|
const image = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.cache.getImage(imageIds[0]);
|
|
40473
40521
|
const referencedImageId = image.referencedImageId;
|
|
40474
|
-
|
|
40522
|
+
let volumeInfo = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.cache.getVolumeContainingImageId(referencedImageId);
|
|
40523
|
+
if (!volumeInfo?.volume) {
|
|
40524
|
+
volumeInfo = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.cache.getVolumeContainingImageId(image.imageId);
|
|
40525
|
+
}
|
|
40475
40526
|
imageVolume = volumeInfo?.volume;
|
|
40476
40527
|
}
|
|
40477
40528
|
return imageVolume;
|
|
@@ -40783,6 +40834,9 @@ async function getStatistics({ segmentationId, segmentIndices, mode = 'collectiv
|
|
|
40783
40834
|
}
|
|
40784
40835
|
async function calculateVolumeStatistics({ operationData, indices, unit, mode, }) {
|
|
40785
40836
|
const strategyData = (0,_utilsForWorker__WEBPACK_IMPORTED_MODULE_1__/* .prepareVolumeStrategyDataForWorker */ .o9)(operationData);
|
|
40837
|
+
if (!strategyData) {
|
|
40838
|
+
return;
|
|
40839
|
+
}
|
|
40786
40840
|
const { segmentationVoxelManager, imageVoxelManager, segmentationImageData, imageData, } = strategyData;
|
|
40787
40841
|
if (!segmentationVoxelManager || !segmentationImageData) {
|
|
40788
40842
|
return;
|
|
@@ -44653,7 +44707,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
44653
44707
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
44654
44708
|
/* harmony export */ r: () => (/* binding */ version)
|
|
44655
44709
|
/* harmony export */ });
|
|
44656
|
-
const version = '4.
|
|
44710
|
+
const version = '4.15.29';
|
|
44657
44711
|
|
|
44658
44712
|
|
|
44659
44713
|
/***/ }),
|