@ohif/app 3.13.0-beta.109 → 3.13.0-beta.110
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/{3454.bundle.b0670a82c99931af.js → 3454.bundle.ab8c63c1e3d46eab.js} +220 -1609
- package/dist/{379.bundle.cacf70fcef530540.js → 379.bundle.75b0fb722268f037.js} +48 -43
- package/dist/{3856.bundle.285a42d08540a74a.js → 3856.bundle.cc247da8b523d738.js} +1 -0
- package/dist/{8274.bundle.a206a2e68e796155.js → 3867.bundle.0d44986c6b0bde7d.js} +663 -1814
- package/dist/{414.bundle.5faf580251ecccc5.js → 414.bundle.adb184d0525a2638.js} +19 -6
- package/dist/{5989.bundle.6a8c5b7de30385c8.js → 5989.bundle.f3905a4493574e09.js} +1106 -804
- package/dist/{6577.bundle.f614df8efd7562f4.js → 6577.bundle.a3e571d5f84837ea.js} +47 -41
- package/dist/{8568.bundle.73ae0a60200a13e0.js → 7579.bundle.9369c6c58a5d6df5.js} +252 -94
- package/dist/{9789.bundle.19323edfc98a32b6.js → 7760.bundle.2b8057d52a6bb394.js} +3399 -389
- package/dist/{4456.bundle.2c6f4bb6de866b88.js → 8565.bundle.a7532bbc39906b3c.js} +50 -7
- package/dist/{9358.bundle.f28c3008748433d0.js → 9358.bundle.6e3ad740c6167bce.js} +2 -2
- package/dist/{app.bundle.02d944bdfbe7f56f.js → app.bundle.2ff5b8155b4cffb1.js} +2256 -820
- package/dist/{compute.bundle.11dbfc2d25ce8e89.js → compute.bundle.4922bddc18cacdbd.js} +3 -3
- package/dist/index.html +1 -1
- package/dist/{polySeg.bundle.485090724c5da16c.js → polySeg.bundle.c549b9f4bad23335.js} +3 -3
- package/dist/sw.js +1 -1
- package/package.json +6 -6
- /package/dist/{100.bundle.b53f62d2c9e9d217.js → 100.bundle.4cf7bd363eb335b7.js} +0 -0
- /package/dist/{1180.bundle.91d7318b888f49d4.js → 1180.bundle.b2242ffb09ba5148.js} +0 -0
- /package/dist/{1602.bundle.82eb27054f87c46e.js → 1602.bundle.82c5d8be3ed58042.js} +0 -0
- /package/dist/{2666.bundle.ba07d670ce889a55.js → 2666.bundle.ee1d4d309ce2ca82.js} +0 -0
- /package/dist/{2779.bundle.2fc7fefe1c4baa18.js → 2779.bundle.357c1cb7a7c97a12.js} +0 -0
- /package/dist/{3500.bundle.1f08c43b36ccb8e8.js → 3500.bundle.d30a0fe9f2c01716.js} +0 -0
- /package/dist/{3760.bundle.2585498b240d6a6a.js → 3760.bundle.954d6b9d91e32698.js} +0 -0
- /package/dist/{4556.bundle.ab9eb35c4157e756.js → 4556.bundle.15bb2344dda86bc2.js} +0 -0
- /package/dist/{4683.bundle.a76560d5378ac6eb.js → 4683.bundle.e8c02628855b8f06.js} +0 -0
- /package/dist/{4834.bundle.16feedbb89a48139.js → 4834.bundle.90a643174dce8dec.js} +0 -0
- /package/dist/{5189.bundle.ef9d707c4c3f31aa.js → 5189.bundle.5ef0d5922ba029ba.js} +0 -0
- /package/dist/{5696.bundle.4c4a7c97de60e8e9.js → 5696.bundle.3c85e69c1cc52c7d.js} +0 -0
- /package/dist/{5708.bundle.6f993438bc9cd1cb.js → 5708.bundle.f4015201f2af7141.js} +0 -0
- /package/dist/{6001.bundle.ea20503d32089842.js → 6001.bundle.27b3105664e9300e.js} +0 -0
- /package/dist/{6650.bundle.29f772517a82ee09.js → 6650.bundle.defab1d01ae0dcba.js} +0 -0
- /package/dist/{7231.bundle.e80ae4c82e76f9aa.js → 7231.bundle.791409f68df0de05.js} +0 -0
- /package/dist/{7248.bundle.759cfc9d51cb3ce1.js → 7248.bundle.f59ba717c33fe7a9.js} +0 -0
- /package/dist/{7295.bundle.669ec6678960bc9b.js → 7295.bundle.ed75fcf8ee66b10a.js} +0 -0
- /package/dist/{8423.bundle.6e8a9d8368e6deb6.js → 8423.bundle.22a629778b9e5e5f.js} +0 -0
- /package/dist/{8832.bundle.5f4cceed2a78111b.js → 8832.bundle.c550b761182eb3f6.js} +0 -0
- /package/dist/{9116.bundle.1b4a60b74cf6e76f.js → 9116.bundle.c002e22cfadc9396.js} +0 -0
- /package/dist/{9290.bundle.8d5e18c97f597402.js → 9290.bundle.a77e843b58fe5013.js} +0 -0
- /package/dist/{9415.bundle.23cdd187e22f3555.js → 9415.bundle.e1cfbd843dd3d63b.js} +0 -0
- /package/dist/{9437.bundle.91da0017f6cf6613.js → 9437.bundle.10d4785589703e3d.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(globalThis["rspackChunk"] = globalThis["rspackChunk"] || []).push([[
|
|
1
|
+
(globalThis["rspackChunk"] = globalThis["rspackChunk"] || []).push([[7579], {
|
|
2
2
|
93952(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
3
3
|
"use strict";
|
|
4
4
|
__webpack_require__.d(__webpack_exports__, {
|
|
@@ -676,7 +676,7 @@ function shouldUseSliceRendering(segmentation, options) {
|
|
|
676
676
|
return false;
|
|
677
677
|
}
|
|
678
678
|
const layers = (0,_labelmapModel_labelmapLayerStore__rspack_import_2/* .getLabelmaps */.m)(segmentation);
|
|
679
|
-
return layers.length > 1 && layers.some((layer) => layer.
|
|
679
|
+
return (layers.length > 1 && layers.some((layer) => layer.storageKind === 'stack'));
|
|
680
680
|
}
|
|
681
681
|
function canRenderVolumeViewportLabelmapAsImage(viewport) {
|
|
682
682
|
const isLegacyVolumeViewport = viewport instanceof _cornerstonejs_core__rspack_import_0.VolumeViewport;
|
|
@@ -1650,14 +1650,16 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
1650
1650
|
});
|
|
1651
1651
|
/* import */ var _cornerstonejs_core__rspack_import_0 = __webpack_require__(70594);
|
|
1652
1652
|
/* import */ var _base__rspack_import_1 = __webpack_require__(85817);
|
|
1653
|
-
/* import */ var
|
|
1654
|
-
/* import */ var
|
|
1655
|
-
/* import */ var
|
|
1656
|
-
/* import */ var
|
|
1657
|
-
/* import */ var
|
|
1658
|
-
/* import */ var
|
|
1659
|
-
/* import */ var
|
|
1660
|
-
/* import */ var
|
|
1653
|
+
/* import */ var _utilities_getViewportICamera__rspack_import_2 = __webpack_require__(29604);
|
|
1654
|
+
/* import */ var _enums__rspack_import_3 = __webpack_require__(87937);
|
|
1655
|
+
/* import */ var _stateManagement_segmentation__rspack_import_4 = __webpack_require__(67482);
|
|
1656
|
+
/* import */ var _stateManagement_segmentation_triggerSegmentationEvents__rspack_import_5 = __webpack_require__(53809);
|
|
1657
|
+
/* import */ var _utilities_segmentation_growCut_constants__rspack_import_6 = __webpack_require__(10564);
|
|
1658
|
+
/* import */ var _utilities_segmentation_getSVGStyleForSegment__rspack_import_7 = __webpack_require__(86644);
|
|
1659
|
+
/* import */ var _utilities_segmentation_islandRemoval__rspack_import_8 = __webpack_require__(67912);
|
|
1660
|
+
/* import */ var _utilities_segmentation__rspack_import_9 = __webpack_require__(93759);
|
|
1661
|
+
/* import */ var _stateManagement_segmentation_getCurrentLabelmapImageIdForViewport__rspack_import_10 = __webpack_require__(97577);
|
|
1662
|
+
|
|
1661
1663
|
|
|
1662
1664
|
|
|
1663
1665
|
|
|
@@ -1688,7 +1690,7 @@ class GrowCutBaseTool extends _base__rspack_import_1/* .BaseTool */.oS {
|
|
|
1688
1690
|
const { world: worldPoint } = currentPoints;
|
|
1689
1691
|
const enabledElement = (0,_cornerstonejs_core__rspack_import_0.getEnabledElement)(element);
|
|
1690
1692
|
const { viewport, renderingEngine } = enabledElement;
|
|
1691
|
-
const { viewUp } =
|
|
1693
|
+
const { viewUp } = (0,_utilities_getViewportICamera__rspack_import_2/* ["default"] */.A)(viewport);
|
|
1692
1694
|
const { segmentationId, segmentIndex, labelmapVolumeId, referencedVolumeId, } = await this.getLabelmapSegmentationData(viewport);
|
|
1693
1695
|
if (!this._isOrthogonalView(viewport, referencedVolumeId)) {
|
|
1694
1696
|
throw new Error('Oblique view is not supported yet');
|
|
@@ -1786,7 +1788,7 @@ class GrowCutBaseTool extends _base__rspack_import_1/* .BaseTool */.oS {
|
|
|
1786
1788
|
}
|
|
1787
1789
|
}
|
|
1788
1790
|
}
|
|
1789
|
-
(0,
|
|
1791
|
+
(0,_stateManagement_segmentation_triggerSegmentationEvents__rspack_import_5.triggerSegmentationDataModified)(segmentationId);
|
|
1790
1792
|
}
|
|
1791
1793
|
applyGrowCutLabelmap(segmentationId, segmentIndex, targetLabelmap, sourceLabelmap) {
|
|
1792
1794
|
const tgtVoxelManager = targetLabelmap.voxelManager;
|
|
@@ -1796,7 +1798,7 @@ class GrowCutBaseTool extends _base__rspack_import_1/* .BaseTool */.oS {
|
|
|
1796
1798
|
tgtVoxelManager.setAtIndex(index, value);
|
|
1797
1799
|
}
|
|
1798
1800
|
});
|
|
1799
|
-
(0,
|
|
1801
|
+
(0,_stateManagement_segmentation_triggerSegmentationEvents__rspack_import_5.triggerSegmentationDataModified)(segmentationId);
|
|
1800
1802
|
}
|
|
1801
1803
|
_runLastCommand({ shrinkExpandAmount = 0 } = {}) {
|
|
1802
1804
|
const cmd = GrowCutBaseTool.lastGrowCutCommand;
|
|
@@ -1805,14 +1807,14 @@ class GrowCutBaseTool extends _base__rspack_import_1/* .BaseTool */.oS {
|
|
|
1805
1807
|
}
|
|
1806
1808
|
}
|
|
1807
1809
|
async getLabelmapSegmentationData(viewport) {
|
|
1808
|
-
const activeSeg =
|
|
1810
|
+
const activeSeg = _stateManagement_segmentation__rspack_import_4.activeSegmentation.getActiveSegmentation(viewport.id);
|
|
1809
1811
|
if (!activeSeg) {
|
|
1810
1812
|
throw new Error('No active segmentation found');
|
|
1811
1813
|
}
|
|
1812
1814
|
const { segmentationId } = activeSeg;
|
|
1813
|
-
const segmentIndex =
|
|
1814
|
-
const { representationData } =
|
|
1815
|
-
const labelmapData = representationData[
|
|
1815
|
+
const segmentIndex = _stateManagement_segmentation__rspack_import_4.segmentIndex.getActiveSegmentIndex(segmentationId);
|
|
1816
|
+
const { representationData } = _stateManagement_segmentation__rspack_import_4.state.getSegmentation(segmentationId);
|
|
1817
|
+
const labelmapData = representationData[_enums__rspack_import_3.SegmentationRepresentations.Labelmap];
|
|
1816
1818
|
let { volumeId: labelmapVolumeId, referencedVolumeId } = labelmapData;
|
|
1817
1819
|
if (!labelmapVolumeId) {
|
|
1818
1820
|
const referencedImageIds = viewport.getImageIds();
|
|
@@ -1825,7 +1827,7 @@ class GrowCutBaseTool extends _base__rspack_import_1/* .BaseTool */.oS {
|
|
|
1825
1827
|
fakeImage.imageId,
|
|
1826
1828
|
]);
|
|
1827
1829
|
referencedVolumeId = fakeVolume.volumeId;
|
|
1828
|
-
const currentLabelmapImageId = (0,
|
|
1830
|
+
const currentLabelmapImageId = (0,_stateManagement_segmentation_getCurrentLabelmapImageIdForViewport__rspack_import_10/* .getCurrentLabelmapImageIdForViewport */.vl)(viewport.id, segmentationId);
|
|
1829
1831
|
const fakeDerivedImage = _cornerstonejs_core__rspack_import_0.imageLoader.createAndCacheDerivedImage(currentLabelmapImageId);
|
|
1830
1832
|
const fakeLabelmapVolume = this._createFakeVolume([
|
|
1831
1833
|
currentLabelmapImageId,
|
|
@@ -1834,7 +1836,7 @@ class GrowCutBaseTool extends _base__rspack_import_1/* .BaseTool */.oS {
|
|
|
1834
1836
|
labelmapVolumeId = fakeLabelmapVolume.volumeId;
|
|
1835
1837
|
}
|
|
1836
1838
|
else {
|
|
1837
|
-
const segVolume = (0,
|
|
1839
|
+
const segVolume = (0,_utilities_segmentation__rspack_import_9.getOrCreateSegmentationVolume)(segmentationId);
|
|
1838
1840
|
labelmapVolumeId = segVolume.volumeId;
|
|
1839
1841
|
}
|
|
1840
1842
|
}
|
|
@@ -1883,7 +1885,7 @@ class GrowCutBaseTool extends _base__rspack_import_1/* .BaseTool */.oS {
|
|
|
1883
1885
|
_isOrthogonalView(viewport, referencedVolumeId) {
|
|
1884
1886
|
const volume = _cornerstonejs_core__rspack_import_0.cache.getVolume(referencedVolumeId);
|
|
1885
1887
|
const volumeImageData = volume.imageData;
|
|
1886
|
-
const camera =
|
|
1888
|
+
const camera = (0,_utilities_getViewportICamera__rspack_import_2/* ["default"] */.A)(viewport);
|
|
1887
1889
|
const { ijkVecColDir, ijkVecSliceDir } = _cornerstonejs_core__rspack_import_0.utilities.getVolumeDirectionVectors(volumeImageData, camera);
|
|
1888
1890
|
return [ijkVecColDir, ijkVecSliceDir].every((vec) => _cornerstonejs_core__rspack_import_0.utilities.isEqual(Math.abs(vec[0]), 1) ||
|
|
1889
1891
|
_cornerstonejs_core__rspack_import_0.utilities.isEqual(Math.abs(vec[1]), 1) ||
|
|
@@ -1910,7 +1912,7 @@ class GrowCutBaseTool extends _base__rspack_import_1/* .BaseTool */.oS {
|
|
|
1910
1912
|
const renderingEngine = (0,_cornerstonejs_core__rspack_import_0.getRenderingEngine)(renderingEngineId);
|
|
1911
1913
|
const viewport = renderingEngine.getViewport(viewportId);
|
|
1912
1914
|
const { voxelManager } = labelmap;
|
|
1913
|
-
const islandRemoval = new
|
|
1915
|
+
const islandRemoval = new _utilities_segmentation_islandRemoval__rspack_import_8/* ["default"] */.A();
|
|
1914
1916
|
ijkIslandPoints = ijkIslandPoints.concat(worldIslandPoints.map((worldPoint) => transformWorldToIndex(labelmap.imageData, worldPoint)));
|
|
1915
1917
|
ijkIslandPoints = ijkIslandPoints.concat(islandPointIndexes.map((pointIndex) => {
|
|
1916
1918
|
const x = pointIndex % width;
|
|
@@ -1928,7 +1930,7 @@ class GrowCutBaseTool extends _base__rspack_import_1/* .BaseTool */.oS {
|
|
|
1928
1930
|
islandRemoval.removeInternalIslands();
|
|
1929
1931
|
}
|
|
1930
1932
|
getSegmentStyle({ segmentationId, viewportId, segmentIndex }) {
|
|
1931
|
-
return (0,
|
|
1933
|
+
return (0,_utilities_segmentation_getSVGStyleForSegment__rspack_import_7/* .getSVGStyleForSegment */.u)({
|
|
1932
1934
|
segmentationId,
|
|
1933
1935
|
segmentIndex,
|
|
1934
1936
|
viewportId,
|
|
@@ -1959,6 +1961,8 @@ var annotationState = __webpack_require__(82056);
|
|
|
1959
1961
|
var annotationHydration = __webpack_require__(64485);
|
|
1960
1962
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contourSegmentation/index.js
|
|
1961
1963
|
var contourSegmentation = __webpack_require__(64843);
|
|
1964
|
+
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/getViewportICamera.js
|
|
1965
|
+
var getViewportICamera = __webpack_require__(29604);
|
|
1962
1966
|
// EXTERNAL MODULE: ../../../node_modules/@kitware/vtk.js/Common/Core/CellArray.js
|
|
1963
1967
|
var CellArray = __webpack_require__(32461);
|
|
1964
1968
|
// EXTERNAL MODULE: ../../../node_modules/@kitware/vtk.js/Common/Core/Points.js
|
|
@@ -2020,6 +2024,7 @@ var SegmentationStyle = __webpack_require__(92686);
|
|
|
2020
2024
|
|
|
2021
2025
|
|
|
2022
2026
|
|
|
2027
|
+
|
|
2023
2028
|
function handleContourSegmentation(viewport, geometryIds, annotationUIDsMap, contourRepresentation) {
|
|
2024
2029
|
if (annotationUIDsMap.size) {
|
|
2025
2030
|
viewport.render();
|
|
@@ -2046,7 +2051,7 @@ function addContourSetsToElement(viewport, geometryIds, contourRepresentation) {
|
|
|
2046
2051
|
segmentIndex,
|
|
2047
2052
|
});
|
|
2048
2053
|
const contourSet = geometry.data;
|
|
2049
|
-
const viewPlaneNormal =
|
|
2054
|
+
const viewPlaneNormal = (0,getViewportICamera/* ["default"] */.A)(viewport).viewPlaneNormal;
|
|
2050
2055
|
contourSet.contours.forEach((contour) => {
|
|
2051
2056
|
const { points, color, id } = contour;
|
|
2052
2057
|
const referencedImageId = (0,annotationHydration/* .getClosestImageIdForStackViewport */.x)(viewport, points[0], viewPlaneNormal);
|
|
@@ -2075,7 +2080,7 @@ function addContourSetsToElement(viewport, geometryIds, contourRepresentation) {
|
|
|
2075
2080
|
referencedImageId,
|
|
2076
2081
|
toolName: 'PlanarFreehandContourSegmentationTool',
|
|
2077
2082
|
FrameOfReferenceUID: viewport.getFrameOfReferenceUID(),
|
|
2078
|
-
viewPlaneNormal
|
|
2083
|
+
viewPlaneNormal,
|
|
2079
2084
|
},
|
|
2080
2085
|
};
|
|
2081
2086
|
const annotationGroupSelector = viewport.element;
|
|
@@ -2127,6 +2132,7 @@ var gl_matrix_esm = __webpack_require__(40230);
|
|
|
2127
2132
|
|
|
2128
2133
|
|
|
2129
2134
|
|
|
2135
|
+
|
|
2130
2136
|
const polySegConversionInProgressForViewportId = new Map();
|
|
2131
2137
|
const processedViewportSegmentations = new Map();
|
|
2132
2138
|
function removeRepresentation(viewportId, segmentationId, renderImmediate = false) {
|
|
@@ -2170,7 +2176,7 @@ async function render(viewport, contourRepresentation) {
|
|
|
2170
2176
|
return;
|
|
2171
2177
|
}
|
|
2172
2178
|
let hasContourDataButNotMatchingViewport = false;
|
|
2173
|
-
const viewportNormal =
|
|
2179
|
+
const viewportNormal = (0,getViewportICamera/* ["default"] */.A)(viewport).viewPlaneNormal;
|
|
2174
2180
|
if (contourData.annotationUIDsMap) {
|
|
2175
2181
|
hasContourDataButNotMatchingViewport = !_checkContourNormalsMatchViewport(contourData.annotationUIDsMap, viewportNormal);
|
|
2176
2182
|
}
|
|
@@ -3042,7 +3048,7 @@ async function addLabelmapToPlanarGenericViewport(args) {
|
|
|
3042
3048
|
referencedId: layer.labelmapId,
|
|
3043
3049
|
});
|
|
3044
3050
|
const dataId = representationUID;
|
|
3045
|
-
esm.utilities.
|
|
3051
|
+
esm.utilities.genericViewportDisplaySetMetadataProvider.add(dataId, {
|
|
3046
3052
|
kind: 'planar',
|
|
3047
3053
|
imageIds: volume.imageIds,
|
|
3048
3054
|
initialImageIdIndex: Math.min(currentImageIdIndex, Math.max(volume.imageIds.length - 1, 0)),
|
|
@@ -3134,7 +3140,7 @@ async function mountLegacyVolumeLabelmap({ config, labelMapData, segmentation, s
|
|
|
3134
3140
|
}
|
|
3135
3141
|
labelmapLayers.push({
|
|
3136
3142
|
labelmapId: volumeId,
|
|
3137
|
-
|
|
3143
|
+
storageKind: 'volume',
|
|
3138
3144
|
volumeId,
|
|
3139
3145
|
imageIds: esm.cache.getVolume(volumeId)?.imageIds,
|
|
3140
3146
|
});
|
|
@@ -3143,16 +3149,28 @@ async function mountLegacyVolumeLabelmap({ config, labelMapData, segmentation, s
|
|
|
3143
3149
|
let useIndependentComponents = blendMode === esm.Enums.BlendModes.LABELMAP_EDGE_PROJECTION_BLEND;
|
|
3144
3150
|
if (useIndependentComponents) {
|
|
3145
3151
|
const referenceVolumeId = volumeCompatibleViewport.getVolumeId?.();
|
|
3146
|
-
const
|
|
3147
|
-
const
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3152
|
+
const segLabelmapVolumeId = labelmapLayers[0]?.volumeId;
|
|
3153
|
+
const baseVolume = referenceVolumeId
|
|
3154
|
+
? esm.cache.getVolume(referenceVolumeId)
|
|
3155
|
+
: undefined;
|
|
3156
|
+
const segVolume = segLabelmapVolumeId
|
|
3157
|
+
? esm.cache.getVolume(segLabelmapVolumeId)
|
|
3158
|
+
: undefined;
|
|
3159
|
+
if (!baseVolume || !segVolume) {
|
|
3153
3160
|
useIndependentComponents = false;
|
|
3154
3161
|
blendMode = esm.Enums.BlendModes.MAXIMUM_INTENSITY_BLEND;
|
|
3155
|
-
console.debug('
|
|
3162
|
+
console.debug('Independent components unavailable (missing reference or segmentation volume) - falling back to regular volume addition');
|
|
3163
|
+
}
|
|
3164
|
+
else {
|
|
3165
|
+
const segDims = segVolume.dimensions;
|
|
3166
|
+
const refDims = baseVolume.dimensions;
|
|
3167
|
+
if (segDims[0] !== refDims[0] ||
|
|
3168
|
+
segDims[1] !== refDims[1] ||
|
|
3169
|
+
segDims[2] !== refDims[2]) {
|
|
3170
|
+
useIndependentComponents = false;
|
|
3171
|
+
blendMode = esm.Enums.BlendModes.MAXIMUM_INTENSITY_BLEND;
|
|
3172
|
+
console.debug('Dimensions mismatch - falling back to regular volume addition');
|
|
3173
|
+
}
|
|
3156
3174
|
}
|
|
3157
3175
|
}
|
|
3158
3176
|
const volumeInputs = labelmapLayers.map((layer) => ({
|
|
@@ -3744,7 +3762,7 @@ function removeLabelmapRepresentationData(viewport, segmentationId, actorEntry)
|
|
|
3744
3762
|
if (typeof dataViewport.removeData !== 'function') {
|
|
3745
3763
|
return false;
|
|
3746
3764
|
}
|
|
3747
|
-
_cornerstonejs_core__rspack_import_0.utilities.
|
|
3765
|
+
_cornerstonejs_core__rspack_import_0.utilities.genericViewportDisplaySetMetadataProvider.remove(representationUID);
|
|
3748
3766
|
dataViewport.removeData(representationUID);
|
|
3749
3767
|
return true;
|
|
3750
3768
|
}
|
|
@@ -3759,14 +3777,16 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
3759
3777
|
});
|
|
3760
3778
|
/* import */ var _kitware_vtk_js_Common_Core_DataArray__rspack_import_0 = __webpack_require__(445);
|
|
3761
3779
|
/* import */ var _kitware_vtk_js_Common_DataModel_ImageData__rspack_import_1 = __webpack_require__(26393);
|
|
3762
|
-
/* import */ var
|
|
3763
|
-
/* import */ var
|
|
3764
|
-
/* import */ var
|
|
3765
|
-
/* import */ var
|
|
3766
|
-
/* import */ var
|
|
3767
|
-
/* import */ var
|
|
3768
|
-
/* import */ var
|
|
3769
|
-
/* import */ var
|
|
3780
|
+
/* import */ var _kitware_vtk_js_Common_DataModel_PiecewiseFunction__rspack_import_2 = __webpack_require__(30678);
|
|
3781
|
+
/* import */ var _cornerstonejs_core__rspack_import_3 = __webpack_require__(70594);
|
|
3782
|
+
/* import */ var _stateManagement_segmentation_SegmentationRenderingEngine__rspack_import_4 = __webpack_require__(24917);
|
|
3783
|
+
/* import */ var _stateManagement_segmentation_updateLabelmapSegmentationImageReferences__rspack_import_5 = __webpack_require__(78231);
|
|
3784
|
+
/* import */ var _stateManagement_segmentation_getCurrentLabelmapImageIdForViewport__rspack_import_6 = __webpack_require__(97577);
|
|
3785
|
+
/* import */ var _stateManagement_segmentation_helpers_getSegmentationActor__rspack_import_7 = __webpack_require__(59452);
|
|
3786
|
+
/* import */ var _stateManagement_segmentation_helpers_getViewportLabelmapRenderMode__rspack_import_8 = __webpack_require__(33214);
|
|
3787
|
+
/* import */ var _labelmapRepresentationUID__rspack_import_9 = __webpack_require__(5959);
|
|
3788
|
+
/* import */ var _removeLabelmapRepresentationData__rspack_import_10 = __webpack_require__(24393);
|
|
3789
|
+
|
|
3770
3790
|
|
|
3771
3791
|
|
|
3772
3792
|
|
|
@@ -3786,17 +3806,18 @@ function syncStackLabelmapActors(viewport, segmentationId) {
|
|
|
3786
3806
|
if (!currentImageId) {
|
|
3787
3807
|
return;
|
|
3788
3808
|
}
|
|
3789
|
-
(0,
|
|
3790
|
-
const derivedImageIds = (0,
|
|
3809
|
+
(0,_stateManagement_segmentation_updateLabelmapSegmentationImageReferences__rspack_import_5/* .updateLabelmapSegmentationImageReferences */.t)(viewport.id, segmentationId);
|
|
3810
|
+
const derivedImageIds = (0,_stateManagement_segmentation_getCurrentLabelmapImageIdForViewport__rspack_import_6/* .getCurrentLabelmapImageIdsForViewport */.aF)(viewport.id, segmentationId) ?? [];
|
|
3791
3811
|
const derivedImageIdSet = new Set(derivedImageIds);
|
|
3792
|
-
const labelmapActorEntries = (0,
|
|
3812
|
+
const labelmapActorEntries = (0,_stateManagement_segmentation_helpers_getSegmentationActor__rspack_import_7/* .getLabelmapActorEntries */.ED)(viewport.id, segmentationId) ?? [];
|
|
3793
3813
|
const staleActorEntries = labelmapActorEntries.filter((actorEntry) => !derivedImageIdSet.has(actorEntry.referencedId));
|
|
3814
|
+
const inheritedLabelmapStyle = captureLabelmapActorStyle(staleActorEntries[0]?.actor);
|
|
3794
3815
|
let shouldTriggerSegmentationRender = false;
|
|
3795
3816
|
let shouldRenderViewport = staleActorEntries.length > 0;
|
|
3796
3817
|
if (staleActorEntries.length) {
|
|
3797
3818
|
const legacyActorEntryUIDs = [];
|
|
3798
3819
|
staleActorEntries.forEach((actorEntry) => {
|
|
3799
|
-
if ((0,
|
|
3820
|
+
if ((0,_removeLabelmapRepresentationData__rspack_import_10/* ["default"] */.A)(viewport, segmentationId, actorEntry)) {
|
|
3800
3821
|
return;
|
|
3801
3822
|
}
|
|
3802
3823
|
legacyActorEntryUIDs.push(actorEntry.uid);
|
|
@@ -3806,28 +3827,28 @@ function syncStackLabelmapActors(viewport, segmentationId) {
|
|
|
3806
3827
|
}
|
|
3807
3828
|
shouldTriggerSegmentationRender = true;
|
|
3808
3829
|
}
|
|
3809
|
-
const renderMode = (0,
|
|
3830
|
+
const renderMode = (0,_stateManagement_segmentation_helpers_getViewportLabelmapRenderMode__rspack_import_8/* ["default"] */.A)(viewport);
|
|
3810
3831
|
const defaultActorRenderMode = viewport.getDefaultActor()?.actorMapper
|
|
3811
3832
|
?.renderMode;
|
|
3812
|
-
const currentImage =
|
|
3833
|
+
const currentImage = _cornerstonejs_core__rspack_import_3.cache.getImage(currentImageId) ||
|
|
3813
3834
|
{
|
|
3814
3835
|
imageId: currentImageId,
|
|
3815
3836
|
};
|
|
3816
3837
|
const { origin: currentOrigin } = viewport.getImageDataMetadata(currentImage);
|
|
3817
3838
|
derivedImageIds.forEach((derivedImageId) => {
|
|
3818
|
-
const derivedImage =
|
|
3839
|
+
const derivedImage = _cornerstonejs_core__rspack_import_3.cache.getImage(derivedImageId);
|
|
3819
3840
|
if (!derivedImage) {
|
|
3820
3841
|
console.warn('No derived image found in the cache for segmentation representation', { segmentationId, derivedImageId });
|
|
3821
3842
|
return;
|
|
3822
3843
|
}
|
|
3823
|
-
const segmentationActorEntry = (0,
|
|
3844
|
+
const segmentationActorEntry = (0,_stateManagement_segmentation_helpers_getSegmentationActor__rspack_import_7/* .getLabelmapActorEntries */.ED)(viewport.id, segmentationId)?.find((actorEntry) => actorEntry.referencedId === derivedImageId);
|
|
3824
3845
|
if (!segmentationActorEntry) {
|
|
3825
|
-
const representationUID = (0,
|
|
3846
|
+
const representationUID = (0,_labelmapRepresentationUID__rspack_import_9/* .createLabelmapRepresentationUID */.Ox)({
|
|
3826
3847
|
segmentationId,
|
|
3827
3848
|
referencedId: derivedImage.imageId,
|
|
3828
3849
|
});
|
|
3829
3850
|
if (renderMode === 'image' &&
|
|
3830
|
-
defaultActorRenderMode ===
|
|
3851
|
+
defaultActorRenderMode === _cornerstonejs_core__rspack_import_3.ActorRenderMode.CPU_IMAGE) {
|
|
3831
3852
|
viewport.addImages([
|
|
3832
3853
|
{
|
|
3833
3854
|
dataId: representationUID,
|
|
@@ -3873,6 +3894,7 @@ function syncStackLabelmapActors(viewport, segmentationId) {
|
|
|
3873
3894
|
representationUID,
|
|
3874
3895
|
callback: ({ imageActor }) => {
|
|
3875
3896
|
imageActor.getMapper().setInputData(imageData);
|
|
3897
|
+
applyInheritedLabelmapStyle(imageActor, inheritedLabelmapStyle);
|
|
3876
3898
|
},
|
|
3877
3899
|
},
|
|
3878
3900
|
]);
|
|
@@ -3891,17 +3913,50 @@ function syncStackLabelmapActors(viewport, segmentationId) {
|
|
|
3891
3913
|
segmentationImageData.setDerivedImage(derivedImage);
|
|
3892
3914
|
}
|
|
3893
3915
|
else {
|
|
3894
|
-
|
|
3916
|
+
_cornerstonejs_core__rspack_import_3.utilities.updateVTKImageDataWithCornerstoneImage(segmentationImageData, derivedImage);
|
|
3895
3917
|
}
|
|
3896
3918
|
shouldRenderViewport = true;
|
|
3897
3919
|
});
|
|
3898
3920
|
if (shouldTriggerSegmentationRender) {
|
|
3899
|
-
(0,
|
|
3921
|
+
(0,_stateManagement_segmentation_SegmentationRenderingEngine__rspack_import_4/* .triggerSegmentationRender */.h6)(viewport.id);
|
|
3900
3922
|
}
|
|
3901
3923
|
if (shouldRenderViewport) {
|
|
3902
3924
|
viewport.render();
|
|
3903
3925
|
}
|
|
3904
3926
|
}
|
|
3927
|
+
function captureLabelmapActorStyle(actor) {
|
|
3928
|
+
const prop = actor?.getProperty?.();
|
|
3929
|
+
if (!prop) {
|
|
3930
|
+
return undefined;
|
|
3931
|
+
}
|
|
3932
|
+
return {
|
|
3933
|
+
cfun: prop.getRGBTransferFunction?.(0),
|
|
3934
|
+
ofun: prop.getScalarOpacity?.(0),
|
|
3935
|
+
};
|
|
3936
|
+
}
|
|
3937
|
+
function applyInheritedLabelmapStyle(actor, style) {
|
|
3938
|
+
const prop = actor?.getProperty?.();
|
|
3939
|
+
if (!prop) {
|
|
3940
|
+
return;
|
|
3941
|
+
}
|
|
3942
|
+
if (style?.cfun && prop.setRGBTransferFunction) {
|
|
3943
|
+
prop.setRGBTransferFunction(0, style.cfun);
|
|
3944
|
+
}
|
|
3945
|
+
if (style?.ofun && prop.setScalarOpacity) {
|
|
3946
|
+
prop.setScalarOpacity(0, style.ofun);
|
|
3947
|
+
}
|
|
3948
|
+
else if (prop.setScalarOpacity) {
|
|
3949
|
+
const ofun = _kitware_vtk_js_Common_DataModel_PiecewiseFunction__rspack_import_2/* ["default"].newInstance */.Ay.newInstance();
|
|
3950
|
+
ofun.addPoint(0, 0);
|
|
3951
|
+
ofun.addPoint(1, 1);
|
|
3952
|
+
ofun.setClamping(false);
|
|
3953
|
+
prop.setScalarOpacity(0, ofun);
|
|
3954
|
+
}
|
|
3955
|
+
prop.setUseLookupTableScalarRange?.(true);
|
|
3956
|
+
prop.setInterpolationTypeToNearest?.();
|
|
3957
|
+
actor?.setForceTranslucent?.(true);
|
|
3958
|
+
actor?.setForceOpaque?.(false);
|
|
3959
|
+
}
|
|
3905
3960
|
|
|
3906
3961
|
|
|
3907
3962
|
},
|
|
@@ -4931,16 +4986,13 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
4931
4986
|
j: () => (getVOIMultipliers)
|
|
4932
4987
|
});
|
|
4933
4988
|
/* import */ var _cornerstonejs_core__rspack_import_0 = __webpack_require__(70594);
|
|
4934
|
-
/* import */ var _viewport__rspack_import_1 = __webpack_require__(19027);
|
|
4935
|
-
|
|
4936
4989
|
|
|
4937
4990
|
const DEFAULT_MULTIPLIER = 4;
|
|
4938
4991
|
function getVOIMultipliers(viewport, volumeId, options) {
|
|
4939
|
-
const modality = _cornerstonejs_core__rspack_import_0.utilities.
|
|
4992
|
+
const { modality, isPreScaled } = _cornerstonejs_core__rspack_import_0.utilities.getScalingDescriptor(viewport, volumeId) ?? {};
|
|
4940
4993
|
if (modality === 'PT') {
|
|
4941
4994
|
const { clientWidth, clientHeight } = viewport.element;
|
|
4942
4995
|
const ptMultiplier = 5 / Math.max(clientWidth, clientHeight);
|
|
4943
|
-
const isPreScaled = (0,_viewport__rspack_import_1.isViewportPreScaled)(viewport, volumeId);
|
|
4944
4996
|
const { fixedPTWindowWidth = true } = options ?? {};
|
|
4945
4997
|
const xMultiplier = fixedPTWindowWidth ? 0 : ptMultiplier;
|
|
4946
4998
|
return isPreScaled
|
|
@@ -5993,9 +6045,11 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
5993
6045
|
/* import */ var _stateManagement_segmentation_segmentationState__rspack_import_2 = __webpack_require__(19806);
|
|
5994
6046
|
/* import */ var _stateManagement__rspack_import_3 = __webpack_require__(6802);
|
|
5995
6047
|
/* import */ var _math_polyline__rspack_import_4 = __webpack_require__(3549);
|
|
5996
|
-
/* import */ var
|
|
5997
|
-
/* import */ var
|
|
5998
|
-
/* import */ var
|
|
6048
|
+
/* import */ var _planar_filterAnnotationsForDisplay__rspack_import_5 = __webpack_require__(94418);
|
|
6049
|
+
/* import */ var _stateManagement_segmentation_helpers_getSegmentationActor__rspack_import_6 = __webpack_require__(59452);
|
|
6050
|
+
/* import */ var _stateManagement_segmentation_helpers_getViewportLabelmapRenderMode__rspack_import_7 = __webpack_require__(33214);
|
|
6051
|
+
/* import */ var _stateManagement_segmentation_helpers_labelmapSegmentationState__rspack_import_8 = __webpack_require__(90660);
|
|
6052
|
+
|
|
5999
6053
|
|
|
6000
6054
|
|
|
6001
6055
|
|
|
@@ -6022,20 +6076,22 @@ function getSegmentIndexAtWorldPoint(segmentationId, worldPoint, options = {}) {
|
|
|
6022
6076
|
}
|
|
6023
6077
|
function getSegmentIndexAtWorldForLabelmap(segmentation, worldPoint, { viewport }) {
|
|
6024
6078
|
const viewportRenderMode = viewport
|
|
6025
|
-
? (0,
|
|
6079
|
+
? (0,_stateManagement_segmentation_helpers_getViewportLabelmapRenderMode__rspack_import_7/* ["default"] */.A)(viewport)
|
|
6026
6080
|
: 'unsupported';
|
|
6027
6081
|
if (viewportRenderMode === 'volume' ||
|
|
6028
6082
|
viewport instanceof _cornerstonejs_core__rspack_import_0.BaseVolumeViewport) {
|
|
6029
|
-
for (const layer of (0,
|
|
6030
|
-
const segmentationVolume = (0,
|
|
6083
|
+
for (const layer of (0,_stateManagement_segmentation_helpers_labelmapSegmentationState__rspack_import_8/* .getLabelmaps */.m)(segmentation)) {
|
|
6084
|
+
const segmentationVolume = (0,_stateManagement_segmentation_helpers_labelmapSegmentationState__rspack_import_8/* .getOrCreateLabelmapVolume */.kL)(layer);
|
|
6031
6085
|
if (!segmentationVolume) {
|
|
6032
6086
|
continue;
|
|
6033
6087
|
}
|
|
6034
|
-
const
|
|
6088
|
+
const voxelManager = segmentationVolume.voxelManager;
|
|
6089
|
+
const indexIJK = _cornerstonejs_core__rspack_import_0.utilities.transformWorldToIndex(segmentationVolume.imageData, worldPoint);
|
|
6090
|
+
const labelValue = voxelManager.getAtIJKPoint(indexIJK);
|
|
6035
6091
|
if (!labelValue) {
|
|
6036
6092
|
continue;
|
|
6037
6093
|
}
|
|
6038
|
-
return (0,
|
|
6094
|
+
return (0,_stateManagement_segmentation_helpers_labelmapSegmentationState__rspack_import_8/* .getSegmentIndexForLabelValue */.Mx)(segmentation, layer.labelmapId, labelValue);
|
|
6039
6095
|
}
|
|
6040
6096
|
return;
|
|
6041
6097
|
}
|
|
@@ -6048,7 +6104,7 @@ function getSegmentIndexAtWorldForLabelmap(segmentation, worldPoint, { viewport
|
|
|
6048
6104
|
if (!image) {
|
|
6049
6105
|
continue;
|
|
6050
6106
|
}
|
|
6051
|
-
const segmentationActorEntry = (0,
|
|
6107
|
+
const segmentationActorEntry = (0,_stateManagement_segmentation_helpers_getSegmentationActor__rspack_import_6/* .getLabelmapActorEntry */.wV)(viewport.id, segmentation.segmentationId, segmentationImageId);
|
|
6052
6108
|
const imageData = segmentationActorEntry?.actor.getMapper().getInputData();
|
|
6053
6109
|
const indexIJK = _cornerstonejs_core__rspack_import_0.utilities.transformWorldToIndex(imageData, worldPoint);
|
|
6054
6110
|
const dimensions = imageData.getDimensions();
|
|
@@ -6061,36 +6117,32 @@ function getSegmentIndexAtWorldForLabelmap(segmentation, worldPoint, { viewport
|
|
|
6061
6117
|
if (!labelValue) {
|
|
6062
6118
|
continue;
|
|
6063
6119
|
}
|
|
6064
|
-
const layer = (0,
|
|
6120
|
+
const layer = (0,_stateManagement_segmentation_helpers_labelmapSegmentationState__rspack_import_8/* .getLabelmaps */.m)(segmentation).find((candidateLayer) => candidateLayer.imageIds?.includes(segmentationImageId));
|
|
6065
6121
|
if (!layer) {
|
|
6066
6122
|
return labelValue;
|
|
6067
6123
|
}
|
|
6068
|
-
return (0,
|
|
6124
|
+
return (0,_stateManagement_segmentation_helpers_labelmapSegmentationState__rspack_import_8/* .getSegmentIndexForLabelValue */.Mx)(segmentation, layer.labelmapId, labelValue);
|
|
6069
6125
|
}
|
|
6070
6126
|
}
|
|
6071
6127
|
function getSegmentIndexAtWorldForContour(segmentation, worldPoint, { viewport }) {
|
|
6072
6128
|
const contourData = segmentation.representationData.Contour;
|
|
6073
|
-
const
|
|
6074
|
-
const
|
|
6075
|
-
|
|
6076
|
-
const annotationsSet = contourData.annotationUIDsMap.get(segmentIndex);
|
|
6077
|
-
if (!annotationsSet) {
|
|
6078
|
-
continue;
|
|
6079
|
-
}
|
|
6080
|
-
for (const annotationUID of annotationsSet) {
|
|
6129
|
+
const segmentIndexByAnnotation = new Map();
|
|
6130
|
+
for (const [segmentIndex, annotationUIDs] of contourData.annotationUIDsMap) {
|
|
6131
|
+
for (const annotationUID of annotationUIDs) {
|
|
6081
6132
|
const annotation = (0,_stateManagement__rspack_import_3/* .getAnnotation */.gw)(annotationUID);
|
|
6082
|
-
if (
|
|
6083
|
-
|
|
6084
|
-
}
|
|
6085
|
-
const { polyline } = annotation.data.contour;
|
|
6086
|
-
if (!_cornerstonejs_core__rspack_import_0.utilities.isEqual(viewPlaneNormal, annotation.metadata.viewPlaneNormal)) {
|
|
6087
|
-
continue;
|
|
6088
|
-
}
|
|
6089
|
-
if ((0,_math_polyline__rspack_import_4.isPointInsidePolyline3D)(worldPoint, polyline)) {
|
|
6090
|
-
return Number(segmentIndex);
|
|
6133
|
+
if (annotation) {
|
|
6134
|
+
segmentIndexByAnnotation.set(annotation, Number(segmentIndex));
|
|
6091
6135
|
}
|
|
6092
6136
|
}
|
|
6093
6137
|
}
|
|
6138
|
+
const displayableAnnotations = (0,_planar_filterAnnotationsForDisplay__rspack_import_5/* ["default"] */.A)(viewport, Array.from(segmentIndexByAnnotation.keys()));
|
|
6139
|
+
for (const annotation of displayableAnnotations) {
|
|
6140
|
+
const { polyline } = annotation.data
|
|
6141
|
+
.contour;
|
|
6142
|
+
if ((0,_math_polyline__rspack_import_4.isPointInsidePolyline3D)(worldPoint, polyline)) {
|
|
6143
|
+
return segmentIndexByAnnotation.get(annotation);
|
|
6144
|
+
}
|
|
6145
|
+
}
|
|
6094
6146
|
}
|
|
6095
6147
|
|
|
6096
6148
|
|
|
@@ -6716,8 +6768,10 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
6716
6768
|
});
|
|
6717
6769
|
/* import */ var gl_matrix__rspack_import_0 = __webpack_require__(40230);
|
|
6718
6770
|
/* import */ var _cornerstonejs_core__rspack_import_1 = __webpack_require__(70594);
|
|
6719
|
-
/* import */ var
|
|
6720
|
-
/* import */ var
|
|
6771
|
+
/* import */ var _getViewportICamera__rspack_import_2 = __webpack_require__(29604);
|
|
6772
|
+
/* import */ var _runGrowCut__rspack_import_3 = __webpack_require__(66499);
|
|
6773
|
+
/* import */ var _getSphereBoundsInfo__rspack_import_4 = __webpack_require__(4296);
|
|
6774
|
+
|
|
6721
6775
|
|
|
6722
6776
|
|
|
6723
6777
|
|
|
@@ -6744,12 +6798,12 @@ function _getSphereBoundsInfo(referencedVolume, sphereInfo) {
|
|
|
6744
6798
|
const refVolImageData = referencedVolume.imageData;
|
|
6745
6799
|
const topCirclePoint = gl_matrix__rspack_import_0/* .vec3.scaleAndAdd */.eR.Ln(gl_matrix__rspack_import_0/* .vec3.create */.eR.vt(), sphereCenterPoint, vecColumn, -sphereRadius);
|
|
6746
6800
|
const bottomCirclePoint = gl_matrix__rspack_import_0/* .vec3.scaleAndAdd */.eR.Ln(gl_matrix__rspack_import_0/* .vec3.create */.eR.vt(), sphereCenterPoint, vecColumn, sphereRadius);
|
|
6747
|
-
const sphereBoundsInfo = (0,
|
|
6801
|
+
const sphereBoundsInfo = (0,_getSphereBoundsInfo__rspack_import_4/* .getSphereBoundsInfo */.R)([bottomCirclePoint, topCirclePoint], refVolImageData);
|
|
6748
6802
|
return _getGrowCutSphereBoundsInfo(referencedVolume, sphereBoundsInfo);
|
|
6749
6803
|
}
|
|
6750
6804
|
function _createSubVolumeFromSphere(referencedVolume, sphereInfo, viewport) {
|
|
6751
6805
|
const refVolImageData = referencedVolume.imageData;
|
|
6752
|
-
const camera =
|
|
6806
|
+
const camera = (0,_getViewportICamera__rspack_import_2/* ["default"] */.A)(viewport);
|
|
6753
6807
|
const { ijkVecRowDir, ijkVecColDir } = _cornerstonejs_core__rspack_import_1.utilities.getVolumeDirectionVectors(refVolImageData, camera);
|
|
6754
6808
|
const obliqueView = [ijkVecRowDir, ijkVecColDir].some((vec) => !_cornerstonejs_core__rspack_import_1.utilities.isEqual(Math.abs(vec[0]), 1) &&
|
|
6755
6809
|
!_cornerstonejs_core__rspack_import_1.utilities.isEqual(Math.abs(vec[1]), 1) &&
|
|
@@ -6833,7 +6887,7 @@ function _setNegativeSeedValues(subVolume, labelmap, sphereInfo, viewport, optio
|
|
|
6833
6887
|
const subVolPixelData = subVolume.voxelManager.getCompleteScalarDataArray();
|
|
6834
6888
|
const [columns, rows, numSlices] = labelmap.dimensions;
|
|
6835
6889
|
const numPixelsPerSlice = columns * rows;
|
|
6836
|
-
const { worldVecRowDir, worldVecSliceDir } = _cornerstonejs_core__rspack_import_1.utilities.getVolumeDirectionVectors(labelmap.imageData,
|
|
6890
|
+
const { worldVecRowDir, worldVecSliceDir } = _cornerstonejs_core__rspack_import_1.utilities.getVolumeDirectionVectors(labelmap.imageData, (0,_getViewportICamera__rspack_import_2/* ["default"] */.A)(viewport));
|
|
6837
6891
|
const ijkSphereCenter = transformWorldToIndex(subVolume.imageData, sphereInfo.center);
|
|
6838
6892
|
const referencePixelValue = subVolPixelData[ijkSphereCenter[2] * columns * rows +
|
|
6839
6893
|
ijkSphereCenter[1] * columns +
|
|
@@ -6878,7 +6932,7 @@ async function runGrowCutForSphere(referencedVolumeId, sphereInfo, viewport, opt
|
|
|
6878
6932
|
const referencedVolume = _cornerstonejs_core__rspack_import_1.cache.getVolume(referencedVolumeId);
|
|
6879
6933
|
const subVolume = _createSubVolumeFromSphere(referencedVolume, sphereInfo, viewport);
|
|
6880
6934
|
const labelmap = await _createAndCacheSegmentationSubVolumeForSphere(subVolume, sphereInfo, viewport, options);
|
|
6881
|
-
await (0,
|
|
6935
|
+
await (0,_runGrowCut__rspack_import_3/* .run */.e)(subVolume.volumeId, labelmap.volumeId);
|
|
6882
6936
|
return labelmap;
|
|
6883
6937
|
}
|
|
6884
6938
|
|
|
@@ -7128,6 +7182,74 @@ function invalidateBrushCursor(toolGroupId) {
|
|
|
7128
7182
|
}
|
|
7129
7183
|
|
|
7130
7184
|
|
|
7185
|
+
},
|
|
7186
|
+
1377(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
7187
|
+
"use strict";
|
|
7188
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
7189
|
+
A: () => (setViewportCamera),
|
|
7190
|
+
l: () => (resetViewportCamera)
|
|
7191
|
+
});
|
|
7192
|
+
/* import */ var _cornerstonejs_core__rspack_import_0 = __webpack_require__(70594);
|
|
7193
|
+
|
|
7194
|
+
function normalizeVec3(v) {
|
|
7195
|
+
const length = Math.sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
|
|
7196
|
+
return length > 0 ? [v[0] / length, v[1] / length, v[2] / length] : v;
|
|
7197
|
+
}
|
|
7198
|
+
function setViewportCamera(viewport, camera) {
|
|
7199
|
+
const vp = viewport;
|
|
7200
|
+
if (_cornerstonejs_core__rspack_import_0.utilities.isGenericViewport(viewport)) {
|
|
7201
|
+
if (viewport.type === _cornerstonejs_core__rspack_import_0.Enums.ViewportType.PLANAR_NEXT &&
|
|
7202
|
+
typeof vp.setViewReference === 'function') {
|
|
7203
|
+
const ref = viewport.getViewReference();
|
|
7204
|
+
const focalPoint = camera.focalPoint ?? ref?.cameraFocalPoint;
|
|
7205
|
+
const viewUp = camera.viewUp ?? ref?.viewUp;
|
|
7206
|
+
let viewPlaneNormal = camera.viewPlaneNormal;
|
|
7207
|
+
if (!viewPlaneNormal && camera.position && focalPoint) {
|
|
7208
|
+
viewPlaneNormal = normalizeVec3([
|
|
7209
|
+
camera.position[0] - focalPoint[0],
|
|
7210
|
+
camera.position[1] - focalPoint[1],
|
|
7211
|
+
camera.position[2] - focalPoint[2],
|
|
7212
|
+
]);
|
|
7213
|
+
}
|
|
7214
|
+
const rotatingVp = viewport;
|
|
7215
|
+
const readResolvedScale = () => rotatingVp.getResolvedView?.()?.toICamera?.()?.parallelScale;
|
|
7216
|
+
const beforeScale = readResolvedScale();
|
|
7217
|
+
const beforeZoom = rotatingVp.getZoom?.();
|
|
7218
|
+
vp.setViewReference({
|
|
7219
|
+
...ref,
|
|
7220
|
+
cameraFocalPoint: focalPoint,
|
|
7221
|
+
viewPlaneNormal,
|
|
7222
|
+
viewUp,
|
|
7223
|
+
});
|
|
7224
|
+
rotatingVp.invalidateResolvedView?.();
|
|
7225
|
+
const afterScale = readResolvedScale();
|
|
7226
|
+
if (beforeScale &&
|
|
7227
|
+
afterScale &&
|
|
7228
|
+
typeof beforeZoom === 'number' &&
|
|
7229
|
+
typeof rotatingVp.setZoom === 'function') {
|
|
7230
|
+
const newZoom = (afterScale * beforeZoom) / beforeScale;
|
|
7231
|
+
if (Number.isFinite(newZoom) && newZoom > 0) {
|
|
7232
|
+
rotatingVp.setZoom(newZoom);
|
|
7233
|
+
}
|
|
7234
|
+
}
|
|
7235
|
+
viewport.render();
|
|
7236
|
+
return;
|
|
7237
|
+
}
|
|
7238
|
+
vp.setViewState?.(camera);
|
|
7239
|
+
return;
|
|
7240
|
+
}
|
|
7241
|
+
vp.setCamera?.(camera);
|
|
7242
|
+
}
|
|
7243
|
+
function resetViewportCamera(viewport, options) {
|
|
7244
|
+
const vp = viewport;
|
|
7245
|
+
if (_cornerstonejs_core__rspack_import_0.utilities.isGenericViewport(viewport)) {
|
|
7246
|
+
vp.resetViewState?.(options);
|
|
7247
|
+
return;
|
|
7248
|
+
}
|
|
7249
|
+
vp.resetCamera?.(options);
|
|
7250
|
+
}
|
|
7251
|
+
|
|
7252
|
+
|
|
7131
7253
|
},
|
|
7132
7254
|
58640(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
7133
7255
|
"use strict";
|
|
@@ -7161,6 +7283,42 @@ function triggerAnnotationRenderForViewportIds(viewportIdsToRender) {
|
|
|
7161
7283
|
/* export default */ const __rspack_default_export = (triggerAnnotationRenderForViewportIds);
|
|
7162
7284
|
|
|
7163
7285
|
|
|
7286
|
+
},
|
|
7287
|
+
15436(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
7288
|
+
"use strict";
|
|
7289
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
7290
|
+
Z: () => (getViewportPresentation),
|
|
7291
|
+
r: () => (applyViewportPresentation)
|
|
7292
|
+
});
|
|
7293
|
+
/* import */ var _cornerstonejs_core__rspack_import_0 = __webpack_require__(70594);
|
|
7294
|
+
|
|
7295
|
+
function getViewportPresentation(viewport, selector) {
|
|
7296
|
+
const projectionPresentation = _cornerstonejs_core__rspack_import_0.viewportProjection.getPresentation(viewport, {
|
|
7297
|
+
selector,
|
|
7298
|
+
});
|
|
7299
|
+
if (projectionPresentation) {
|
|
7300
|
+
return projectionPresentation;
|
|
7301
|
+
}
|
|
7302
|
+
return viewport.getViewPresentation?.(selector);
|
|
7303
|
+
}
|
|
7304
|
+
function applyViewportPresentation(viewport, presentation) {
|
|
7305
|
+
if (!presentation) {
|
|
7306
|
+
return false;
|
|
7307
|
+
}
|
|
7308
|
+
const target = viewport;
|
|
7309
|
+
const nextViewState = _cornerstonejs_core__rspack_import_0.viewportProjection.withPresentation(viewport, presentation);
|
|
7310
|
+
if (nextViewState && typeof target.setViewState === 'function') {
|
|
7311
|
+
target.setViewState(nextViewState);
|
|
7312
|
+
return true;
|
|
7313
|
+
}
|
|
7314
|
+
if (typeof target.setViewPresentation === 'function') {
|
|
7315
|
+
target.setViewPresentation(presentation);
|
|
7316
|
+
return true;
|
|
7317
|
+
}
|
|
7318
|
+
return false;
|
|
7319
|
+
}
|
|
7320
|
+
|
|
7321
|
+
|
|
7164
7322
|
},
|
|
7165
7323
|
89930(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
7166
7324
|
"use strict";
|