@ohif/app 3.8.0 → 3.8.2
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/{117.bundle.77cc4e62d0de5d843e2e.js → 117.bundle.17ae130d2bb21ef9d31f.js} +75 -80
- package/dist/{121.bundle.47f05840a5b3cdf75543.js → 121.bundle.27d181784f24551bc546.js} +2 -1
- package/dist/{164.bundle.b101cb64d04a22453984.js → 164.bundle.e30009bee13acb6967da.js} +554 -311
- package/dist/{236.bundle.f774cdc955890e6cdac9.js → 236.bundle.79a374f5fdf7fde431f4.js} +753 -140
- package/dist/{188.bundle.f2b81ec70ae344f57183.js → 243.bundle.7891b41d969264043783.js} +8 -8
- package/dist/{325.bundle.5012b0285b6baadd1884.js → 325.bundle.bfb7de5a397beae16d24.js} +11 -11
- package/dist/{342.bundle.36ee082163b01284eeba.js → 342.bundle.17f0c50a27c0ba1f3846.js} +7 -0
- package/dist/{203.bundle.3581da3a32a0b720d3a7.js → 370.bundle.e4cd6c20d3496c949374.js} +614 -455
- package/dist/{448.bundle.35b8f8e262fa954026df.js → 448.bundle.375bbf6d00a23e35f229.js} +2 -2
- package/dist/{483.bundle.581b242d7b90866fdfb9.js → 483.bundle.016de3c3ec209d9fa42a.js} +16 -3
- package/dist/{487.bundle.79aff4db7df5f383b423.js → 487.bundle.205821cf073b4d0d2e71.js} +2 -2
- package/dist/{416.bundle.9b0d7559344fd02c9e08.js → 501.bundle.de519580f8ba42802378.js} +1206 -305
- package/dist/{530.bundle.207b38c15c4c01e4db0e.js → 530.bundle.17b9a34fefff133e5379.js} +3 -3
- package/dist/{544.bundle.3542927ec15c3f688c8d.js → 544.bundle.170c67e76a6900a9a644.js} +4 -4
- package/dist/{206.bundle.e1ea316389b21006d3df.js → 545.bundle.c9cc3bd30adc9904cf64.js} +28 -24
- package/dist/{321.bundle.39a76114e54cd9833c43.js → 550.bundle.53604ec87839bd9b4a49.js} +82 -49
- package/dist/{574.bundle.4b059c95cd34efdc9cb3.js → 574.bundle.b369b11b04c3e080f0b3.js} +40 -37
- package/dist/{41.bundle.64e0da470e235cfac4bb.js → 682.bundle.fdd752d2920107f695fb.js} +26 -6
- package/dist/{699.bundle.b9666b1d4ddf7e8577ee.js → 699.bundle.fee3d1c6609ecc557a9a.js} +32 -3
- package/dist/{669.bundle.64309c677c5ca188348c.js → 721.bundle.d01a6829ac9b0abef67d.js} +73 -73
- package/dist/{722.bundle.52eb61926d08a08793fe.js → 722.bundle.1242e0348afc63ca4f5e.js} +10 -4
- package/dist/{724.bundle.72aef9dfca69ae057d37.js → 776.bundle.bb8a64b917ff1e559734.js} +13 -15
- package/dist/{862.bundle.9897a9b748078d53f9ab.js → 862.bundle.59bb164ca7e871a33e44.js} +1 -1
- package/dist/{889.bundle.b6231f995fd098f7e3f9.js → 889.bundle.5b10c495e1442d648ffc.js} +8 -8
- package/dist/{905.bundle.cd3e2b347340dd47a1b0.js → 905.bundle.1ba21a0406473fc92696.js} +2 -2
- package/dist/{907.bundle.723a425dedf8147243d2.js → 907.bundle.b199f25916a94c4ebb97.js} +2 -2
- package/dist/{473.bundle.11f707c8170ade2eb56a.js → 914.bundle.2b3a856b7d41ac8298e6.js} +510 -272
- package/dist/{94.bundle.33ca3bc10aa42716dbbb.js → 94.bundle.ae3ca435b134c95aea2e.js} +38 -8
- package/dist/{961.bundle.2c4663737c970764a41e.js → 961.bundle.d1b25d8f354bde3be17c.js} +2 -2
- package/dist/{7.bundle.94692aed50fe4ba2e2f5.js → 981.bundle.808058a6555d322675e1.js} +15 -15
- package/dist/{594.bundle.c292423defd9581bfbe3.js → 989.bundle.b929ddc23c16980560de.js} +5 -5
- package/dist/{633.bundle.e258ba4843985e67336a.js → 998.bundle.df083f740270855652bd.js} +21 -20
- package/dist/app-config.js +5 -1
- package/dist/{app.bundle.a05edb830ad2ecd67aac.js → app.bundle.7fa3782f7fa236cc53a8.js} +791 -568
- package/dist/app.bundle.css +1 -1
- package/dist/cornerstoneDICOMImageLoader.min.js +1 -1
- package/dist/cornerstoneDICOMImageLoader.min.js.map +1 -1
- package/dist/google.js +1 -0
- package/dist/index.html +1 -1
- package/dist/{polySeg.bundle.4442dd3318266fddf4d0.js → polySeg.bundle.36ddebc98d8b109edf33.js} +3 -3
- package/dist/{suv-peak-worker.bundle.348c016f7f973d05f2d2.js → suv-peak-worker.bundle.f4df597fab47d977d7f3.js} +3 -3
- package/dist/sw.js +1 -1
- package/package.json +18 -18
- /package/dist/{321.css → 550.css} +0 -0
- /package/dist/{783.bundle.11d774eb13ffc74cdca5.js → 783.bundle.f4f09b94ebe4d1a466b1.js} +0 -0
- /package/dist/{633.css → 998.css} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(globalThis["webpackChunk"] = globalThis["webpackChunk"] || []).push([[
|
|
1
|
+
(globalThis["webpackChunk"] = globalThis["webpackChunk"] || []).push([[370],{
|
|
2
2
|
|
|
3
3
|
/***/ 93858:
|
|
4
4
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
@@ -1840,6 +1840,40 @@ function wheelListener(evt) {
|
|
|
1840
1840
|
/* harmony default export */ const wheel_wheelListener = (wheelListener);
|
|
1841
1841
|
|
|
1842
1842
|
|
|
1843
|
+
/***/ }),
|
|
1844
|
+
|
|
1845
|
+
/***/ 99595:
|
|
1846
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1847
|
+
|
|
1848
|
+
"use strict";
|
|
1849
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1850
|
+
/* harmony export */ Q: () => (/* binding */ checkAndDefineTextBoxProperty),
|
|
1851
|
+
/* harmony export */ d: () => (/* binding */ checkAndDefineCachedStatsProperty)
|
|
1852
|
+
/* harmony export */ });
|
|
1853
|
+
const checkAndDefineTextBoxProperty = (annotation) => {
|
|
1854
|
+
if (!annotation.data) {
|
|
1855
|
+
annotation.data = {};
|
|
1856
|
+
}
|
|
1857
|
+
if (!annotation.data.handles) {
|
|
1858
|
+
annotation.data.handles = {};
|
|
1859
|
+
}
|
|
1860
|
+
if (!annotation.data.handles.textBox) {
|
|
1861
|
+
annotation.data.handles.textBox = {};
|
|
1862
|
+
}
|
|
1863
|
+
return annotation;
|
|
1864
|
+
};
|
|
1865
|
+
const checkAndDefineCachedStatsProperty = (annotation) => {
|
|
1866
|
+
if (!annotation.data) {
|
|
1867
|
+
annotation.data = {};
|
|
1868
|
+
}
|
|
1869
|
+
if (!annotation.data.cachedStats) {
|
|
1870
|
+
annotation.data.cachedStats = {};
|
|
1871
|
+
}
|
|
1872
|
+
return annotation;
|
|
1873
|
+
};
|
|
1874
|
+
|
|
1875
|
+
|
|
1876
|
+
|
|
1843
1877
|
/***/ }),
|
|
1844
1878
|
|
|
1845
1879
|
/***/ 95778:
|
|
@@ -2511,6 +2545,128 @@ class AdvancedMagnifyViewportManager {
|
|
|
2511
2545
|
|
|
2512
2546
|
|
|
2513
2547
|
|
|
2548
|
+
/***/ }),
|
|
2549
|
+
|
|
2550
|
+
/***/ 16639:
|
|
2551
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2552
|
+
|
|
2553
|
+
"use strict";
|
|
2554
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2555
|
+
/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
2556
|
+
/* harmony export */ });
|
|
2557
|
+
/* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(92136);
|
|
2558
|
+
/* harmony import */ var _distancePointToContour__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7783);
|
|
2559
|
+
/* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(49574);
|
|
2560
|
+
/* harmony import */ var _utilities_math__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(73047);
|
|
2561
|
+
|
|
2562
|
+
|
|
2563
|
+
|
|
2564
|
+
|
|
2565
|
+
class CircleSculptCursor {
|
|
2566
|
+
constructor() {
|
|
2567
|
+
this.toolInfo = {
|
|
2568
|
+
toolSize: null,
|
|
2569
|
+
maxToolSize: null,
|
|
2570
|
+
};
|
|
2571
|
+
}
|
|
2572
|
+
static { this.shapeName = 'Circle'; }
|
|
2573
|
+
renderShape(svgDrawingHelper, canvasLocation, options) {
|
|
2574
|
+
const circleUID = '0';
|
|
2575
|
+
(0,_drawingSvg__WEBPACK_IMPORTED_MODULE_2__.drawCircle)(svgDrawingHelper, 'SculptorTool', circleUID, canvasLocation, this.toolInfo.toolSize, options);
|
|
2576
|
+
}
|
|
2577
|
+
pushHandles(viewport, sculptData) {
|
|
2578
|
+
const { points, mouseCanvasPoint } = sculptData;
|
|
2579
|
+
const pushedHandles = { first: undefined, last: undefined };
|
|
2580
|
+
for (let i = 0; i < points.length; i++) {
|
|
2581
|
+
const handleCanvasPoint = viewport.worldToCanvas(points[i]);
|
|
2582
|
+
const distanceToHandle = _utilities_math__WEBPACK_IMPORTED_MODULE_3__.point.distanceToPoint(handleCanvasPoint, mouseCanvasPoint);
|
|
2583
|
+
if (distanceToHandle > this.toolInfo.toolSize) {
|
|
2584
|
+
continue;
|
|
2585
|
+
}
|
|
2586
|
+
this.pushOneHandle(i, distanceToHandle, sculptData);
|
|
2587
|
+
if (pushedHandles.first === undefined) {
|
|
2588
|
+
pushedHandles.first = i;
|
|
2589
|
+
pushedHandles.last = i;
|
|
2590
|
+
}
|
|
2591
|
+
else {
|
|
2592
|
+
pushedHandles.last = i;
|
|
2593
|
+
}
|
|
2594
|
+
}
|
|
2595
|
+
return pushedHandles;
|
|
2596
|
+
}
|
|
2597
|
+
configureToolSize(evt) {
|
|
2598
|
+
const toolInfo = this.toolInfo;
|
|
2599
|
+
if (toolInfo.toolSize && toolInfo.maxToolSize) {
|
|
2600
|
+
return;
|
|
2601
|
+
}
|
|
2602
|
+
const eventData = evt.detail;
|
|
2603
|
+
const element = eventData.element;
|
|
2604
|
+
const minDim = Math.min(element.clientWidth, element.clientHeight);
|
|
2605
|
+
const maxRadius = minDim / 12;
|
|
2606
|
+
toolInfo.toolSize = maxRadius;
|
|
2607
|
+
toolInfo.maxToolSize = maxRadius;
|
|
2608
|
+
}
|
|
2609
|
+
updateToolSize(canvasCoords, viewport, activeAnnotation) {
|
|
2610
|
+
const toolInfo = this.toolInfo;
|
|
2611
|
+
const radius = (0,_distancePointToContour__WEBPACK_IMPORTED_MODULE_1__/* .distancePointToContour */ .X)(viewport, activeAnnotation, canvasCoords);
|
|
2612
|
+
if (radius > 0) {
|
|
2613
|
+
toolInfo.toolSize = Math.min(toolInfo.maxToolSize, radius);
|
|
2614
|
+
}
|
|
2615
|
+
}
|
|
2616
|
+
getMaxSpacing(minSpacing) {
|
|
2617
|
+
return Math.max(this.toolInfo.toolSize / 4, minSpacing);
|
|
2618
|
+
}
|
|
2619
|
+
getInsertPosition(previousIndex, nextIndex, sculptData) {
|
|
2620
|
+
let insertPosition;
|
|
2621
|
+
const { points, element, mouseCanvasPoint } = sculptData;
|
|
2622
|
+
const toolSize = this.toolInfo.toolSize;
|
|
2623
|
+
const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.getEnabledElement)(element);
|
|
2624
|
+
const { viewport } = enabledElement;
|
|
2625
|
+
const previousCanvasPoint = viewport.worldToCanvas(points[previousIndex]);
|
|
2626
|
+
const nextCanvasPoint = viewport.worldToCanvas(points[nextIndex]);
|
|
2627
|
+
const midPoint = [
|
|
2628
|
+
(previousCanvasPoint[0] + nextCanvasPoint[0]) / 2.0,
|
|
2629
|
+
(previousCanvasPoint[1] + nextCanvasPoint[1]) / 2.0,
|
|
2630
|
+
];
|
|
2631
|
+
const distanceToMidPoint = _utilities_math__WEBPACK_IMPORTED_MODULE_3__.point.distanceToPoint(mouseCanvasPoint, midPoint);
|
|
2632
|
+
if (distanceToMidPoint < toolSize) {
|
|
2633
|
+
const directionUnitVector = {
|
|
2634
|
+
x: (midPoint[0] - mouseCanvasPoint[0]) / distanceToMidPoint,
|
|
2635
|
+
y: (midPoint[1] - mouseCanvasPoint[1]) / distanceToMidPoint,
|
|
2636
|
+
};
|
|
2637
|
+
insertPosition = [
|
|
2638
|
+
mouseCanvasPoint[0] + toolSize * directionUnitVector.x,
|
|
2639
|
+
mouseCanvasPoint[1] + toolSize * directionUnitVector.y,
|
|
2640
|
+
];
|
|
2641
|
+
}
|
|
2642
|
+
else {
|
|
2643
|
+
insertPosition = midPoint;
|
|
2644
|
+
}
|
|
2645
|
+
const worldPosition = viewport.canvasToWorld(insertPosition);
|
|
2646
|
+
return worldPosition;
|
|
2647
|
+
}
|
|
2648
|
+
pushOneHandle(i, distanceToHandle, sculptData) {
|
|
2649
|
+
const { points, mousePoint } = sculptData;
|
|
2650
|
+
const toolSize = this.toolInfo.toolSize;
|
|
2651
|
+
const handle = points[i];
|
|
2652
|
+
const directionUnitVector = {
|
|
2653
|
+
x: (handle[0] - mousePoint[0]) / distanceToHandle,
|
|
2654
|
+
y: (handle[1] - mousePoint[1]) / distanceToHandle,
|
|
2655
|
+
z: (handle[2] - mousePoint[2]) / distanceToHandle,
|
|
2656
|
+
};
|
|
2657
|
+
const position = {
|
|
2658
|
+
x: mousePoint[0] + toolSize * directionUnitVector.x,
|
|
2659
|
+
y: mousePoint[1] + toolSize * directionUnitVector.y,
|
|
2660
|
+
z: mousePoint[2] + toolSize * directionUnitVector.z,
|
|
2661
|
+
};
|
|
2662
|
+
handle[0] = position.x;
|
|
2663
|
+
handle[1] = position.y;
|
|
2664
|
+
handle[2] = position.z;
|
|
2665
|
+
}
|
|
2666
|
+
}
|
|
2667
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CircleSculptCursor);
|
|
2668
|
+
|
|
2669
|
+
|
|
2514
2670
|
/***/ }),
|
|
2515
2671
|
|
|
2516
2672
|
/***/ 30911:
|
|
@@ -3317,7 +3473,7 @@ function findOpenUShapedContourVectorToPeakOnRender(enabledElement, annotation)
|
|
|
3317
3473
|
/* harmony import */ var _utilities_math__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(73047);
|
|
3318
3474
|
/* harmony import */ var _utilities_planarFreehandROITool_smoothPoints__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(36605);
|
|
3319
3475
|
/* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(23072);
|
|
3320
|
-
/* harmony import */ var _utilities_contours__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(
|
|
3476
|
+
/* harmony import */ var _utilities_contours__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(75908);
|
|
3321
3477
|
/* harmony import */ var _findOpenUShapedContourVectorToPeak__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(51051);
|
|
3322
3478
|
/* harmony import */ var _stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(54177);
|
|
3323
3479
|
|
|
@@ -3714,10 +3870,10 @@ function registerOpenContourEndEditLoop(toolInstance) {
|
|
|
3714
3870
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3715
3871
|
/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
3716
3872
|
/* harmony export */ });
|
|
3717
|
-
/* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
3873
|
+
/* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(49574);
|
|
3718
3874
|
/* harmony import */ var _utilities_math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(73047);
|
|
3719
3875
|
/* harmony import */ var _findOpenUShapedContourVectorToPeak__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(51051);
|
|
3720
|
-
/* harmony import */ var _utilities_contours__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
|
|
3876
|
+
/* harmony import */ var _utilities_contours__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(75908);
|
|
3721
3877
|
|
|
3722
3878
|
|
|
3723
3879
|
|
|
@@ -3887,10 +4043,42 @@ function renderOpenContourBeingEdited(enabledElement, svgDrawingHelper, annotati
|
|
|
3887
4043
|
const polylineUIDToRender = 'preview-1';
|
|
3888
4044
|
(0,_drawingSvg__WEBPACK_IMPORTED_MODULE_0__.drawPolyline)(svgDrawingHelper, annotation.annotationUID, polylineUIDToRender, fusedCanvasPoints, options);
|
|
3889
4045
|
}
|
|
4046
|
+
function renderPointContourWithMarker(enabledElement, svgDrawingHelper, annotation) {
|
|
4047
|
+
if (annotation.parentAnnotationUID) {
|
|
4048
|
+
return;
|
|
4049
|
+
}
|
|
4050
|
+
const { viewport } = enabledElement;
|
|
4051
|
+
const options = this._getRenderingOptions(enabledElement, annotation);
|
|
4052
|
+
const canvasPolyline = annotation.data.contour.polyline.map((worldPos) => viewport.worldToCanvas(worldPos));
|
|
4053
|
+
const childContours = (0,_utilities_contours__WEBPACK_IMPORTED_MODULE_3__.getContourHolesDataCanvas)(annotation, viewport);
|
|
4054
|
+
const polylineUID = '1';
|
|
4055
|
+
const center = canvasPolyline[0];
|
|
4056
|
+
const radius = 6;
|
|
4057
|
+
const numberOfPoints = 100;
|
|
4058
|
+
const circlePoints = [];
|
|
4059
|
+
for (let i = 0; i < numberOfPoints; i++) {
|
|
4060
|
+
const angle = (i / numberOfPoints) * 2 * Math.PI;
|
|
4061
|
+
const x = center[0] + radius * Math.cos(angle);
|
|
4062
|
+
const y = center[1] + radius * Math.sin(angle);
|
|
4063
|
+
circlePoints.push([x, y]);
|
|
4064
|
+
}
|
|
4065
|
+
const crosshair = [
|
|
4066
|
+
[center[0] - radius * 2, center[1]],
|
|
4067
|
+
[center[0] + radius * 2, center[1]],
|
|
4068
|
+
[center[0], center[1] - radius * 2],
|
|
4069
|
+
[center[0], center[1] + radius * 2],
|
|
4070
|
+
];
|
|
4071
|
+
(0,_drawingSvg__WEBPACK_IMPORTED_MODULE_0__.drawPath)(svgDrawingHelper, annotation.annotationUID, polylineUID + '-crosshair_v', [crosshair[0], crosshair[1]], options);
|
|
4072
|
+
(0,_drawingSvg__WEBPACK_IMPORTED_MODULE_0__.drawPath)(svgDrawingHelper, annotation.annotationUID, polylineUID + '-crosshair_h', [crosshair[2], crosshair[3]], options);
|
|
4073
|
+
const allContours = [circlePoints, ...childContours];
|
|
4074
|
+
(0,_drawingSvg__WEBPACK_IMPORTED_MODULE_0__.drawPath)(svgDrawingHelper, annotation.annotationUID, polylineUID, allContours, options);
|
|
4075
|
+
}
|
|
3890
4076
|
function registerRenderMethods(toolInstance) {
|
|
3891
4077
|
toolInstance.renderContour = renderContour.bind(toolInstance);
|
|
3892
4078
|
toolInstance.renderClosedContour = renderClosedContour.bind(toolInstance);
|
|
3893
4079
|
toolInstance.renderOpenContour = renderOpenContour.bind(toolInstance);
|
|
4080
|
+
toolInstance.renderPointContourWithMarker =
|
|
4081
|
+
renderPointContourWithMarker.bind(toolInstance);
|
|
3894
4082
|
toolInstance.renderOpenUShapedContour =
|
|
3895
4083
|
renderOpenUShapedContour.bind(toolInstance);
|
|
3896
4084
|
toolInstance.renderContourBeingDrawn =
|
|
@@ -4616,12 +4804,12 @@ var stateManagement_segmentation = __webpack_require__(63421);
|
|
|
4616
4804
|
var enums = __webpack_require__(84901);
|
|
4617
4805
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/annotation/annotationState.js
|
|
4618
4806
|
var annotationState = __webpack_require__(38296);
|
|
4619
|
-
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/drawingSvg/index.js +
|
|
4620
|
-
var drawingSvg = __webpack_require__(
|
|
4807
|
+
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/drawingSvg/index.js + 18 modules
|
|
4808
|
+
var drawingSvg = __webpack_require__(49574);
|
|
4621
4809
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/tools/base/AnnotationTool.js
|
|
4622
4810
|
var AnnotationTool = __webpack_require__(52454);
|
|
4623
|
-
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/index.js
|
|
4624
|
-
var contours = __webpack_require__(
|
|
4811
|
+
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/index.js + 9 modules
|
|
4812
|
+
var contours = __webpack_require__(75908);
|
|
4625
4813
|
;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/tools/base/ContourBaseTool.js
|
|
4626
4814
|
|
|
4627
4815
|
|
|
@@ -4956,7 +5144,7 @@ class ContourSegmentationBaseTool extends ContourBaseTool {
|
|
|
4956
5144
|
const defaultContourConfig = {
|
|
4957
5145
|
renderOutline: true,
|
|
4958
5146
|
outlineWidthAutoGenerated: 3,
|
|
4959
|
-
outlineWidthActive:
|
|
5147
|
+
outlineWidthActive: 1,
|
|
4960
5148
|
outlineWidthInactive: 1,
|
|
4961
5149
|
outlineOpacity: 1,
|
|
4962
5150
|
outlineOpacityInactive: 0.85,
|
|
@@ -4977,7 +5165,7 @@ function getDefaultContourConfig() {
|
|
|
4977
5165
|
|
|
4978
5166
|
/***/ }),
|
|
4979
5167
|
|
|
4980
|
-
/***/
|
|
5168
|
+
/***/ 57784:
|
|
4981
5169
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
4982
5170
|
|
|
4983
5171
|
"use strict";
|
|
@@ -4995,21 +5183,47 @@ var SegmentationRepresentations = __webpack_require__(83946);
|
|
|
4995
5183
|
var segmentationState = __webpack_require__(30322);
|
|
4996
5184
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/store/ToolGroupManager/index.js
|
|
4997
5185
|
var ToolGroupManager = __webpack_require__(52610);
|
|
4998
|
-
// EXTERNAL MODULE: ../../../node_modules/@
|
|
4999
|
-
var
|
|
5000
|
-
|
|
5001
|
-
|
|
5002
|
-
|
|
5003
|
-
|
|
5004
|
-
|
|
5005
|
-
|
|
5186
|
+
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/index.js
|
|
5187
|
+
var stateManagement = __webpack_require__(95778);
|
|
5188
|
+
;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/tools/displayTools/Contour/removeContourFromElement.js
|
|
5189
|
+
|
|
5190
|
+
|
|
5191
|
+
function removeContourFromElement(segmentationRepresentationUID, toolGroupId, removeFromCache = false) {
|
|
5192
|
+
const segmentationRepresentation = (0,segmentationState.getSegmentationRepresentationByUID)(toolGroupId, segmentationRepresentationUID);
|
|
5193
|
+
const { segmentationId } = segmentationRepresentation;
|
|
5194
|
+
const segmentation = (0,segmentationState.getSegmentation)(segmentationId);
|
|
5195
|
+
const { annotationUIDsMap } = segmentation.representationData.CONTOUR;
|
|
5196
|
+
annotationUIDsMap.forEach((annotationSet) => {
|
|
5197
|
+
annotationSet.forEach((annotationUID) => {
|
|
5198
|
+
(0,stateManagement/* removeAnnotation */.O8)(annotationUID);
|
|
5199
|
+
});
|
|
5200
|
+
});
|
|
5201
|
+
}
|
|
5202
|
+
/* harmony default export */ const Contour_removeContourFromElement = (removeContourFromElement);
|
|
5203
|
+
|
|
5204
|
+
;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/tools/displayTools/Contour/contourHandler/contourConfigCache.js
|
|
5205
|
+
const configCachePerSegmentationRepresentationUID = new Map();
|
|
5206
|
+
function getConfigCache(segmentationRepresentationUID) {
|
|
5207
|
+
return configCachePerSegmentationRepresentationUID.get(segmentationRepresentationUID);
|
|
5208
|
+
}
|
|
5209
|
+
function setConfigCache(segmentationRepresentationUID, config) {
|
|
5210
|
+
configCachePerSegmentationRepresentationUID.set(segmentationRepresentationUID, config);
|
|
5211
|
+
}
|
|
5212
|
+
function deleteConfigCache(segmentationRepresentationUID) {
|
|
5213
|
+
configCachePerSegmentationRepresentationUID.delete(segmentationRepresentationUID);
|
|
5214
|
+
}
|
|
5215
|
+
|
|
5216
|
+
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/index.js + 31 modules
|
|
5217
|
+
var stateManagement_segmentation = __webpack_require__(63421);
|
|
5218
|
+
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/annotationHydration.js
|
|
5219
|
+
var annotationHydration = __webpack_require__(25781);
|
|
5006
5220
|
// EXTERNAL MODULE: ../../../node_modules/@kitware/vtk.js/Common/Core/CellArray.js
|
|
5007
5221
|
var CellArray = __webpack_require__(24768);
|
|
5008
5222
|
// EXTERNAL MODULE: ../../../node_modules/@kitware/vtk.js/Common/Core/Points.js
|
|
5009
5223
|
var Points = __webpack_require__(18310);
|
|
5010
5224
|
// EXTERNAL MODULE: ../../../node_modules/@kitware/vtk.js/Common/DataModel/PolyData.js + 9 modules
|
|
5011
5225
|
var PolyData = __webpack_require__(27398);
|
|
5012
|
-
;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/tools/displayTools/Contour/
|
|
5226
|
+
;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/tools/displayTools/Contour/contourHandler/utils.js
|
|
5013
5227
|
|
|
5014
5228
|
|
|
5015
5229
|
|
|
@@ -5040,15 +5254,15 @@ function validateGeometry(geometry) {
|
|
|
5040
5254
|
}
|
|
5041
5255
|
function getPolyData(contourSet) {
|
|
5042
5256
|
const pointArray = [];
|
|
5043
|
-
const points =
|
|
5044
|
-
const lines =
|
|
5257
|
+
const points = vtkPoints.newInstance();
|
|
5258
|
+
const lines = vtkCellArray.newInstance();
|
|
5045
5259
|
let pointIndex = 0;
|
|
5046
5260
|
contourSet.getContours().forEach((contour) => {
|
|
5047
5261
|
const pointList = contour.getPoints();
|
|
5048
5262
|
const flatPoints = contour.getFlatPointsArray();
|
|
5049
5263
|
const type = contour.getType();
|
|
5050
5264
|
const pointIndexes = pointList.map((_, pointListIndex) => pointListIndex + pointIndex);
|
|
5051
|
-
if (type ===
|
|
5265
|
+
if (type === Enums.ContourType.CLOSED_PLANAR) {
|
|
5052
5266
|
pointIndexes.push(pointIndexes[0]);
|
|
5053
5267
|
}
|
|
5054
5268
|
const linePoints = Float32Array.from(flatPoints);
|
|
@@ -5057,25 +5271,15 @@ function getPolyData(contourSet) {
|
|
|
5057
5271
|
pointIndex = pointIndex + pointList.length;
|
|
5058
5272
|
});
|
|
5059
5273
|
points.setData(pointArray, 3);
|
|
5060
|
-
const polygon =
|
|
5274
|
+
const polygon = vtkPolyData.newInstance();
|
|
5061
5275
|
polygon.setPoints(points);
|
|
5062
5276
|
polygon.setLines(lines);
|
|
5063
5277
|
return polygon;
|
|
5064
5278
|
}
|
|
5065
5279
|
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
return configCachePerSegmentationRepresentationUID.get(segmentationRepresentationUID);
|
|
5070
|
-
}
|
|
5071
|
-
function setConfigCache(segmentationRepresentationUID, config) {
|
|
5072
|
-
configCachePerSegmentationRepresentationUID.set(segmentationRepresentationUID, config);
|
|
5073
|
-
}
|
|
5074
|
-
function deleteConfigCache(segmentationRepresentationUID) {
|
|
5075
|
-
configCachePerSegmentationRepresentationUID.delete(segmentationRepresentationUID);
|
|
5076
|
-
}
|
|
5077
|
-
|
|
5078
|
-
;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/tools/displayTools/Contour/vtkContour/addContourSetsToElement.js
|
|
5280
|
+
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contourSegmentation/index.js
|
|
5281
|
+
var contourSegmentation = __webpack_require__(7259);
|
|
5282
|
+
;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/tools/displayTools/Contour/contourHandler/handleContourSegmentation.js
|
|
5079
5283
|
|
|
5080
5284
|
|
|
5081
5285
|
|
|
@@ -5083,90 +5287,22 @@ function deleteConfigCache(segmentationRepresentationUID) {
|
|
|
5083
5287
|
|
|
5084
5288
|
|
|
5085
5289
|
|
|
5086
|
-
function
|
|
5087
|
-
const
|
|
5088
|
-
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
geometryIds.forEach((geometryId) => {
|
|
5092
|
-
const geometry = esm.cache.getGeometry(geometryId);
|
|
5093
|
-
if (!geometry) {
|
|
5094
|
-
console.warn(`No geometry found for geometryId ${geometryId}. Skipping render.`);
|
|
5095
|
-
return;
|
|
5096
|
-
}
|
|
5097
|
-
const segmentIndex = geometry.data.getSegmentIndex();
|
|
5098
|
-
validateGeometry(geometry);
|
|
5099
|
-
const segmentSpecificConfig = getSegmentSpecificConfig(contourRepresentation, geometryId, segmentIndex);
|
|
5100
|
-
const contourSet = geometry.data;
|
|
5101
|
-
const polyData = getPolyData(contourSet);
|
|
5102
|
-
const color = contourSet.getColor();
|
|
5103
|
-
const size = polyData.getPoints().getNumberOfPoints();
|
|
5104
|
-
const scalars = DataArray/* default.newInstance */.Ay.newInstance({
|
|
5105
|
-
size: size * 4,
|
|
5106
|
-
numberOfComponents: 4,
|
|
5107
|
-
dataType: 'Uint8Array',
|
|
5108
|
-
});
|
|
5109
|
-
for (let i = 0; i < size; ++i) {
|
|
5110
|
-
scalars.setTuple(i, [...color, 255]);
|
|
5111
|
-
}
|
|
5112
|
-
polyData.getPointData().setScalars(scalars);
|
|
5113
|
-
if (segmentSpecificConfig) {
|
|
5114
|
-
segmentSpecificMap.set(segmentIndex, segmentSpecificConfig);
|
|
5115
|
-
}
|
|
5116
|
-
scalarToColorMap.set(segmentIndex, [
|
|
5117
|
-
...color,
|
|
5118
|
-
segmentsHidden.has(segmentIndex) ? 0 : 255,
|
|
5119
|
-
]);
|
|
5120
|
-
segmentIndex === 0
|
|
5121
|
-
? appendPolyData.setInputData(polyData)
|
|
5122
|
-
: appendPolyData.addInputData(polyData);
|
|
5123
|
-
});
|
|
5124
|
-
const polyDataOutput = appendPolyData.getOutputData();
|
|
5125
|
-
const outlineWidthActive = contourRepresentationConfig.representations.CONTOUR.outlineWidthActive;
|
|
5126
|
-
const mapper = Mapper/* default.newInstance */.Ay.newInstance();
|
|
5127
|
-
mapper.setInputData(polyDataOutput);
|
|
5128
|
-
const actor = Actor/* default.newInstance */.Ay.newInstance();
|
|
5129
|
-
actor.setMapper(mapper);
|
|
5130
|
-
actor.getProperty().setLineWidth(outlineWidthActive);
|
|
5131
|
-
setConfigCache(segmentationRepresentationUID, Object.assign({}, getConfigCache(segmentationRepresentationUID), {
|
|
5132
|
-
segmentsHidden: new Set(segmentsHidden),
|
|
5133
|
-
segmentSpecificMap,
|
|
5134
|
-
outlineWidthActive,
|
|
5135
|
-
}));
|
|
5136
|
-
actor.setForceOpaque(true);
|
|
5137
|
-
viewport.addActor({
|
|
5138
|
-
uid: contourActorUID,
|
|
5139
|
-
actor: actor,
|
|
5140
|
-
});
|
|
5141
|
-
viewport.resetCamera();
|
|
5142
|
-
viewport.render();
|
|
5290
|
+
function handleContourSegmentation(viewport, geometryIds, annotationUIDsMap, contourRepresentation, contourRepresentationConfig) {
|
|
5291
|
+
const addOrUpdateFn = annotationUIDsMap.size
|
|
5292
|
+
? updateContourSets
|
|
5293
|
+
: addContourSetsToElement;
|
|
5294
|
+
addOrUpdateFn(viewport, geometryIds, contourRepresentation, contourRepresentationConfig);
|
|
5143
5295
|
}
|
|
5144
|
-
|
|
5145
|
-
;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/tools/displayTools/Contour/vtkContour/updateVTKContourSets.js
|
|
5146
|
-
|
|
5147
|
-
|
|
5148
|
-
|
|
5149
|
-
function updateVTKContourSets(viewport, geometryIds, contourRepresentation, contourRepresentationConfig, contourActorUID) {
|
|
5296
|
+
function updateContourSets(viewport, geometryIds, contourRepresentation, contourRepresentationConfig) {
|
|
5150
5297
|
const { segmentationRepresentationUID, segmentsHidden } = contourRepresentation;
|
|
5151
5298
|
const newContourConfig = contourRepresentationConfig.representations.CONTOUR;
|
|
5152
5299
|
const cachedConfig = getConfigCache(segmentationRepresentationUID);
|
|
5153
|
-
const contourSetsActor = viewport.getActor(contourActorUID);
|
|
5154
|
-
if (!contourSetsActor) {
|
|
5155
|
-
console.warn(`No contour actor found for actorUID ${contourActorUID}. Skipping render.`);
|
|
5156
|
-
return;
|
|
5157
|
-
}
|
|
5158
|
-
const { actor } = contourSetsActor;
|
|
5159
5300
|
const newOutlineWithActive = newContourConfig.outlineWidthActive;
|
|
5160
5301
|
if (cachedConfig?.outlineWidthActive !== newOutlineWithActive) {
|
|
5161
|
-
actor
|
|
5162
|
-
.getProperty()
|
|
5163
|
-
.setLineWidth(newOutlineWithActive);
|
|
5164
5302
|
setConfigCache(segmentationRepresentationUID, Object.assign({}, cachedConfig, {
|
|
5165
5303
|
outlineWidthActive: newOutlineWithActive,
|
|
5166
5304
|
}));
|
|
5167
5305
|
}
|
|
5168
|
-
const mapper = actor.getMapper();
|
|
5169
|
-
const lut = mapper.getLookupTable();
|
|
5170
5306
|
const segmentsToSetToInvisible = [];
|
|
5171
5307
|
const segmentsToSetToVisible = [];
|
|
5172
5308
|
for (const segmentIndex of segmentsHidden) {
|
|
@@ -5182,12 +5318,11 @@ function updateVTKContourSets(viewport, geometryIds, contourRepresentation, cont
|
|
|
5182
5318
|
const mergedInvisibleSegments = Array.from(cachedConfig.segmentsHidden)
|
|
5183
5319
|
.filter((segmentIndex) => !segmentsToSetToVisible.includes(segmentIndex))
|
|
5184
5320
|
.concat(segmentsToSetToInvisible);
|
|
5185
|
-
const {
|
|
5321
|
+
const { segmentSpecificConfigs } = geometryIds.reduce((acc, geometryId) => {
|
|
5186
5322
|
const geometry = esm.cache.getGeometry(geometryId);
|
|
5187
5323
|
const { data: contourSet } = geometry;
|
|
5188
5324
|
const segmentIndex = contourSet.getSegmentIndex();
|
|
5189
5325
|
const segmentSpecificConfig = getSegmentSpecificConfig(contourRepresentation, geometryId, segmentIndex);
|
|
5190
|
-
acc.contourSets.push(contourSet);
|
|
5191
5326
|
acc.segmentSpecificConfigs[segmentIndex] = segmentSpecificConfig ?? {};
|
|
5192
5327
|
return acc;
|
|
5193
5328
|
}, { contourSets: [], segmentSpecificConfigs: {} });
|
|
@@ -5196,72 +5331,75 @@ function updateVTKContourSets(viewport, geometryIds, contourRepresentation, cont
|
|
|
5196
5331
|
...segmentsToSetToVisible,
|
|
5197
5332
|
];
|
|
5198
5333
|
const hasCustomSegmentSpecificConfig = Object.values(segmentSpecificConfigs).some((config) => Object.keys(config).length > 0);
|
|
5199
|
-
let polyDataModified = false;
|
|
5200
5334
|
if (affectedSegments.length || hasCustomSegmentSpecificConfig) {
|
|
5201
|
-
const appendPolyData = mapper.getInputData();
|
|
5202
|
-
const appendScalars = appendPolyData.getPointData().getScalars();
|
|
5203
|
-
const appendScalarsData = appendScalars.getData();
|
|
5204
|
-
let offset = 0;
|
|
5205
|
-
contourSets.forEach((contourSet) => {
|
|
5206
|
-
const segmentIndex = contourSet.getSegmentIndex();
|
|
5207
|
-
const size = contourSet.getTotalNumberOfPoints();
|
|
5208
|
-
if (affectedSegments.includes(segmentIndex) ||
|
|
5209
|
-
segmentSpecificConfigs[segmentIndex]?.fillAlpha) {
|
|
5210
|
-
const color = contourSet.getColor();
|
|
5211
|
-
let visibility = mergedInvisibleSegments.includes(segmentIndex)
|
|
5212
|
-
? 0
|
|
5213
|
-
: 255;
|
|
5214
|
-
const segmentConfig = segmentSpecificConfigs[segmentIndex];
|
|
5215
|
-
if (segmentConfig.fillAlpha !== undefined) {
|
|
5216
|
-
visibility = segmentConfig.fillAlpha * 255;
|
|
5217
|
-
}
|
|
5218
|
-
for (let i = 0; i < size; ++i) {
|
|
5219
|
-
appendScalarsData[offset + i * 4] = color[0];
|
|
5220
|
-
appendScalarsData[offset + i * 4 + 1] = color[1];
|
|
5221
|
-
appendScalarsData[offset + i * 4 + 2] = color[2];
|
|
5222
|
-
appendScalarsData[offset + i * 4 + 3] = visibility;
|
|
5223
|
-
}
|
|
5224
|
-
polyDataModified = true;
|
|
5225
|
-
}
|
|
5226
|
-
offset = offset + size * 4;
|
|
5227
|
-
});
|
|
5228
|
-
if (polyDataModified) {
|
|
5229
|
-
appendPolyData.modified();
|
|
5230
|
-
}
|
|
5231
5335
|
setConfigCache(segmentationRepresentationUID, Object.assign({}, cachedConfig, {
|
|
5232
5336
|
segmentsHidden: new Set(segmentsHidden),
|
|
5233
5337
|
}));
|
|
5234
|
-
mapper.setLookupTable(lut);
|
|
5235
5338
|
}
|
|
5236
5339
|
viewport.render();
|
|
5237
5340
|
}
|
|
5238
|
-
|
|
5239
|
-
|
|
5240
|
-
|
|
5241
|
-
|
|
5242
|
-
|
|
5243
|
-
|
|
5244
|
-
|
|
5245
|
-
|
|
5246
|
-
|
|
5247
|
-
|
|
5341
|
+
function addContourSetsToElement(viewport, geometryIds, contourRepresentation, contourRepresentationConfig) {
|
|
5342
|
+
const { segmentationRepresentationUID, segmentationId, segmentsHidden } = contourRepresentation;
|
|
5343
|
+
const segmentSpecificMap = new Map();
|
|
5344
|
+
geometryIds.forEach((geometryId) => {
|
|
5345
|
+
const geometry = esm.cache.getGeometry(geometryId);
|
|
5346
|
+
if (!geometry) {
|
|
5347
|
+
console.warn(`No geometry found for geometryId ${geometryId}. Skipping render.`);
|
|
5348
|
+
return;
|
|
5349
|
+
}
|
|
5350
|
+
const segmentIndex = geometry.data.getSegmentIndex();
|
|
5351
|
+
validateGeometry(geometry);
|
|
5352
|
+
const segmentSpecificConfig = getSegmentSpecificConfig(contourRepresentation, geometryId, segmentIndex);
|
|
5353
|
+
const contourSet = geometry.data;
|
|
5354
|
+
contourSet.contours.forEach((contour) => {
|
|
5355
|
+
const { points, color, id } = contour;
|
|
5356
|
+
const contourSegmentationAnnotation = {
|
|
5357
|
+
annotationUID: esm.utilities.uuidv4(),
|
|
5358
|
+
data: {
|
|
5359
|
+
contour: {
|
|
5360
|
+
closed: true,
|
|
5361
|
+
polyline: points,
|
|
5362
|
+
},
|
|
5363
|
+
segmentation: {
|
|
5364
|
+
segmentationId,
|
|
5365
|
+
segmentIndex,
|
|
5366
|
+
color,
|
|
5367
|
+
id,
|
|
5368
|
+
},
|
|
5369
|
+
handles: {},
|
|
5370
|
+
},
|
|
5371
|
+
handles: {},
|
|
5372
|
+
highlighted: false,
|
|
5373
|
+
autoGenerated: false,
|
|
5374
|
+
invalidated: false,
|
|
5375
|
+
isLocked: true,
|
|
5376
|
+
isVisible: true,
|
|
5377
|
+
metadata: {
|
|
5378
|
+
referencedImageId: (0,annotationHydration/* getClosestImageIdForStackViewport */.x)(viewport, points[0], viewport.getCamera().viewPlaneNormal),
|
|
5379
|
+
toolName: 'PlanarFreehandContourSegmentationTool',
|
|
5380
|
+
FrameOfReferenceUID: viewport.getFrameOfReferenceUID(),
|
|
5381
|
+
viewPlaneNormal: viewport.getCamera().viewPlaneNormal,
|
|
5382
|
+
},
|
|
5383
|
+
};
|
|
5384
|
+
const annotationGroupSelector = viewport.element;
|
|
5385
|
+
(0,stateManagement/* addAnnotation */.lC)(contourSegmentationAnnotation, annotationGroupSelector);
|
|
5386
|
+
(0,contourSegmentation.addContourSegmentationAnnotation)(contourSegmentationAnnotation);
|
|
5387
|
+
});
|
|
5388
|
+
if (segmentSpecificConfig) {
|
|
5389
|
+
segmentSpecificMap.set(segmentIndex, segmentSpecificConfig);
|
|
5390
|
+
}
|
|
5391
|
+
});
|
|
5392
|
+
const outlineWidthActive = contourRepresentationConfig.representations.CONTOUR.outlineWidthActive;
|
|
5393
|
+
setConfigCache(segmentationRepresentationUID, Object.assign({}, getConfigCache(segmentationRepresentationUID), {
|
|
5394
|
+
segmentsHidden: new Set(segmentsHidden),
|
|
5395
|
+
segmentSpecificMap,
|
|
5396
|
+
outlineWidthActive,
|
|
5397
|
+
}));
|
|
5398
|
+
viewport.resetCamera();
|
|
5399
|
+
viewport.render();
|
|
5248
5400
|
}
|
|
5249
5401
|
|
|
5250
|
-
;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/tools/displayTools/Contour/removeContourFromElement.js
|
|
5251
|
-
|
|
5252
|
-
function removeContourFromElement(element, segmentationRepresentationUID, removeFromCache = false) {
|
|
5253
|
-
const enabledElement = (0,esm.getEnabledElement)(element);
|
|
5254
|
-
const { viewport } = enabledElement;
|
|
5255
|
-
const actorEntries = viewport.getActors();
|
|
5256
|
-
const actorUIDsToRemove = actorEntries
|
|
5257
|
-
.map(({ uid }) => uid.includes(segmentationRepresentationUID) ? uid : undefined)
|
|
5258
|
-
.filter(Boolean);
|
|
5259
|
-
viewport.removeActors(actorUIDsToRemove);
|
|
5260
|
-
}
|
|
5261
|
-
/* harmony default export */ const Contour_removeContourFromElement = (removeContourFromElement);
|
|
5262
5402
|
|
|
5263
|
-
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/index.js + 31 modules
|
|
5264
|
-
var stateManagement_segmentation = __webpack_require__(63421);
|
|
5265
5403
|
;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/tools/displayTools/Contour/contourDisplay.js
|
|
5266
5404
|
|
|
5267
5405
|
|
|
@@ -5300,11 +5438,12 @@ async function render(viewport, representationConfig, toolGroupConfig) {
|
|
|
5300
5438
|
viewport,
|
|
5301
5439
|
});
|
|
5302
5440
|
}
|
|
5303
|
-
|
|
5304
|
-
if (!geometryIds?.length || !(viewport instanceof esm.BaseVolumeViewport)) {
|
|
5441
|
+
if (!contourData) {
|
|
5305
5442
|
return;
|
|
5306
5443
|
}
|
|
5307
|
-
|
|
5444
|
+
if (contourData?.geometryIds?.length) {
|
|
5445
|
+
handleContourSegmentation(viewport, contourData.geometryIds, contourData.annotationUIDsMap, representationConfig, toolGroupConfig);
|
|
5446
|
+
}
|
|
5308
5447
|
}
|
|
5309
5448
|
function _removeContourFromToolGroupViewports(toolGroupId, segmentationRepresentationUID) {
|
|
5310
5449
|
const toolGroup = (0,ToolGroupManager.getToolGroup)(toolGroupId);
|
|
@@ -5315,7 +5454,7 @@ function _removeContourFromToolGroupViewports(toolGroupId, segmentationRepresent
|
|
|
5315
5454
|
for (const viewportInfo of viewportsInfo) {
|
|
5316
5455
|
const { viewportId, renderingEngineId } = viewportInfo;
|
|
5317
5456
|
const enabledElement = (0,esm.getEnabledElementByIds)(viewportId, renderingEngineId);
|
|
5318
|
-
Contour_removeContourFromElement(
|
|
5457
|
+
Contour_removeContourFromElement(segmentationRepresentationUID, toolGroupId);
|
|
5319
5458
|
}
|
|
5320
5459
|
}
|
|
5321
5460
|
/* harmony default export */ const contourDisplay = ({
|
|
@@ -5363,7 +5502,7 @@ async function addLabelmapToElement(element, labelMapData, segmentationRepresent
|
|
|
5363
5502
|
actorUID: segmentationRepresentationUID,
|
|
5364
5503
|
},
|
|
5365
5504
|
];
|
|
5366
|
-
await (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.addImageSlicesToViewports)(renderingEngine, stackInputs, [viewportId]
|
|
5505
|
+
await (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.addImageSlicesToViewports)(renderingEngine, stackInputs, [viewportId]);
|
|
5367
5506
|
}
|
|
5368
5507
|
}
|
|
5369
5508
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (addLabelmapToElement);
|
|
@@ -5643,6 +5782,36 @@ function getDefaultSurfaceConfig() {
|
|
|
5643
5782
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getDefaultSurfaceConfig);
|
|
5644
5783
|
|
|
5645
5784
|
|
|
5785
|
+
/***/ }),
|
|
5786
|
+
|
|
5787
|
+
/***/ 7783:
|
|
5788
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
5789
|
+
|
|
5790
|
+
"use strict";
|
|
5791
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5792
|
+
/* harmony export */ X: () => (/* binding */ distancePointToContour)
|
|
5793
|
+
/* harmony export */ });
|
|
5794
|
+
/* harmony import */ var _utilities_math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73047);
|
|
5795
|
+
|
|
5796
|
+
const distancePointToContour = (viewport, annotation, coords) => {
|
|
5797
|
+
if (!annotation?.data?.contour?.polyline?.length) {
|
|
5798
|
+
return;
|
|
5799
|
+
}
|
|
5800
|
+
const { polyline } = annotation.data.contour;
|
|
5801
|
+
const { length } = polyline;
|
|
5802
|
+
let distance = Infinity;
|
|
5803
|
+
for (let i = 0; i < length; i++) {
|
|
5804
|
+
const canvasPoint = viewport.worldToCanvas(polyline[i]);
|
|
5805
|
+
const distanceToPoint = _utilities_math__WEBPACK_IMPORTED_MODULE_0__.point.distanceToPoint(canvasPoint, coords);
|
|
5806
|
+
distance = Math.min(distance, distanceToPoint);
|
|
5807
|
+
}
|
|
5808
|
+
if (distance === Infinity || isNaN(distance)) {
|
|
5809
|
+
return;
|
|
5810
|
+
}
|
|
5811
|
+
return distance;
|
|
5812
|
+
};
|
|
5813
|
+
|
|
5814
|
+
|
|
5646
5815
|
/***/ }),
|
|
5647
5816
|
|
|
5648
5817
|
/***/ 57439:
|
|
@@ -7231,9 +7400,11 @@ function _addInterpolatedContour(interpolated3DPoints, handlePoints, sliceIndex,
|
|
|
7231
7400
|
const points = interpolated3DPoints.points;
|
|
7232
7401
|
const { viewport } = eventData;
|
|
7233
7402
|
const interpolatedAnnotation = createPolylineToolData(points, handlePoints, referencedToolData);
|
|
7234
|
-
const
|
|
7235
|
-
|
|
7236
|
-
|
|
7403
|
+
const viewRef = viewport.getViewReference({ sliceIndex });
|
|
7404
|
+
if (!viewRef) {
|
|
7405
|
+
throw new Error(`Can't find slice ${sliceIndex}`);
|
|
7406
|
+
}
|
|
7407
|
+
Object.assign(interpolatedAnnotation.metadata, viewRef);
|
|
7237
7408
|
stateManagement_annotation.state.addAnnotation(interpolatedAnnotation, viewport.element);
|
|
7238
7409
|
referencedToolData.onInterpolationComplete?.(interpolatedAnnotation, referencedToolData);
|
|
7239
7410
|
const { parentAnnotationUID } = referencedToolData;
|
|
@@ -9649,282 +9820,38 @@ var vtkEdgeLocator = {
|
|
|
9649
9820
|
|
|
9650
9821
|
/***/ }),
|
|
9651
9822
|
|
|
9652
|
-
/***/
|
|
9823
|
+
/***/ 68749:
|
|
9653
9824
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
9654
9825
|
|
|
9655
9826
|
"use strict";
|
|
9656
9827
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
9657
|
-
/* harmony export */
|
|
9828
|
+
/* harmony export */ A: () => (/* binding */ vtkCaseTable)
|
|
9658
9829
|
/* harmony export */ });
|
|
9659
|
-
|
|
9660
|
-
|
|
9661
|
-
|
|
9662
|
-
|
|
9663
|
-
|
|
9664
|
-
|
|
9665
|
-
/*
|
|
9830
|
+
// ----------------------------------------------------------------------------
|
|
9831
|
+
// Marching squares case functions (using lines to generate the 2D tessellation).
|
|
9832
|
+
// For each case, a list of edge ids that form the triangles. A -1 marks the
|
|
9833
|
+
// end of the list of edges. Edges are taken three at a time to generate
|
|
9834
|
+
// triangle points.
|
|
9835
|
+
// ----------------------------------------------------------------------------
|
|
9836
|
+
const MARCHING_SQUARES_CASES = [[-1, -1, -1, -1, -1] /* 0 */, [0, 3, -1, -1, -1] /* 1 */, [1, 0, -1, -1, -1] /* 2 */, [1, 3, -1, -1, -1] /* 3 */, [2, 1, -1, -1, -1] /* 4 */, [0, 3, 2, 1, -1] /* 5 */, [2, 0, -1, -1, -1] /* 6 */, [2, 3, -1, -1, -1] /* 7 */, [3, 2, -1, -1, -1] /* 8 */, [0, 2, -1, -1, -1] /* 9 */, [1, 0, 3, 2, -1] /* 10 */, [1, 2, -1, -1, -1] /* 11 */, [3, 1, -1, -1, -1] /* 12 */, [0, 1, -1, -1, -1] /* 13 */, [3, 0, -1, -1, -1] /* 14 */, [-1, -1, -1, -1, -1] /* 15 */];
|
|
9666
9837
|
|
|
9838
|
+
const EDGES = [[0, 1], [1, 3], [2, 3], [0, 2]];
|
|
9839
|
+
function getCase(index) {
|
|
9840
|
+
return MARCHING_SQUARES_CASES[index];
|
|
9841
|
+
}
|
|
9667
9842
|
|
|
9843
|
+
// Define the four edges of the pixel by the following pairs of vertices
|
|
9844
|
+
function getEdge(eid) {
|
|
9845
|
+
return EDGES[eid];
|
|
9846
|
+
}
|
|
9668
9847
|
|
|
9669
|
-
|
|
9670
|
-
|
|
9671
|
-
|
|
9672
|
-
|
|
9673
|
-
|
|
9674
|
-
|
|
9675
|
-
}
|
|
9676
|
-
function offsetCellArray(typedArray, offset) {
|
|
9677
|
-
let currentIdx = 0;
|
|
9678
|
-
return typedArray.map((value, index) => {
|
|
9679
|
-
if (index === currentIdx) {
|
|
9680
|
-
currentIdx += value + 1;
|
|
9681
|
-
return value;
|
|
9682
|
-
}
|
|
9683
|
-
return value + offset;
|
|
9684
|
-
});
|
|
9685
|
-
}
|
|
9686
|
-
function appendCellData(dest, src, ptOffset, cellOffset) {
|
|
9687
|
-
dest.set(offsetCellArray(src, ptOffset), cellOffset);
|
|
9688
|
-
}
|
|
9689
|
-
|
|
9690
|
-
// ----------------------------------------------------------------------------
|
|
9691
|
-
// vtkAppendPolyData methods
|
|
9692
|
-
// ----------------------------------------------------------------------------
|
|
9693
|
-
|
|
9694
|
-
function vtkAppendPolyData(publicAPI, model) {
|
|
9695
|
-
// Set our classname
|
|
9696
|
-
model.classHierarchy.push('vtkAppendPolyData');
|
|
9697
|
-
publicAPI.requestData = (inData, outData) => {
|
|
9698
|
-
// implement requestData
|
|
9699
|
-
const numberOfInputs = publicAPI.getNumberOfInputPorts();
|
|
9700
|
-
if (!numberOfInputs) {
|
|
9701
|
-
vtkErrorMacro('No input specified.');
|
|
9702
|
-
return;
|
|
9703
|
-
}
|
|
9704
|
-
if (numberOfInputs === 1) {
|
|
9705
|
-
// pass through filter
|
|
9706
|
-
outData[0] = inData[0];
|
|
9707
|
-
return;
|
|
9708
|
-
}
|
|
9709
|
-
|
|
9710
|
-
// Allocate output
|
|
9711
|
-
const output = _Common_DataModel_PolyData_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].newInstance */ .Ay.newInstance();
|
|
9712
|
-
let numPts = 0;
|
|
9713
|
-
let pointType = 0;
|
|
9714
|
-
let ttype = 1;
|
|
9715
|
-
let firstType = 1;
|
|
9716
|
-
let numVerts = 0;
|
|
9717
|
-
let numLines = 0;
|
|
9718
|
-
let numStrips = 0;
|
|
9719
|
-
let numPolys = 0;
|
|
9720
|
-
|
|
9721
|
-
// Field data is propagated to output only if present in all inputs
|
|
9722
|
-
let hasPtNormals = true; // assume present by default
|
|
9723
|
-
let hasPtTCoords = true;
|
|
9724
|
-
let hasPtScalars = true;
|
|
9725
|
-
for (let i = 0; i < numberOfInputs; i++) {
|
|
9726
|
-
const ds = inData[i];
|
|
9727
|
-
if (!ds) {
|
|
9728
|
-
// eslint-disable-next-line
|
|
9729
|
-
continue;
|
|
9730
|
-
}
|
|
9731
|
-
const dsNumPts = ds.getPoints().getNumberOfPoints();
|
|
9732
|
-
numPts += dsNumPts;
|
|
9733
|
-
numVerts += ds.getVerts().getNumberOfValues();
|
|
9734
|
-
numLines += ds.getLines().getNumberOfValues();
|
|
9735
|
-
numStrips += ds.getStrips().getNumberOfValues();
|
|
9736
|
-
numPolys += ds.getPolys().getNumberOfValues();
|
|
9737
|
-
if (dsNumPts) {
|
|
9738
|
-
if (firstType) {
|
|
9739
|
-
firstType = 0;
|
|
9740
|
-
pointType = ds.getPoints().getDataType();
|
|
9741
|
-
}
|
|
9742
|
-
ttype = ds.getPoints().getDataType();
|
|
9743
|
-
pointType = pointType > ttype ? pointType : ttype;
|
|
9744
|
-
}
|
|
9745
|
-
const ptD = ds.getPointData();
|
|
9746
|
-
if (ptD) {
|
|
9747
|
-
hasPtNormals = hasPtNormals && ptD.getNormals() !== null;
|
|
9748
|
-
hasPtTCoords = hasPtTCoords && ptD.getTCoords() !== null;
|
|
9749
|
-
hasPtScalars = hasPtScalars && ptD.getScalars() !== null;
|
|
9750
|
-
} else {
|
|
9751
|
-
hasPtNormals = false;
|
|
9752
|
-
hasPtTCoords = false;
|
|
9753
|
-
hasPtScalars = false;
|
|
9754
|
-
}
|
|
9755
|
-
}
|
|
9756
|
-
if (model.outputPointsPrecision === _Common_DataModel_DataSetAttributes_Constants_js__WEBPACK_IMPORTED_MODULE_4__/* .DesiredOutputPrecision */ .kP.SINGLE) {
|
|
9757
|
-
pointType = _Common_Core_DataArray_Constants_js__WEBPACK_IMPORTED_MODULE_5__/* .VtkDataTypes */ .JA.FLOAT;
|
|
9758
|
-
} else if (model.outputPointsPrecision === _Common_DataModel_DataSetAttributes_Constants_js__WEBPACK_IMPORTED_MODULE_4__/* .DesiredOutputPrecision */ .kP.DOUBLE) {
|
|
9759
|
-
pointType = _Common_Core_DataArray_Constants_js__WEBPACK_IMPORTED_MODULE_5__/* .VtkDataTypes */ .JA.DOUBLE;
|
|
9760
|
-
}
|
|
9761
|
-
const points = _Common_Core_Points_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"].newInstance */ .Ay.newInstance({
|
|
9762
|
-
dataType: pointType
|
|
9763
|
-
});
|
|
9764
|
-
points.setNumberOfPoints(numPts);
|
|
9765
|
-
const pointData = points.getData();
|
|
9766
|
-
const vertData = new Uint32Array(numVerts);
|
|
9767
|
-
const lineData = new Uint32Array(numLines);
|
|
9768
|
-
const stripData = new Uint32Array(numStrips);
|
|
9769
|
-
const polyData = new Uint32Array(numPolys);
|
|
9770
|
-
let newPtNormals = null;
|
|
9771
|
-
let newPtTCoords = null;
|
|
9772
|
-
let newPtScalars = null;
|
|
9773
|
-
const lds = inData[numberOfInputs - 1];
|
|
9774
|
-
if (hasPtNormals) {
|
|
9775
|
-
const dsNormals = lds.getPointData().getNormals();
|
|
9776
|
-
newPtNormals = _Common_Core_DataArray_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"].newInstance */ .Ay.newInstance({
|
|
9777
|
-
numberOfComponents: 3,
|
|
9778
|
-
numberOfTuples: numPts,
|
|
9779
|
-
size: 3 * numPts,
|
|
9780
|
-
dataType: dsNormals.getDataType(),
|
|
9781
|
-
name: dsNormals.getName()
|
|
9782
|
-
});
|
|
9783
|
-
}
|
|
9784
|
-
if (hasPtTCoords) {
|
|
9785
|
-
const dsTCoords = lds.getPointData().getTCoords();
|
|
9786
|
-
newPtTCoords = _Common_Core_DataArray_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"].newInstance */ .Ay.newInstance({
|
|
9787
|
-
numberOfComponents: 2,
|
|
9788
|
-
numberOfTuples: numPts,
|
|
9789
|
-
size: 2 * numPts,
|
|
9790
|
-
dataType: dsTCoords.getDataType(),
|
|
9791
|
-
name: dsTCoords.getName()
|
|
9792
|
-
});
|
|
9793
|
-
}
|
|
9794
|
-
if (hasPtScalars) {
|
|
9795
|
-
const dsScalars = lds.getPointData().getScalars();
|
|
9796
|
-
newPtScalars = _Common_Core_DataArray_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"].newInstance */ .Ay.newInstance({
|
|
9797
|
-
numberOfComponents: dsScalars.getNumberOfComponents(),
|
|
9798
|
-
numberOfTuples: numPts,
|
|
9799
|
-
size: numPts * dsScalars.getNumberOfComponents(),
|
|
9800
|
-
dataType: dsScalars.getDataType(),
|
|
9801
|
-
name: dsScalars.getName()
|
|
9802
|
-
});
|
|
9803
|
-
}
|
|
9804
|
-
numPts = 0;
|
|
9805
|
-
numVerts = 0;
|
|
9806
|
-
numLines = 0;
|
|
9807
|
-
numStrips = 0;
|
|
9808
|
-
numPolys = 0;
|
|
9809
|
-
for (let i = 0; i < numberOfInputs; i++) {
|
|
9810
|
-
const ds = inData[i];
|
|
9811
|
-
pointData.set(ds.getPoints().getData(), numPts * 3);
|
|
9812
|
-
appendCellData(vertData, ds.getVerts().getData(), numPts, numVerts);
|
|
9813
|
-
numVerts += ds.getVerts().getNumberOfValues();
|
|
9814
|
-
appendCellData(lineData, ds.getLines().getData(), numPts, numLines);
|
|
9815
|
-
numLines += ds.getLines().getNumberOfValues();
|
|
9816
|
-
appendCellData(stripData, ds.getStrips().getData(), numPts, numStrips);
|
|
9817
|
-
numStrips += ds.getStrips().getNumberOfValues();
|
|
9818
|
-
appendCellData(polyData, ds.getPolys().getData(), numPts, numPolys);
|
|
9819
|
-
numPolys += ds.getPolys().getNumberOfValues();
|
|
9820
|
-
const dsPD = ds.getPointData();
|
|
9821
|
-
if (hasPtNormals) {
|
|
9822
|
-
const ptNorms = dsPD.getNormals();
|
|
9823
|
-
newPtNormals.getData().set(ptNorms.getData(), numPts * 3);
|
|
9824
|
-
}
|
|
9825
|
-
if (hasPtTCoords) {
|
|
9826
|
-
const ptTCoords = dsPD.getTCoords();
|
|
9827
|
-
newPtTCoords.getData().set(ptTCoords.getData(), numPts * 2);
|
|
9828
|
-
}
|
|
9829
|
-
if (hasPtScalars) {
|
|
9830
|
-
const ptScalars = dsPD.getScalars();
|
|
9831
|
-
newPtScalars.getData().set(ptScalars.getData(), numPts * newPtScalars.getNumberOfComponents());
|
|
9832
|
-
}
|
|
9833
|
-
numPts += ds.getPoints().getNumberOfPoints();
|
|
9834
|
-
}
|
|
9835
|
-
output.setPoints(points);
|
|
9836
|
-
output.getVerts().setData(vertData);
|
|
9837
|
-
output.getLines().setData(lineData);
|
|
9838
|
-
output.getStrips().setData(stripData);
|
|
9839
|
-
output.getPolys().setData(polyData);
|
|
9840
|
-
if (newPtNormals) {
|
|
9841
|
-
output.getPointData().setNormals(newPtNormals);
|
|
9842
|
-
}
|
|
9843
|
-
if (newPtTCoords) {
|
|
9844
|
-
output.getPointData().setTCoords(newPtTCoords);
|
|
9845
|
-
}
|
|
9846
|
-
if (newPtScalars) {
|
|
9847
|
-
output.getPointData().setScalars(newPtScalars);
|
|
9848
|
-
}
|
|
9849
|
-
outData[0] = output;
|
|
9850
|
-
};
|
|
9851
|
-
}
|
|
9852
|
-
|
|
9853
|
-
// ----------------------------------------------------------------------------
|
|
9854
|
-
// Object factory
|
|
9855
|
-
// ----------------------------------------------------------------------------
|
|
9856
|
-
|
|
9857
|
-
const DEFAULT_VALUES = {
|
|
9858
|
-
outputPointsPrecision: _Common_DataModel_DataSetAttributes_Constants_js__WEBPACK_IMPORTED_MODULE_4__/* .DesiredOutputPrecision */ .kP.DEFAULT
|
|
9859
|
-
};
|
|
9860
|
-
|
|
9861
|
-
// ----------------------------------------------------------------------------
|
|
9862
|
-
|
|
9863
|
-
function extend(publicAPI, model) {
|
|
9864
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
9865
|
-
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
9866
|
-
|
|
9867
|
-
// Build VTK API
|
|
9868
|
-
_macros2_js__WEBPACK_IMPORTED_MODULE_0__.m.setGet(publicAPI, model, ['outputPointsPrecision']);
|
|
9869
|
-
|
|
9870
|
-
// Make this a VTK object
|
|
9871
|
-
_macros2_js__WEBPACK_IMPORTED_MODULE_0__.m.obj(publicAPI, model);
|
|
9872
|
-
|
|
9873
|
-
// Also make it an algorithm with one input and one output
|
|
9874
|
-
_macros2_js__WEBPACK_IMPORTED_MODULE_0__.m.algo(publicAPI, model, 1, 1);
|
|
9875
|
-
|
|
9876
|
-
// Object specific methods
|
|
9877
|
-
vtkAppendPolyData(publicAPI, model);
|
|
9878
|
-
}
|
|
9879
|
-
|
|
9880
|
-
// ----------------------------------------------------------------------------
|
|
9881
|
-
|
|
9882
|
-
const newInstance = _macros2_js__WEBPACK_IMPORTED_MODULE_0__.m.newInstance(extend, 'vtkAppendPolyData');
|
|
9883
|
-
|
|
9884
|
-
// ----------------------------------------------------------------------------
|
|
9885
|
-
|
|
9886
|
-
var vtkAppendPolyData$1 = {
|
|
9887
|
-
newInstance,
|
|
9888
|
-
extend
|
|
9889
|
-
};
|
|
9890
|
-
|
|
9891
|
-
|
|
9892
|
-
|
|
9893
|
-
|
|
9894
|
-
/***/ }),
|
|
9895
|
-
|
|
9896
|
-
/***/ 68749:
|
|
9897
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
9898
|
-
|
|
9899
|
-
"use strict";
|
|
9900
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
9901
|
-
/* harmony export */ A: () => (/* binding */ vtkCaseTable)
|
|
9902
|
-
/* harmony export */ });
|
|
9903
|
-
// ----------------------------------------------------------------------------
|
|
9904
|
-
// Marching squares case functions (using lines to generate the 2D tessellation).
|
|
9905
|
-
// For each case, a list of edge ids that form the triangles. A -1 marks the
|
|
9906
|
-
// end of the list of edges. Edges are taken three at a time to generate
|
|
9907
|
-
// triangle points.
|
|
9908
|
-
// ----------------------------------------------------------------------------
|
|
9909
|
-
const MARCHING_SQUARES_CASES = [[-1, -1, -1, -1, -1] /* 0 */, [0, 3, -1, -1, -1] /* 1 */, [1, 0, -1, -1, -1] /* 2 */, [1, 3, -1, -1, -1] /* 3 */, [2, 1, -1, -1, -1] /* 4 */, [0, 3, 2, 1, -1] /* 5 */, [2, 0, -1, -1, -1] /* 6 */, [2, 3, -1, -1, -1] /* 7 */, [3, 2, -1, -1, -1] /* 8 */, [0, 2, -1, -1, -1] /* 9 */, [1, 0, 3, 2, -1] /* 10 */, [1, 2, -1, -1, -1] /* 11 */, [3, 1, -1, -1, -1] /* 12 */, [0, 1, -1, -1, -1] /* 13 */, [3, 0, -1, -1, -1] /* 14 */, [-1, -1, -1, -1, -1] /* 15 */];
|
|
9910
|
-
|
|
9911
|
-
const EDGES = [[0, 1], [1, 3], [2, 3], [0, 2]];
|
|
9912
|
-
function getCase(index) {
|
|
9913
|
-
return MARCHING_SQUARES_CASES[index];
|
|
9914
|
-
}
|
|
9915
|
-
|
|
9916
|
-
// Define the four edges of the pixel by the following pairs of vertices
|
|
9917
|
-
function getEdge(eid) {
|
|
9918
|
-
return EDGES[eid];
|
|
9919
|
-
}
|
|
9920
|
-
|
|
9921
|
-
// ----------------------------------------------------------------------------
|
|
9922
|
-
// Static API
|
|
9923
|
-
// ----------------------------------------------------------------------------
|
|
9924
|
-
var vtkCaseTable = {
|
|
9925
|
-
getCase,
|
|
9926
|
-
getEdge
|
|
9927
|
-
};
|
|
9848
|
+
// ----------------------------------------------------------------------------
|
|
9849
|
+
// Static API
|
|
9850
|
+
// ----------------------------------------------------------------------------
|
|
9851
|
+
var vtkCaseTable = {
|
|
9852
|
+
getCase,
|
|
9853
|
+
getEdge
|
|
9854
|
+
};
|
|
9928
9855
|
|
|
9929
9856
|
|
|
9930
9857
|
|
|
@@ -14500,7 +14427,7 @@ var vtkAnnotatedCubeActor$1 = {
|
|
|
14500
14427
|
|
|
14501
14428
|
/***/ }),
|
|
14502
14429
|
|
|
14503
|
-
/***/
|
|
14430
|
+
/***/ 43387:
|
|
14504
14431
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
14505
14432
|
|
|
14506
14433
|
"use strict";
|
|
@@ -14522,10 +14449,242 @@ var DataArray = __webpack_require__(45128);
|
|
|
14522
14449
|
var Actor = __webpack_require__(48987);
|
|
14523
14450
|
// EXTERNAL MODULE: ../../../node_modules/@kitware/vtk.js/Rendering/Core/Mapper.js
|
|
14524
14451
|
var Mapper = __webpack_require__(22745);
|
|
14525
|
-
// EXTERNAL MODULE: ../../../node_modules/@kitware/vtk.js/
|
|
14526
|
-
var
|
|
14452
|
+
// EXTERNAL MODULE: ../../../node_modules/@kitware/vtk.js/Common/Core/Points.js
|
|
14453
|
+
var Points = __webpack_require__(18310);
|
|
14527
14454
|
// EXTERNAL MODULE: ../../../node_modules/@kitware/vtk.js/Common/DataModel/PolyData.js + 9 modules
|
|
14528
14455
|
var PolyData = __webpack_require__(27398);
|
|
14456
|
+
// EXTERNAL MODULE: ../../../node_modules/@kitware/vtk.js/Common/DataModel/DataSetAttributes/Constants.js
|
|
14457
|
+
var Constants = __webpack_require__(94884);
|
|
14458
|
+
// EXTERNAL MODULE: ../../../node_modules/@kitware/vtk.js/Common/Core/DataArray/Constants.js
|
|
14459
|
+
var DataArray_Constants = __webpack_require__(82946);
|
|
14460
|
+
;// CONCATENATED MODULE: ../../../node_modules/@kitware/vtk.js/Filters/General/AppendPolyData.js
|
|
14461
|
+
|
|
14462
|
+
|
|
14463
|
+
|
|
14464
|
+
|
|
14465
|
+
|
|
14466
|
+
|
|
14467
|
+
|
|
14468
|
+
const {
|
|
14469
|
+
vtkErrorMacro
|
|
14470
|
+
} = macros2.m;
|
|
14471
|
+
function offsetCellArray(typedArray, offset) {
|
|
14472
|
+
let currentIdx = 0;
|
|
14473
|
+
return typedArray.map((value, index) => {
|
|
14474
|
+
if (index === currentIdx) {
|
|
14475
|
+
currentIdx += value + 1;
|
|
14476
|
+
return value;
|
|
14477
|
+
}
|
|
14478
|
+
return value + offset;
|
|
14479
|
+
});
|
|
14480
|
+
}
|
|
14481
|
+
function appendCellData(dest, src, ptOffset, cellOffset) {
|
|
14482
|
+
dest.set(offsetCellArray(src, ptOffset), cellOffset);
|
|
14483
|
+
}
|
|
14484
|
+
|
|
14485
|
+
// ----------------------------------------------------------------------------
|
|
14486
|
+
// vtkAppendPolyData methods
|
|
14487
|
+
// ----------------------------------------------------------------------------
|
|
14488
|
+
|
|
14489
|
+
function vtkAppendPolyData(publicAPI, model) {
|
|
14490
|
+
// Set our classname
|
|
14491
|
+
model.classHierarchy.push('vtkAppendPolyData');
|
|
14492
|
+
publicAPI.requestData = (inData, outData) => {
|
|
14493
|
+
// implement requestData
|
|
14494
|
+
const numberOfInputs = publicAPI.getNumberOfInputPorts();
|
|
14495
|
+
if (!numberOfInputs) {
|
|
14496
|
+
vtkErrorMacro('No input specified.');
|
|
14497
|
+
return;
|
|
14498
|
+
}
|
|
14499
|
+
if (numberOfInputs === 1) {
|
|
14500
|
+
// pass through filter
|
|
14501
|
+
outData[0] = inData[0];
|
|
14502
|
+
return;
|
|
14503
|
+
}
|
|
14504
|
+
|
|
14505
|
+
// Allocate output
|
|
14506
|
+
const output = PolyData/* default.newInstance */.Ay.newInstance();
|
|
14507
|
+
let numPts = 0;
|
|
14508
|
+
let pointType = 0;
|
|
14509
|
+
let ttype = 1;
|
|
14510
|
+
let firstType = 1;
|
|
14511
|
+
let numVerts = 0;
|
|
14512
|
+
let numLines = 0;
|
|
14513
|
+
let numStrips = 0;
|
|
14514
|
+
let numPolys = 0;
|
|
14515
|
+
|
|
14516
|
+
// Field data is propagated to output only if present in all inputs
|
|
14517
|
+
let hasPtNormals = true; // assume present by default
|
|
14518
|
+
let hasPtTCoords = true;
|
|
14519
|
+
let hasPtScalars = true;
|
|
14520
|
+
for (let i = 0; i < numberOfInputs; i++) {
|
|
14521
|
+
const ds = inData[i];
|
|
14522
|
+
if (!ds) {
|
|
14523
|
+
// eslint-disable-next-line
|
|
14524
|
+
continue;
|
|
14525
|
+
}
|
|
14526
|
+
const dsNumPts = ds.getPoints().getNumberOfPoints();
|
|
14527
|
+
numPts += dsNumPts;
|
|
14528
|
+
numVerts += ds.getVerts().getNumberOfValues();
|
|
14529
|
+
numLines += ds.getLines().getNumberOfValues();
|
|
14530
|
+
numStrips += ds.getStrips().getNumberOfValues();
|
|
14531
|
+
numPolys += ds.getPolys().getNumberOfValues();
|
|
14532
|
+
if (dsNumPts) {
|
|
14533
|
+
if (firstType) {
|
|
14534
|
+
firstType = 0;
|
|
14535
|
+
pointType = ds.getPoints().getDataType();
|
|
14536
|
+
}
|
|
14537
|
+
ttype = ds.getPoints().getDataType();
|
|
14538
|
+
pointType = pointType > ttype ? pointType : ttype;
|
|
14539
|
+
}
|
|
14540
|
+
const ptD = ds.getPointData();
|
|
14541
|
+
if (ptD) {
|
|
14542
|
+
hasPtNormals = hasPtNormals && ptD.getNormals() !== null;
|
|
14543
|
+
hasPtTCoords = hasPtTCoords && ptD.getTCoords() !== null;
|
|
14544
|
+
hasPtScalars = hasPtScalars && ptD.getScalars() !== null;
|
|
14545
|
+
} else {
|
|
14546
|
+
hasPtNormals = false;
|
|
14547
|
+
hasPtTCoords = false;
|
|
14548
|
+
hasPtScalars = false;
|
|
14549
|
+
}
|
|
14550
|
+
}
|
|
14551
|
+
if (model.outputPointsPrecision === Constants/* DesiredOutputPrecision */.kP.SINGLE) {
|
|
14552
|
+
pointType = DataArray_Constants/* VtkDataTypes */.JA.FLOAT;
|
|
14553
|
+
} else if (model.outputPointsPrecision === Constants/* DesiredOutputPrecision */.kP.DOUBLE) {
|
|
14554
|
+
pointType = DataArray_Constants/* VtkDataTypes */.JA.DOUBLE;
|
|
14555
|
+
}
|
|
14556
|
+
const points = Points/* default.newInstance */.Ay.newInstance({
|
|
14557
|
+
dataType: pointType
|
|
14558
|
+
});
|
|
14559
|
+
points.setNumberOfPoints(numPts);
|
|
14560
|
+
const pointData = points.getData();
|
|
14561
|
+
const vertData = new Uint32Array(numVerts);
|
|
14562
|
+
const lineData = new Uint32Array(numLines);
|
|
14563
|
+
const stripData = new Uint32Array(numStrips);
|
|
14564
|
+
const polyData = new Uint32Array(numPolys);
|
|
14565
|
+
let newPtNormals = null;
|
|
14566
|
+
let newPtTCoords = null;
|
|
14567
|
+
let newPtScalars = null;
|
|
14568
|
+
const lds = inData[numberOfInputs - 1];
|
|
14569
|
+
if (hasPtNormals) {
|
|
14570
|
+
const dsNormals = lds.getPointData().getNormals();
|
|
14571
|
+
newPtNormals = DataArray/* default.newInstance */.Ay.newInstance({
|
|
14572
|
+
numberOfComponents: 3,
|
|
14573
|
+
numberOfTuples: numPts,
|
|
14574
|
+
size: 3 * numPts,
|
|
14575
|
+
dataType: dsNormals.getDataType(),
|
|
14576
|
+
name: dsNormals.getName()
|
|
14577
|
+
});
|
|
14578
|
+
}
|
|
14579
|
+
if (hasPtTCoords) {
|
|
14580
|
+
const dsTCoords = lds.getPointData().getTCoords();
|
|
14581
|
+
newPtTCoords = DataArray/* default.newInstance */.Ay.newInstance({
|
|
14582
|
+
numberOfComponents: 2,
|
|
14583
|
+
numberOfTuples: numPts,
|
|
14584
|
+
size: 2 * numPts,
|
|
14585
|
+
dataType: dsTCoords.getDataType(),
|
|
14586
|
+
name: dsTCoords.getName()
|
|
14587
|
+
});
|
|
14588
|
+
}
|
|
14589
|
+
if (hasPtScalars) {
|
|
14590
|
+
const dsScalars = lds.getPointData().getScalars();
|
|
14591
|
+
newPtScalars = DataArray/* default.newInstance */.Ay.newInstance({
|
|
14592
|
+
numberOfComponents: dsScalars.getNumberOfComponents(),
|
|
14593
|
+
numberOfTuples: numPts,
|
|
14594
|
+
size: numPts * dsScalars.getNumberOfComponents(),
|
|
14595
|
+
dataType: dsScalars.getDataType(),
|
|
14596
|
+
name: dsScalars.getName()
|
|
14597
|
+
});
|
|
14598
|
+
}
|
|
14599
|
+
numPts = 0;
|
|
14600
|
+
numVerts = 0;
|
|
14601
|
+
numLines = 0;
|
|
14602
|
+
numStrips = 0;
|
|
14603
|
+
numPolys = 0;
|
|
14604
|
+
for (let i = 0; i < numberOfInputs; i++) {
|
|
14605
|
+
const ds = inData[i];
|
|
14606
|
+
pointData.set(ds.getPoints().getData(), numPts * 3);
|
|
14607
|
+
appendCellData(vertData, ds.getVerts().getData(), numPts, numVerts);
|
|
14608
|
+
numVerts += ds.getVerts().getNumberOfValues();
|
|
14609
|
+
appendCellData(lineData, ds.getLines().getData(), numPts, numLines);
|
|
14610
|
+
numLines += ds.getLines().getNumberOfValues();
|
|
14611
|
+
appendCellData(stripData, ds.getStrips().getData(), numPts, numStrips);
|
|
14612
|
+
numStrips += ds.getStrips().getNumberOfValues();
|
|
14613
|
+
appendCellData(polyData, ds.getPolys().getData(), numPts, numPolys);
|
|
14614
|
+
numPolys += ds.getPolys().getNumberOfValues();
|
|
14615
|
+
const dsPD = ds.getPointData();
|
|
14616
|
+
if (hasPtNormals) {
|
|
14617
|
+
const ptNorms = dsPD.getNormals();
|
|
14618
|
+
newPtNormals.getData().set(ptNorms.getData(), numPts * 3);
|
|
14619
|
+
}
|
|
14620
|
+
if (hasPtTCoords) {
|
|
14621
|
+
const ptTCoords = dsPD.getTCoords();
|
|
14622
|
+
newPtTCoords.getData().set(ptTCoords.getData(), numPts * 2);
|
|
14623
|
+
}
|
|
14624
|
+
if (hasPtScalars) {
|
|
14625
|
+
const ptScalars = dsPD.getScalars();
|
|
14626
|
+
newPtScalars.getData().set(ptScalars.getData(), numPts * newPtScalars.getNumberOfComponents());
|
|
14627
|
+
}
|
|
14628
|
+
numPts += ds.getPoints().getNumberOfPoints();
|
|
14629
|
+
}
|
|
14630
|
+
output.setPoints(points);
|
|
14631
|
+
output.getVerts().setData(vertData);
|
|
14632
|
+
output.getLines().setData(lineData);
|
|
14633
|
+
output.getStrips().setData(stripData);
|
|
14634
|
+
output.getPolys().setData(polyData);
|
|
14635
|
+
if (newPtNormals) {
|
|
14636
|
+
output.getPointData().setNormals(newPtNormals);
|
|
14637
|
+
}
|
|
14638
|
+
if (newPtTCoords) {
|
|
14639
|
+
output.getPointData().setTCoords(newPtTCoords);
|
|
14640
|
+
}
|
|
14641
|
+
if (newPtScalars) {
|
|
14642
|
+
output.getPointData().setScalars(newPtScalars);
|
|
14643
|
+
}
|
|
14644
|
+
outData[0] = output;
|
|
14645
|
+
};
|
|
14646
|
+
}
|
|
14647
|
+
|
|
14648
|
+
// ----------------------------------------------------------------------------
|
|
14649
|
+
// Object factory
|
|
14650
|
+
// ----------------------------------------------------------------------------
|
|
14651
|
+
|
|
14652
|
+
const DEFAULT_VALUES = {
|
|
14653
|
+
outputPointsPrecision: Constants/* DesiredOutputPrecision */.kP.DEFAULT
|
|
14654
|
+
};
|
|
14655
|
+
|
|
14656
|
+
// ----------------------------------------------------------------------------
|
|
14657
|
+
|
|
14658
|
+
function extend(publicAPI, model) {
|
|
14659
|
+
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
14660
|
+
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
14661
|
+
|
|
14662
|
+
// Build VTK API
|
|
14663
|
+
macros2.m.setGet(publicAPI, model, ['outputPointsPrecision']);
|
|
14664
|
+
|
|
14665
|
+
// Make this a VTK object
|
|
14666
|
+
macros2.m.obj(publicAPI, model);
|
|
14667
|
+
|
|
14668
|
+
// Also make it an algorithm with one input and one output
|
|
14669
|
+
macros2.m.algo(publicAPI, model, 1, 1);
|
|
14670
|
+
|
|
14671
|
+
// Object specific methods
|
|
14672
|
+
vtkAppendPolyData(publicAPI, model);
|
|
14673
|
+
}
|
|
14674
|
+
|
|
14675
|
+
// ----------------------------------------------------------------------------
|
|
14676
|
+
|
|
14677
|
+
const newInstance = macros2.m.newInstance(extend, 'vtkAppendPolyData');
|
|
14678
|
+
|
|
14679
|
+
// ----------------------------------------------------------------------------
|
|
14680
|
+
|
|
14681
|
+
var vtkAppendPolyData$1 = {
|
|
14682
|
+
newInstance,
|
|
14683
|
+
extend
|
|
14684
|
+
};
|
|
14685
|
+
|
|
14686
|
+
|
|
14687
|
+
|
|
14529
14688
|
;// CONCATENATED MODULE: ../../../node_modules/@kitware/vtk.js/Filters/Sources/ConeSource.js
|
|
14530
14689
|
|
|
14531
14690
|
|
|
@@ -14605,7 +14764,7 @@ function vtkConeSource(publicAPI, model) {
|
|
|
14605
14764
|
// Object factory
|
|
14606
14765
|
// ----------------------------------------------------------------------------
|
|
14607
14766
|
|
|
14608
|
-
const
|
|
14767
|
+
const ConeSource_DEFAULT_VALUES = {
|
|
14609
14768
|
height: 1.0,
|
|
14610
14769
|
radius: 0.5,
|
|
14611
14770
|
resolution: 6,
|
|
@@ -14617,9 +14776,9 @@ const DEFAULT_VALUES = {
|
|
|
14617
14776
|
|
|
14618
14777
|
// ----------------------------------------------------------------------------
|
|
14619
14778
|
|
|
14620
|
-
function
|
|
14779
|
+
function ConeSource_extend(publicAPI, model) {
|
|
14621
14780
|
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
14622
|
-
Object.assign(model,
|
|
14781
|
+
Object.assign(model, ConeSource_DEFAULT_VALUES, initialValues);
|
|
14623
14782
|
|
|
14624
14783
|
// Build VTK API
|
|
14625
14784
|
macros2.m.obj(publicAPI, model);
|
|
@@ -14631,13 +14790,13 @@ function extend(publicAPI, model) {
|
|
|
14631
14790
|
|
|
14632
14791
|
// ----------------------------------------------------------------------------
|
|
14633
14792
|
|
|
14634
|
-
const
|
|
14793
|
+
const ConeSource_newInstance = macros2.m.newInstance(ConeSource_extend, 'vtkConeSource');
|
|
14635
14794
|
|
|
14636
14795
|
// ----------------------------------------------------------------------------
|
|
14637
14796
|
|
|
14638
14797
|
var vtkConeSource$1 = {
|
|
14639
|
-
newInstance,
|
|
14640
|
-
extend
|
|
14798
|
+
newInstance: ConeSource_newInstance,
|
|
14799
|
+
extend: ConeSource_extend
|
|
14641
14800
|
};
|
|
14642
14801
|
|
|
14643
14802
|
|
|
@@ -14888,7 +15047,7 @@ function vtkArrowSource(publicAPI, model) {
|
|
|
14888
15047
|
|
|
14889
15048
|
// Apply transformation to the cone
|
|
14890
15049
|
MatrixBuilder/* default */.A.buildFromRadian().translate(1.0 - model.tipLength * 0.5, 0.0, 0.0).apply(conePts);
|
|
14891
|
-
const append =
|
|
15050
|
+
const append = vtkAppendPolyData$1.newInstance();
|
|
14892
15051
|
append.setInputData(cylinderPD);
|
|
14893
15052
|
append.addInputData(conePD);
|
|
14894
15053
|
const appendPD = append.getOutputData();
|
|
@@ -15054,7 +15213,7 @@ function vtkAxesActor(publicAPI, model) {
|
|
|
15054
15213
|
shiftDataset(zAxis, 2, currentConfig.invert);
|
|
15055
15214
|
}
|
|
15056
15215
|
addColor(zAxis, ...currentConfig.color);
|
|
15057
|
-
const source =
|
|
15216
|
+
const source = vtkAppendPolyData$1.newInstance();
|
|
15058
15217
|
source.setInputData(xAxis);
|
|
15059
15218
|
source.addInputData(yAxis);
|
|
15060
15219
|
source.addInputData(zAxis);
|