@ohif/app 3.14.0-beta.105 → 3.14.0-beta.107
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/{8923.bundle.8b682e96.js → 1183.bundle.bb27988c.js} +36 -329
- package/dist/{1645.bundle.1a466b16.js → 1645.bundle.ca31eb2f.js} +350 -41
- package/dist/{8729.bundle.e17fe9b2.js → 1654.bundle.d6a57234.js} +277 -15
- package/dist/{204.bundle.bc44c201.js → 204.bundle.9bb87642.js} +1 -1
- package/dist/{641.bundle.8e45751e.js → 2492.bundle.29d1731e.js} +336 -2
- package/dist/{3366.bundle.d9e78e25.js → 3366.bundle.54300d70.js} +3 -3
- package/dist/{4487.bundle.fa0375a4.js → 4487.bundle.d04fb8a6.js} +11 -16
- package/dist/{4606.bundle.6c297e2a.js → 4606.bundle.6191768a.js} +2 -2
- package/dist/{8312.bundle.d67b6f4e.js → 4718.bundle.e4f1e836.js} +83 -30
- package/dist/{4998.bundle.25b8cbfe.js → 4998.bundle.93ec76dd.js} +2 -2
- package/dist/{5143.bundle.53156bb0.js → 5143.bundle.cb1a942d.js} +32 -15
- package/dist/{5154.bundle.ccd02dd7.js → 5154.bundle.7806c0de.js} +2 -2
- package/dist/{5320.bundle.c17eb4a7.js → 5320.bundle.5686617c.js} +53 -342
- package/dist/{287.bundle.ee60c370.js → 5636.bundle.d736d89a.js} +92 -50
- package/dist/{6253.bundle.e9360b9a.js → 6253.bundle.da4ecc40.js} +676 -9
- package/dist/{6314.bundle.5aadfe48.js → 6314.bundle.907b94ea.js} +132 -50
- package/dist/{6507.bundle.bbcdd01e.js → 6507.bundle.1f9bcad5.js} +2 -2
- package/dist/{6956.bundle.dc0e8660.js → 6956.bundle.3e1bfe44.js} +188 -102
- package/dist/{7526.bundle.3460c3ca.js → 7526.bundle.22fdc0bb.js} +2 -2
- package/dist/{8868.bundle.8f3653b3.js → 8868.bundle.b2dc2ccb.js} +4 -4
- package/dist/{5076.bundle.2a14756f.js → 915.bundle.48917224.js} +1 -22
- package/dist/{9187.bundle.407afa07.js → 9187.bundle.bd5c0f55.js} +2 -2
- package/dist/{9481.bundle.d045ae3a.js → 9481.bundle.df453a4a.js} +2 -2
- package/dist/{9620.bundle.b4cc392c.js → 9620.bundle.a7dbe946.js} +4 -4
- package/dist/{9889.bundle.bf312047.js → 9889.bundle.6dee52c5.js} +138 -61
- package/dist/{app.bundle.6472f60b.js → app.bundle.9f4c5572.js} +48 -44
- package/dist/app.bundle.css +21 -9
- package/dist/{compute.bundle.9267d449.js → compute.bundle.34155635.js} +10 -10
- package/dist/index.html +1 -1
- package/dist/{interpolation.bundle.ee9998a4.js → interpolation.bundle.244cf3e9.js} +6 -6
- package/dist/{polySeg.bundle.a55f8eee.js → polySeg.bundle.58b3a681.js} +10 -10
- package/dist/sw.js +1 -1
- package/package.json +6 -6
|
@@ -1749,6 +1749,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
1749
1749
|
BaseVolumeViewport: () => (/* reexport safe */ _RenderingEngine_BaseVolumeViewport_js__rspack_import_9.A),
|
|
1750
1750
|
CONSTANTS: () => (/* reexport module object */ _constants_index_js__rspack_import_1),
|
|
1751
1751
|
Enums: () => (/* reexport module object */ _enums_index_js__rspack_import_0),
|
|
1752
|
+
ImageVolume: () => (/* reexport safe */ _cache_index_js__rspack_import_24.QV),
|
|
1752
1753
|
StackViewport: () => (/* reexport safe */ _RenderingEngine_StackViewport_js__rspack_import_10.A),
|
|
1753
1754
|
VolumeViewport: () => (/* reexport safe */ _RenderingEngine_VolumeViewport_js__rspack_import_7.A),
|
|
1754
1755
|
cache: () => (/* reexport safe */ _cache_cache_js__rspack_import_27.Ay),
|
|
@@ -4969,11 +4970,13 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
4969
4970
|
82159(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
4970
4971
|
/* import */ var _normalizeLabelmapSegmentationData_js__rspack_import_0 = __webpack_require__(18782);
|
|
4971
4972
|
/* import */ var _labelmapLayerStore_js__rspack_import_1 = __webpack_require__(53325);
|
|
4972
|
-
/* import */ var
|
|
4973
|
-
/* import */ var
|
|
4974
|
-
/* import */ var
|
|
4975
|
-
/* import */ var
|
|
4976
|
-
/* import */ var
|
|
4973
|
+
/* import */ var _labelmapImageIdMapping_js__rspack_import_2 = __webpack_require__(27749);
|
|
4974
|
+
/* import */ var _labelmapLegacyAdapter_js__rspack_import_3 = __webpack_require__(19637);
|
|
4975
|
+
/* import */ var _labelmapSegmentBindings_js__rspack_import_4 = __webpack_require__(53344);
|
|
4976
|
+
/* import */ var _privateLabelmap_js__rspack_import_5 = __webpack_require__(55892);
|
|
4977
|
+
/* import */ var _labelmapEditTransaction_js__rspack_import_6 = __webpack_require__(65079);
|
|
4978
|
+
/* import */ var _labelmapImageReferenceResolver_js__rspack_import_7 = __webpack_require__(78691);
|
|
4979
|
+
|
|
4977
4980
|
|
|
4978
4981
|
|
|
4979
4982
|
|
|
@@ -4983,351 +4986,28 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
4983
4986
|
|
|
4984
4987
|
|
|
4985
4988
|
__webpack_require__.d(__webpack_exports__, {
|
|
4986
|
-
Lp: () => (/* reexport safe */
|
|
4987
|
-
Mx: () => (/* reexport safe */
|
|
4988
|
-
Nf: () => (/* reexport safe */
|
|
4989
|
-
Qk: () => (/* reexport safe */
|
|
4990
|
-
RP: () => (/* reexport safe */
|
|
4991
|
-
Ry: () => (/* reexport safe */
|
|
4992
|
-
VQ: () => (/* reexport safe */
|
|
4989
|
+
Lp: () => (/* reexport safe */ _labelmapImageReferenceResolver_js__rspack_import_7.A),
|
|
4990
|
+
Mx: () => (/* reexport safe */ _labelmapSegmentBindings_js__rspack_import_4.Mx),
|
|
4991
|
+
Nf: () => (/* reexport safe */ _labelmapSegmentBindings_js__rspack_import_4.Nf),
|
|
4992
|
+
Qk: () => (/* reexport safe */ _labelmapEditTransaction_js__rspack_import_6.Qk),
|
|
4993
|
+
RP: () => (/* reexport safe */ _labelmapEditTransaction_js__rspack_import_6.RP),
|
|
4994
|
+
Ry: () => (/* reexport safe */ _labelmapEditTransaction_js__rspack_import_6.Ry),
|
|
4995
|
+
VQ: () => (/* reexport safe */ _labelmapEditTransaction_js__rspack_import_6.VQ),
|
|
4996
|
+
bx: () => (/* reexport safe */ _labelmapLayerStore_js__rspack_import_1.bx),
|
|
4993
4997
|
kL: () => (/* reexport safe */ _labelmapLayerStore_js__rspack_import_1.kL),
|
|
4994
|
-
r: () => (/* reexport safe */
|
|
4998
|
+
r: () => (/* reexport safe */ _labelmapSegmentBindings_js__rspack_import_4.r),
|
|
4995
4999
|
uk: () => (/* reexport safe */ _normalizeLabelmapSegmentationData_js__rspack_import_0.uk),
|
|
4996
|
-
xS: () => (/* reexport safe */
|
|
5000
|
+
xS: () => (/* reexport safe */ _labelmapLegacyAdapter_js__rspack_import_3.x)
|
|
4997
5001
|
});
|
|
4998
5002
|
|
|
4999
5003
|
|
|
5000
|
-
},
|
|
5001
|
-
78691(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
5002
|
-
/* import */ var _cornerstonejs_core__rspack_import_0 = __webpack_require__(62721);
|
|
5003
|
-
/* import */ var _helpers_getViewportLabelmapRenderMode_js__rspack_import_1 = __webpack_require__(15422);
|
|
5004
|
-
/* import */ var _normalizeLabelmapSegmentationData_js__rspack_import_2 = __webpack_require__(18782);
|
|
5005
|
-
/* import */ var _labelmapLayerStore_js__rspack_import_3 = __webpack_require__(53325);
|
|
5006
|
-
/* import */ var _labelmapSegmentBindings_js__rspack_import_4 = __webpack_require__(53344);
|
|
5007
|
-
/* import */ var _labelmapLegacyAdapter_js__rspack_import_5 = __webpack_require__(19637);
|
|
5008
|
-
/* import */ var _labelmapImageIdMapping_js__rspack_import_6 = __webpack_require__(27749);
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
|
|
5012
|
-
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
class LabelmapImageReferenceResolver {
|
|
5017
|
-
constructor(getSegmentation) {
|
|
5018
|
-
this.stackLabelmapImageIdReferenceMap = new Map();
|
|
5019
|
-
this.labelmapImageIdReferenceMap = new Map();
|
|
5020
|
-
this.keysBySegmentationId = new Map();
|
|
5021
|
-
this.completedScanResultsBySegmentationId = new Map();
|
|
5022
|
-
this.getSegmentation = getSegmentation;
|
|
5023
|
-
}
|
|
5024
|
-
reset() {
|
|
5025
|
-
this.stackLabelmapImageIdReferenceMap.clear();
|
|
5026
|
-
this.labelmapImageIdReferenceMap.clear();
|
|
5027
|
-
this.keysBySegmentationId.clear();
|
|
5028
|
-
this.completedScanResultsBySegmentationId.clear();
|
|
5029
|
-
}
|
|
5030
|
-
removeSegmentation(segmentationId) {
|
|
5031
|
-
this.stackLabelmapImageIdReferenceMap.delete(segmentationId);
|
|
5032
|
-
this.completedScanResultsBySegmentationId.delete(segmentationId);
|
|
5033
|
-
const keys = this.keysBySegmentationId.get(segmentationId);
|
|
5034
|
-
if (keys) {
|
|
5035
|
-
for (const key of keys) {
|
|
5036
|
-
this.labelmapImageIdReferenceMap.delete(key);
|
|
5037
|
-
}
|
|
5038
|
-
this.keysBySegmentationId.delete(segmentationId);
|
|
5039
|
-
}
|
|
5040
|
-
}
|
|
5041
|
-
setLabelmapImageIds(segmentationId, key, labelmapImageIds) {
|
|
5042
|
-
this.labelmapImageIdReferenceMap.set(key, labelmapImageIds);
|
|
5043
|
-
let keys = this.keysBySegmentationId.get(segmentationId);
|
|
5044
|
-
if (!keys) {
|
|
5045
|
-
keys = new Set();
|
|
5046
|
-
this.keysBySegmentationId.set(segmentationId, keys);
|
|
5047
|
-
}
|
|
5048
|
-
keys.add(key);
|
|
5049
|
-
}
|
|
5050
|
-
getLabelmapImageIds(representationData) {
|
|
5051
|
-
const labelmapData = representationData.Labelmap;
|
|
5052
|
-
let labelmapImageIds;
|
|
5053
|
-
if (!labelmapData) {
|
|
5054
|
-
return;
|
|
5055
|
-
}
|
|
5056
|
-
if (labelmapData?.labelmaps) {
|
|
5057
|
-
const imageIds = Object.values(labelmapData.labelmaps).flatMap((layer) => {
|
|
5058
|
-
if (layer.imageIds?.length) {
|
|
5059
|
-
return layer.imageIds;
|
|
5060
|
-
}
|
|
5061
|
-
if (layer.volumeId) {
|
|
5062
|
-
return _cornerstonejs_core__rspack_import_0.cache.getVolume(layer.volumeId)
|
|
5063
|
-
?.imageIds;
|
|
5064
|
-
}
|
|
5065
|
-
return [];
|
|
5066
|
-
});
|
|
5067
|
-
return Array.from(new Set(imageIds.filter(Boolean)));
|
|
5068
|
-
}
|
|
5069
|
-
if (labelmapData.imageIds) {
|
|
5070
|
-
labelmapImageIds = labelmapData
|
|
5071
|
-
.imageIds;
|
|
5072
|
-
}
|
|
5073
|
-
else if (labelmapData.volumeId) {
|
|
5074
|
-
const volumeId = labelmapData
|
|
5075
|
-
.volumeId;
|
|
5076
|
-
const volume = _cornerstonejs_core__rspack_import_0.cache.getVolume(volumeId);
|
|
5077
|
-
labelmapImageIds = volume.imageIds;
|
|
5078
|
-
}
|
|
5079
|
-
return labelmapImageIds;
|
|
5080
|
-
}
|
|
5081
|
-
getLabelmapImageIdsForImageId(imageId, segmentationId) {
|
|
5082
|
-
const segmentation = this.getSegmentation(segmentationId);
|
|
5083
|
-
if (!segmentation?.representationData?.Labelmap) {
|
|
5084
|
-
return;
|
|
5085
|
-
}
|
|
5086
|
-
(0,_normalizeLabelmapSegmentationData_js__rspack_import_2/* .ensureLabelmapState */.uk)(segmentation);
|
|
5087
|
-
return (0,_labelmapLegacyAdapter_js__rspack_import_5/* .getReferencedImageIdToCurrentImageIdMap */._)(segmentation).get(imageId);
|
|
5088
|
-
}
|
|
5089
|
-
updateLabelmapSegmentationImageReferences(viewportId, segmentationId) {
|
|
5090
|
-
const segmentation = this.getSegmentation(segmentationId);
|
|
5091
|
-
if (!segmentation) {
|
|
5092
|
-
return;
|
|
5093
|
-
}
|
|
5094
|
-
if (!this.stackLabelmapImageIdReferenceMap.has(segmentationId)) {
|
|
5095
|
-
this.stackLabelmapImageIdReferenceMap.set(segmentationId, new Map());
|
|
5096
|
-
}
|
|
5097
|
-
const { representationData } = segmentation;
|
|
5098
|
-
if (!representationData.Labelmap) {
|
|
5099
|
-
return;
|
|
5100
|
-
}
|
|
5101
|
-
const labelmapImageIds = this.getLabelmapImageIds(representationData);
|
|
5102
|
-
const enabledElement = (0,_cornerstonejs_core__rspack_import_0.getEnabledElementByViewportId)(viewportId);
|
|
5103
|
-
if (!enabledElement || !labelmapImageIds?.length) {
|
|
5104
|
-
return;
|
|
5105
|
-
}
|
|
5106
|
-
const viewport = enabledElement.viewport;
|
|
5107
|
-
const scanKey = this.generateScanKey('current', viewport, labelmapImageIds);
|
|
5108
|
-
if (scanKey && this.hasCompletedScan(segmentationId, scanKey)) {
|
|
5109
|
-
return this.getCompletedScanResult(segmentationId, scanKey);
|
|
5110
|
-
}
|
|
5111
|
-
const result = this.updateLabelmapSegmentationReferences(segmentationId, viewport, labelmapImageIds);
|
|
5112
|
-
if (scanKey) {
|
|
5113
|
-
this.markCompletedScan(segmentationId, scanKey, result);
|
|
5114
|
-
}
|
|
5115
|
-
return result;
|
|
5116
|
-
}
|
|
5117
|
-
generateScanKey(kind, viewport, labelmapImageIds) {
|
|
5118
|
-
const referenceImageId = typeof viewport.getCurrentImageId === 'function'
|
|
5119
|
-
? viewport.getCurrentImageId()
|
|
5120
|
-
: undefined;
|
|
5121
|
-
if (!referenceImageId) {
|
|
5122
|
-
return;
|
|
5123
|
-
}
|
|
5124
|
-
return `${kind}|${viewport.id}|${referenceImageId}|${labelmapImageIds.length}|${labelmapImageIds[0]}|${labelmapImageIds[labelmapImageIds.length - 1]}`;
|
|
5125
|
-
}
|
|
5126
|
-
hasCompletedScan(segmentationId, scanKey) {
|
|
5127
|
-
return !!this.completedScanResultsBySegmentationId
|
|
5128
|
-
.get(segmentationId)
|
|
5129
|
-
?.has(scanKey);
|
|
5130
|
-
}
|
|
5131
|
-
getCompletedScanResult(segmentationId, scanKey) {
|
|
5132
|
-
return this.completedScanResultsBySegmentationId
|
|
5133
|
-
.get(segmentationId)
|
|
5134
|
-
?.get(scanKey);
|
|
5135
|
-
}
|
|
5136
|
-
markCompletedScan(segmentationId, scanKey, result) {
|
|
5137
|
-
let results = this.completedScanResultsBySegmentationId.get(segmentationId);
|
|
5138
|
-
if (!results) {
|
|
5139
|
-
results = new Map();
|
|
5140
|
-
this.completedScanResultsBySegmentationId.set(segmentationId, results);
|
|
5141
|
-
}
|
|
5142
|
-
results.set(scanKey, result);
|
|
5143
|
-
}
|
|
5144
|
-
getCurrentLabelmapImageIdsForViewport(viewportId, segmentationId) {
|
|
5145
|
-
const enabledElement = (0,_cornerstonejs_core__rspack_import_0.getEnabledElementByViewportId)(viewportId);
|
|
5146
|
-
if (!enabledElement) {
|
|
5147
|
-
return;
|
|
5148
|
-
}
|
|
5149
|
-
const { viewport } = enabledElement;
|
|
5150
|
-
const viewportRenderMode = (0,_helpers_getViewportLabelmapRenderMode_js__rspack_import_1/* ["default"] */.A)(viewport);
|
|
5151
|
-
if (viewportRenderMode !== 'image' ||
|
|
5152
|
-
typeof viewport.getCurrentImageId !== 'function') {
|
|
5153
|
-
return;
|
|
5154
|
-
}
|
|
5155
|
-
const referenceImageId = viewport.getCurrentImageId();
|
|
5156
|
-
const segmentation = this.getSegmentation(segmentationId);
|
|
5157
|
-
if (!segmentation) {
|
|
5158
|
-
return;
|
|
5159
|
-
}
|
|
5160
|
-
(0,_normalizeLabelmapSegmentationData_js__rspack_import_2/* .ensureLabelmapState */.uk)(segmentation);
|
|
5161
|
-
const viewportImageIds = viewport.getImageIds();
|
|
5162
|
-
const currentIndex = viewportImageIds.indexOf(referenceImageId);
|
|
5163
|
-
const labelmapImageIds = [];
|
|
5164
|
-
(0,_labelmapLayerStore_js__rspack_import_3/* .getLabelmaps */.m)(segmentation).forEach((layer) => {
|
|
5165
|
-
const referencedLabelmapImageIds = (0,_labelmapImageIdMapping_js__rspack_import_6/* .getLabelmapImageIdsForReferencedImageId */.s_)(layer, referenceImageId);
|
|
5166
|
-
if (referencedLabelmapImageIds.length) {
|
|
5167
|
-
labelmapImageIds.push(...referencedLabelmapImageIds);
|
|
5168
|
-
return;
|
|
5169
|
-
}
|
|
5170
|
-
if (currentIndex !== -1 && layer.imageIds?.[currentIndex]) {
|
|
5171
|
-
labelmapImageIds.push(layer.imageIds[currentIndex]);
|
|
5172
|
-
return;
|
|
5173
|
-
}
|
|
5174
|
-
layer.imageIds?.some((candidateImageId) => {
|
|
5175
|
-
const viewableImageId = viewport.isReferenceViewable({ referencedImageId: candidateImageId }, { asOverlay: true });
|
|
5176
|
-
if (viewableImageId) {
|
|
5177
|
-
labelmapImageIds.push(candidateImageId);
|
|
5178
|
-
}
|
|
5179
|
-
return !!viewableImageId;
|
|
5180
|
-
});
|
|
5181
|
-
});
|
|
5182
|
-
const resolvedImageIds = Array.from(new Set(labelmapImageIds));
|
|
5183
|
-
const key = this.generateMapKey({
|
|
5184
|
-
segmentationId,
|
|
5185
|
-
referenceImageId,
|
|
5186
|
-
});
|
|
5187
|
-
this.setLabelmapImageIds(segmentationId, key, resolvedImageIds);
|
|
5188
|
-
if (!this.stackLabelmapImageIdReferenceMap.has(segmentationId)) {
|
|
5189
|
-
this.stackLabelmapImageIdReferenceMap.set(segmentationId, new Map());
|
|
5190
|
-
}
|
|
5191
|
-
const activeSegmentIndex = Object.keys(segmentation.segments).find((segmentIndex) => segmentation.segments[segmentIndex].active);
|
|
5192
|
-
const activeImageId = activeSegmentIndex
|
|
5193
|
-
? (0,_labelmapSegmentBindings_js__rspack_import_4/* .getLabelmapForSegment */.r)(segmentation, Number(activeSegmentIndex))
|
|
5194
|
-
?.imageIds?.[currentIndex]
|
|
5195
|
-
: undefined;
|
|
5196
|
-
this.stackLabelmapImageIdReferenceMap
|
|
5197
|
-
.get(segmentationId)
|
|
5198
|
-
.set(referenceImageId, activeImageId ?? resolvedImageIds[0]);
|
|
5199
|
-
return resolvedImageIds;
|
|
5200
|
-
}
|
|
5201
|
-
getCurrentLabelmapImageIdForViewport(viewportId, segmentationId) {
|
|
5202
|
-
const enabledElement = (0,_cornerstonejs_core__rspack_import_0.getEnabledElementByViewportId)(viewportId);
|
|
5203
|
-
if (!enabledElement) {
|
|
5204
|
-
return;
|
|
5205
|
-
}
|
|
5206
|
-
const { viewport } = enabledElement;
|
|
5207
|
-
const viewportRenderMode = (0,_helpers_getViewportLabelmapRenderMode_js__rspack_import_1/* ["default"] */.A)(viewport);
|
|
5208
|
-
if (viewportRenderMode !== 'image' ||
|
|
5209
|
-
typeof viewport.getCurrentImageId !== 'function') {
|
|
5210
|
-
return;
|
|
5211
|
-
}
|
|
5212
|
-
const currentImageId = viewport.getCurrentImageId();
|
|
5213
|
-
const currentImageIds = this.getCurrentLabelmapImageIdsForViewport(viewportId, segmentationId);
|
|
5214
|
-
if (!currentImageIds?.length) {
|
|
5215
|
-
return;
|
|
5216
|
-
}
|
|
5217
|
-
const segmentation = this.getSegmentation(segmentationId);
|
|
5218
|
-
const currentIndex = viewport
|
|
5219
|
-
.getImageIds()
|
|
5220
|
-
.indexOf(currentImageId);
|
|
5221
|
-
const activeSegmentIndex = segmentation
|
|
5222
|
-
? Object.keys(segmentation.segments).find((segmentIndex) => segmentation.segments[segmentIndex].active)
|
|
5223
|
-
: undefined;
|
|
5224
|
-
const activeImageId = segmentation && activeSegmentIndex
|
|
5225
|
-
? (0,_labelmapSegmentBindings_js__rspack_import_4/* .getLabelmapForSegment */.r)(segmentation, Number(activeSegmentIndex))
|
|
5226
|
-
?.imageIds?.[currentIndex]
|
|
5227
|
-
: undefined;
|
|
5228
|
-
return activeImageId ?? currentImageIds[0];
|
|
5229
|
-
}
|
|
5230
|
-
getStackSegmentationImageIdsForViewport(viewportId, segmentationId) {
|
|
5231
|
-
const segmentation = this.getSegmentation(segmentationId);
|
|
5232
|
-
if (!segmentation) {
|
|
5233
|
-
return [];
|
|
5234
|
-
}
|
|
5235
|
-
this.updateAllLabelmapSegmentationImageReferences(viewportId, segmentationId);
|
|
5236
|
-
const enabledElement = (0,_cornerstonejs_core__rspack_import_0.getEnabledElementByViewportId)(viewportId);
|
|
5237
|
-
const imageIds = enabledElement?.viewport.getImageIds?.() ?? [];
|
|
5238
|
-
const imageIdMap = (0,_labelmapLegacyAdapter_js__rspack_import_5/* .getReferencedImageIdToCurrentImageIdMap */._)(segmentation);
|
|
5239
|
-
return imageIds.flatMap((imageId) => imageIdMap.get(imageId) ?? []);
|
|
5240
|
-
}
|
|
5241
|
-
updateLabelmapSegmentationReferences(segmentationId, viewport, labelmapImageIds, updateCallback) {
|
|
5242
|
-
const referenceImageId = viewport.getCurrentImageId();
|
|
5243
|
-
let viewableLabelmapImageIdFound = false;
|
|
5244
|
-
for (const labelmapImageId of labelmapImageIds) {
|
|
5245
|
-
const viewableImageId = viewport.isReferenceViewable({ referencedImageId: labelmapImageId }, { asOverlay: true });
|
|
5246
|
-
if (viewableImageId) {
|
|
5247
|
-
viewableLabelmapImageIdFound = true;
|
|
5248
|
-
this.stackLabelmapImageIdReferenceMap
|
|
5249
|
-
.get(segmentationId)
|
|
5250
|
-
.set(referenceImageId, labelmapImageId);
|
|
5251
|
-
this.updateLabelmapImageIdReferenceMap({
|
|
5252
|
-
segmentationId,
|
|
5253
|
-
referenceImageId,
|
|
5254
|
-
labelmapImageId,
|
|
5255
|
-
});
|
|
5256
|
-
}
|
|
5257
|
-
}
|
|
5258
|
-
updateCallback?.(viewport, segmentationId, labelmapImageIds);
|
|
5259
|
-
return viewableLabelmapImageIdFound
|
|
5260
|
-
? this.stackLabelmapImageIdReferenceMap
|
|
5261
|
-
.get(segmentationId)
|
|
5262
|
-
.get(referenceImageId)
|
|
5263
|
-
: undefined;
|
|
5264
|
-
}
|
|
5265
|
-
updateAllLabelmapSegmentationImageReferences(viewportId, segmentationId) {
|
|
5266
|
-
const segmentation = this.getSegmentation(segmentationId);
|
|
5267
|
-
if (!segmentation) {
|
|
5268
|
-
return;
|
|
5269
|
-
}
|
|
5270
|
-
if (!this.stackLabelmapImageIdReferenceMap.has(segmentationId)) {
|
|
5271
|
-
this.stackLabelmapImageIdReferenceMap.set(segmentationId, new Map());
|
|
5272
|
-
}
|
|
5273
|
-
const { representationData } = segmentation;
|
|
5274
|
-
if (!representationData.Labelmap) {
|
|
5275
|
-
return;
|
|
5276
|
-
}
|
|
5277
|
-
const labelmapImageIds = this.getLabelmapImageIds(representationData);
|
|
5278
|
-
const enabledElement = (0,_cornerstonejs_core__rspack_import_0.getEnabledElementByViewportId)(viewportId);
|
|
5279
|
-
if (!enabledElement || !labelmapImageIds?.length) {
|
|
5280
|
-
return;
|
|
5281
|
-
}
|
|
5282
|
-
const stackViewport = enabledElement.viewport;
|
|
5283
|
-
const scanKey = this.generateScanKey('all', stackViewport, labelmapImageIds);
|
|
5284
|
-
if (scanKey && this.hasCompletedScan(segmentationId, scanKey)) {
|
|
5285
|
-
return;
|
|
5286
|
-
}
|
|
5287
|
-
if (scanKey) {
|
|
5288
|
-
this.markCompletedScan(segmentationId, scanKey);
|
|
5289
|
-
}
|
|
5290
|
-
this.updateLabelmapSegmentationReferences(segmentationId, stackViewport, labelmapImageIds, (stackViewport, segmentationId, labelmapImageIds) => {
|
|
5291
|
-
const imageIds = stackViewport.getImageIds();
|
|
5292
|
-
imageIds.forEach((referenceImageId, index) => {
|
|
5293
|
-
for (const labelmapImageId of labelmapImageIds) {
|
|
5294
|
-
const viewableImageId = stackViewport.isReferenceViewable({ referencedImageId: labelmapImageId, sliceIndex: index }, { asOverlay: true, withNavigation: true });
|
|
5295
|
-
if (viewableImageId) {
|
|
5296
|
-
this.stackLabelmapImageIdReferenceMap
|
|
5297
|
-
.get(segmentationId)
|
|
5298
|
-
.set(referenceImageId, labelmapImageId);
|
|
5299
|
-
this.updateLabelmapImageIdReferenceMap({
|
|
5300
|
-
segmentationId,
|
|
5301
|
-
referenceImageId,
|
|
5302
|
-
labelmapImageId,
|
|
5303
|
-
});
|
|
5304
|
-
}
|
|
5305
|
-
}
|
|
5306
|
-
});
|
|
5307
|
-
});
|
|
5308
|
-
}
|
|
5309
|
-
updateLabelmapImageIdReferenceMap({ segmentationId, referenceImageId, labelmapImageId, }) {
|
|
5310
|
-
const key = this.generateMapKey({ segmentationId, referenceImageId });
|
|
5311
|
-
if (!this.labelmapImageIdReferenceMap.has(key)) {
|
|
5312
|
-
this.setLabelmapImageIds(segmentationId, key, [labelmapImageId]);
|
|
5313
|
-
return;
|
|
5314
|
-
}
|
|
5315
|
-
const currentValues = this.labelmapImageIdReferenceMap.get(key) ?? [];
|
|
5316
|
-
const newValues = Array.from(new Set([...currentValues, labelmapImageId]));
|
|
5317
|
-
this.setLabelmapImageIds(segmentationId, key, newValues);
|
|
5318
|
-
}
|
|
5319
|
-
generateMapKey({ segmentationId, referenceImageId }) {
|
|
5320
|
-
return `${segmentationId}-${referenceImageId}`;
|
|
5321
|
-
}
|
|
5322
|
-
}
|
|
5323
|
-
/* export default */ __webpack_exports__.A = (LabelmapImageReferenceResolver);
|
|
5324
|
-
|
|
5325
|
-
|
|
5326
5004
|
},
|
|
5327
5005
|
53325(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
5328
5006
|
/* import */ var _cornerstonejs_core__rspack_import_0 = __webpack_require__(62721);
|
|
5329
5007
|
/* import */ var _normalizeLabelmapSegmentationData_js__rspack_import_1 = __webpack_require__(18782);
|
|
5330
5008
|
/* import */ var _labelmapImageIdMapping_js__rspack_import_2 = __webpack_require__(27749);
|
|
5009
|
+
/* import */ var _dynamicLabelmapVolume_js__rspack_import_3 = __webpack_require__(74136);
|
|
5010
|
+
|
|
5331
5011
|
|
|
5332
5012
|
|
|
5333
5013
|
|
|
@@ -5389,7 +5069,32 @@ function getOrCreateLabelmapVolume(layer) {
|
|
|
5389
5069
|
if (cachedVolume) {
|
|
5390
5070
|
return tagLabelmapVolume(cachedVolume);
|
|
5391
5071
|
}
|
|
5392
|
-
return tagLabelmapVolume(
|
|
5072
|
+
return tagLabelmapVolume((0,_dynamicLabelmapVolume_js__rspack_import_3/* .createDynamicLabelmapVolume */.Ix)(volumeId, layer) ??
|
|
5073
|
+
_cornerstonejs_core__rspack_import_0.volumeLoader.createAndCacheVolumeFromImagesSync(volumeId, imageIds));
|
|
5074
|
+
}
|
|
5075
|
+
const staticLabelmapLayers = new WeakSet();
|
|
5076
|
+
function getOrCreateDynamicLabelmapVolume(segmentation) {
|
|
5077
|
+
const layer = getLabelmap(segmentation, (0,_normalizeLabelmapSegmentationData_js__rspack_import_1/* .ensureLabelmapState */.uk)(segmentation)?.primaryLabelmapId);
|
|
5078
|
+
if (!layer || staticLabelmapLayers.has(layer)) {
|
|
5079
|
+
return;
|
|
5080
|
+
}
|
|
5081
|
+
const volumeId = layer.volumeId ?? layer.geometryVolumeId ?? `${layer.labelmapId}-geometry`;
|
|
5082
|
+
const cachedVolume = _cornerstonejs_core__rspack_import_0.cache.getVolume(volumeId);
|
|
5083
|
+
const volume = cachedVolume
|
|
5084
|
+
? (0,_dynamicLabelmapVolume_js__rspack_import_3/* .isDynamicLabelmapVolume */.UP)(cachedVolume)
|
|
5085
|
+
? cachedVolume
|
|
5086
|
+
: undefined
|
|
5087
|
+
: layer.imageIds?.length &&
|
|
5088
|
+
!layer.volumeId &&
|
|
5089
|
+
!hasDuplicateReferencedImageIds(layer) &&
|
|
5090
|
+
(0,_dynamicLabelmapVolume_js__rspack_import_3/* .createDynamicLabelmapVolume */.Ix)(volumeId, layer);
|
|
5091
|
+
if (!volume) {
|
|
5092
|
+
staticLabelmapLayers.add(layer);
|
|
5093
|
+
return;
|
|
5094
|
+
}
|
|
5095
|
+
layer.geometryVolumeId ??= layer.volumeId ? undefined : volumeId;
|
|
5096
|
+
(0,_dynamicLabelmapVolume_js__rspack_import_3/* .setDynamicLabelmapVolumeId */.v0)(segmentation.segmentationId, volumeId);
|
|
5097
|
+
return tagLabelmapVolume(volume);
|
|
5393
5098
|
}
|
|
5394
5099
|
function getOrCreateMergedStackLabelmapVolume(layer) {
|
|
5395
5100
|
if (layer.volumeId || !hasDuplicateReferencedImageIds(layer)) {
|
|
@@ -5499,6 +5204,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
5499
5204
|
$n: () => (removeLabelmap),
|
|
5500
5205
|
AD: () => (registerLabelmap),
|
|
5501
5206
|
Hs: () => (getLabelmap),
|
|
5207
|
+
bx: () => (getOrCreateDynamicLabelmapVolume),
|
|
5502
5208
|
kL: () => (getOrCreateLabelmapVolume),
|
|
5503
5209
|
m: () => (getLabelmaps)
|
|
5504
5210
|
});
|
|
@@ -6871,7 +6577,7 @@ class BrushTool extends _LabelmapBaseTool_js__rspack_import_9/* ["default"] */.A
|
|
|
6871
6577
|
viewport,
|
|
6872
6578
|
strategy: activeStrategy,
|
|
6873
6579
|
});
|
|
6874
|
-
if (!operationData) {
|
|
6580
|
+
if (!operationData || !strategyData) {
|
|
6875
6581
|
return;
|
|
6876
6582
|
}
|
|
6877
6583
|
const memo = this.createMemo(operationData.segmentationId, strategyData.segmentationVoxelManager);
|
|
@@ -10529,6 +10235,8 @@ async function runGrowCut(referenceVolumeId, labelmapVolumeId, options = DEFAULT
|
|
|
10529
10235
|
let numIterations = Math.floor(Math.sqrt(rows ** 2 + columns ** 2 + numSlices ** 2) / 2);
|
|
10530
10236
|
numIterations = Math.min(numIterations, 500);
|
|
10531
10237
|
const labelmapData = labelmap.voxelManager.getCompleteScalarDataArray();
|
|
10238
|
+
const getTimePoint = () => labelmap.voxelManager.getCurrentDimensionGroupNumber?.();
|
|
10239
|
+
const startTimePoint = getTimePoint();
|
|
10532
10240
|
let volumePixelData = volume.voxelManager.getCompleteScalarDataArray();
|
|
10533
10241
|
if (!(volumePixelData instanceof Float32Array)) {
|
|
10534
10242
|
volumePixelData = new Float32Array(volumePixelData);
|
|
@@ -10808,6 +10516,9 @@ async function runGrowCut(referenceVolumeId, labelmapVolumeId, options = DEFAULT
|
|
|
10808
10516
|
const maxX = boundsResult[3];
|
|
10809
10517
|
const maxY = boundsResult[4];
|
|
10810
10518
|
const maxZ = boundsResult[5];
|
|
10519
|
+
if (getTimePoint() !== startTimePoint) {
|
|
10520
|
+
return;
|
|
10521
|
+
}
|
|
10811
10522
|
labelmap.voxelManager.setCompleteScalarDataArray(labelmapData);
|
|
10812
10523
|
labelmap.voxelManager.clearBounds();
|
|
10813
10524
|
labelmap.voxelManager.setBounds([
|