@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.
Files changed (33) hide show
  1. package/dist/{8923.bundle.8b682e96.js → 1183.bundle.bb27988c.js} +36 -329
  2. package/dist/{1645.bundle.1a466b16.js → 1645.bundle.ca31eb2f.js} +350 -41
  3. package/dist/{8729.bundle.e17fe9b2.js → 1654.bundle.d6a57234.js} +277 -15
  4. package/dist/{204.bundle.bc44c201.js → 204.bundle.9bb87642.js} +1 -1
  5. package/dist/{641.bundle.8e45751e.js → 2492.bundle.29d1731e.js} +336 -2
  6. package/dist/{3366.bundle.d9e78e25.js → 3366.bundle.54300d70.js} +3 -3
  7. package/dist/{4487.bundle.fa0375a4.js → 4487.bundle.d04fb8a6.js} +11 -16
  8. package/dist/{4606.bundle.6c297e2a.js → 4606.bundle.6191768a.js} +2 -2
  9. package/dist/{8312.bundle.d67b6f4e.js → 4718.bundle.e4f1e836.js} +83 -30
  10. package/dist/{4998.bundle.25b8cbfe.js → 4998.bundle.93ec76dd.js} +2 -2
  11. package/dist/{5143.bundle.53156bb0.js → 5143.bundle.cb1a942d.js} +32 -15
  12. package/dist/{5154.bundle.ccd02dd7.js → 5154.bundle.7806c0de.js} +2 -2
  13. package/dist/{5320.bundle.c17eb4a7.js → 5320.bundle.5686617c.js} +53 -342
  14. package/dist/{287.bundle.ee60c370.js → 5636.bundle.d736d89a.js} +92 -50
  15. package/dist/{6253.bundle.e9360b9a.js → 6253.bundle.da4ecc40.js} +676 -9
  16. package/dist/{6314.bundle.5aadfe48.js → 6314.bundle.907b94ea.js} +132 -50
  17. package/dist/{6507.bundle.bbcdd01e.js → 6507.bundle.1f9bcad5.js} +2 -2
  18. package/dist/{6956.bundle.dc0e8660.js → 6956.bundle.3e1bfe44.js} +188 -102
  19. package/dist/{7526.bundle.3460c3ca.js → 7526.bundle.22fdc0bb.js} +2 -2
  20. package/dist/{8868.bundle.8f3653b3.js → 8868.bundle.b2dc2ccb.js} +4 -4
  21. package/dist/{5076.bundle.2a14756f.js → 915.bundle.48917224.js} +1 -22
  22. package/dist/{9187.bundle.407afa07.js → 9187.bundle.bd5c0f55.js} +2 -2
  23. package/dist/{9481.bundle.d045ae3a.js → 9481.bundle.df453a4a.js} +2 -2
  24. package/dist/{9620.bundle.b4cc392c.js → 9620.bundle.a7dbe946.js} +4 -4
  25. package/dist/{9889.bundle.bf312047.js → 9889.bundle.6dee52c5.js} +138 -61
  26. package/dist/{app.bundle.6472f60b.js → app.bundle.9f4c5572.js} +48 -44
  27. package/dist/app.bundle.css +21 -9
  28. package/dist/{compute.bundle.9267d449.js → compute.bundle.34155635.js} +10 -10
  29. package/dist/index.html +1 -1
  30. package/dist/{interpolation.bundle.ee9998a4.js → interpolation.bundle.244cf3e9.js} +6 -6
  31. package/dist/{polySeg.bundle.a55f8eee.js → polySeg.bundle.58b3a681.js} +10 -10
  32. package/dist/sw.js +1 -1
  33. package/package.json +6 -6
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- (globalThis["rspackChunk_ohif_app"] ||= []).push([[8923], {
2
+ (globalThis["rspackChunk_ohif_app"] ||= []).push([[1183], {
3
3
  45376(__unused_rspack___webpack_module__, __webpack_exports__) {
4
4
  const CORNERSTONE_COLOR_LUT = [
5
5
  [0, 0, 0, 0],
@@ -829,337 +829,13 @@ __webpack_require__.d(__webpack_exports__, {
829
829
  });
830
830
 
831
831
 
832
- },
833
- 78691(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
834
- /* import */ var _cornerstonejs_core__rspack_import_0 = __webpack_require__(62721);
835
- /* import */ var _helpers_getViewportLabelmapRenderMode_js__rspack_import_1 = __webpack_require__(15422);
836
- /* import */ var _normalizeLabelmapSegmentationData_js__rspack_import_2 = __webpack_require__(18782);
837
- /* import */ var _labelmapLayerStore_js__rspack_import_3 = __webpack_require__(53325);
838
- /* import */ var _labelmapSegmentBindings_js__rspack_import_4 = __webpack_require__(53344);
839
- /* import */ var _labelmapLegacyAdapter_js__rspack_import_5 = __webpack_require__(19637);
840
- /* import */ var _labelmapImageIdMapping_js__rspack_import_6 = __webpack_require__(27749);
841
-
842
-
843
-
844
-
845
-
846
-
847
-
848
- class LabelmapImageReferenceResolver {
849
- constructor(getSegmentation) {
850
- this.stackLabelmapImageIdReferenceMap = new Map();
851
- this.labelmapImageIdReferenceMap = new Map();
852
- this.keysBySegmentationId = new Map();
853
- this.completedScanResultsBySegmentationId = new Map();
854
- this.getSegmentation = getSegmentation;
855
- }
856
- reset() {
857
- this.stackLabelmapImageIdReferenceMap.clear();
858
- this.labelmapImageIdReferenceMap.clear();
859
- this.keysBySegmentationId.clear();
860
- this.completedScanResultsBySegmentationId.clear();
861
- }
862
- removeSegmentation(segmentationId) {
863
- this.stackLabelmapImageIdReferenceMap.delete(segmentationId);
864
- this.completedScanResultsBySegmentationId.delete(segmentationId);
865
- const keys = this.keysBySegmentationId.get(segmentationId);
866
- if (keys) {
867
- for (const key of keys) {
868
- this.labelmapImageIdReferenceMap.delete(key);
869
- }
870
- this.keysBySegmentationId.delete(segmentationId);
871
- }
872
- }
873
- setLabelmapImageIds(segmentationId, key, labelmapImageIds) {
874
- this.labelmapImageIdReferenceMap.set(key, labelmapImageIds);
875
- let keys = this.keysBySegmentationId.get(segmentationId);
876
- if (!keys) {
877
- keys = new Set();
878
- this.keysBySegmentationId.set(segmentationId, keys);
879
- }
880
- keys.add(key);
881
- }
882
- getLabelmapImageIds(representationData) {
883
- const labelmapData = representationData.Labelmap;
884
- let labelmapImageIds;
885
- if (!labelmapData) {
886
- return;
887
- }
888
- if (labelmapData?.labelmaps) {
889
- const imageIds = Object.values(labelmapData.labelmaps).flatMap((layer) => {
890
- if (layer.imageIds?.length) {
891
- return layer.imageIds;
892
- }
893
- if (layer.volumeId) {
894
- return _cornerstonejs_core__rspack_import_0.cache.getVolume(layer.volumeId)
895
- ?.imageIds;
896
- }
897
- return [];
898
- });
899
- return Array.from(new Set(imageIds.filter(Boolean)));
900
- }
901
- if (labelmapData.imageIds) {
902
- labelmapImageIds = labelmapData
903
- .imageIds;
904
- }
905
- else if (labelmapData.volumeId) {
906
- const volumeId = labelmapData
907
- .volumeId;
908
- const volume = _cornerstonejs_core__rspack_import_0.cache.getVolume(volumeId);
909
- labelmapImageIds = volume.imageIds;
910
- }
911
- return labelmapImageIds;
912
- }
913
- getLabelmapImageIdsForImageId(imageId, segmentationId) {
914
- const segmentation = this.getSegmentation(segmentationId);
915
- if (!segmentation?.representationData?.Labelmap) {
916
- return;
917
- }
918
- (0,_normalizeLabelmapSegmentationData_js__rspack_import_2/* .ensureLabelmapState */.uk)(segmentation);
919
- return (0,_labelmapLegacyAdapter_js__rspack_import_5/* .getReferencedImageIdToCurrentImageIdMap */._)(segmentation).get(imageId);
920
- }
921
- updateLabelmapSegmentationImageReferences(viewportId, segmentationId) {
922
- const segmentation = this.getSegmentation(segmentationId);
923
- if (!segmentation) {
924
- return;
925
- }
926
- if (!this.stackLabelmapImageIdReferenceMap.has(segmentationId)) {
927
- this.stackLabelmapImageIdReferenceMap.set(segmentationId, new Map());
928
- }
929
- const { representationData } = segmentation;
930
- if (!representationData.Labelmap) {
931
- return;
932
- }
933
- const labelmapImageIds = this.getLabelmapImageIds(representationData);
934
- const enabledElement = (0,_cornerstonejs_core__rspack_import_0.getEnabledElementByViewportId)(viewportId);
935
- if (!enabledElement || !labelmapImageIds?.length) {
936
- return;
937
- }
938
- const viewport = enabledElement.viewport;
939
- const scanKey = this.generateScanKey('current', viewport, labelmapImageIds);
940
- if (scanKey && this.hasCompletedScan(segmentationId, scanKey)) {
941
- return this.getCompletedScanResult(segmentationId, scanKey);
942
- }
943
- const result = this.updateLabelmapSegmentationReferences(segmentationId, viewport, labelmapImageIds);
944
- if (scanKey) {
945
- this.markCompletedScan(segmentationId, scanKey, result);
946
- }
947
- return result;
948
- }
949
- generateScanKey(kind, viewport, labelmapImageIds) {
950
- const referenceImageId = typeof viewport.getCurrentImageId === 'function'
951
- ? viewport.getCurrentImageId()
952
- : undefined;
953
- if (!referenceImageId) {
954
- return;
955
- }
956
- return `${kind}|${viewport.id}|${referenceImageId}|${labelmapImageIds.length}|${labelmapImageIds[0]}|${labelmapImageIds[labelmapImageIds.length - 1]}`;
957
- }
958
- hasCompletedScan(segmentationId, scanKey) {
959
- return !!this.completedScanResultsBySegmentationId
960
- .get(segmentationId)
961
- ?.has(scanKey);
962
- }
963
- getCompletedScanResult(segmentationId, scanKey) {
964
- return this.completedScanResultsBySegmentationId
965
- .get(segmentationId)
966
- ?.get(scanKey);
967
- }
968
- markCompletedScan(segmentationId, scanKey, result) {
969
- let results = this.completedScanResultsBySegmentationId.get(segmentationId);
970
- if (!results) {
971
- results = new Map();
972
- this.completedScanResultsBySegmentationId.set(segmentationId, results);
973
- }
974
- results.set(scanKey, result);
975
- }
976
- getCurrentLabelmapImageIdsForViewport(viewportId, segmentationId) {
977
- const enabledElement = (0,_cornerstonejs_core__rspack_import_0.getEnabledElementByViewportId)(viewportId);
978
- if (!enabledElement) {
979
- return;
980
- }
981
- const { viewport } = enabledElement;
982
- const viewportRenderMode = (0,_helpers_getViewportLabelmapRenderMode_js__rspack_import_1/* ["default"] */.A)(viewport);
983
- if (viewportRenderMode !== 'image' ||
984
- typeof viewport.getCurrentImageId !== 'function') {
985
- return;
986
- }
987
- const referenceImageId = viewport.getCurrentImageId();
988
- const segmentation = this.getSegmentation(segmentationId);
989
- if (!segmentation) {
990
- return;
991
- }
992
- (0,_normalizeLabelmapSegmentationData_js__rspack_import_2/* .ensureLabelmapState */.uk)(segmentation);
993
- const viewportImageIds = viewport.getImageIds();
994
- const currentIndex = viewportImageIds.indexOf(referenceImageId);
995
- const labelmapImageIds = [];
996
- (0,_labelmapLayerStore_js__rspack_import_3/* .getLabelmaps */.m)(segmentation).forEach((layer) => {
997
- const referencedLabelmapImageIds = (0,_labelmapImageIdMapping_js__rspack_import_6/* .getLabelmapImageIdsForReferencedImageId */.s_)(layer, referenceImageId);
998
- if (referencedLabelmapImageIds.length) {
999
- labelmapImageIds.push(...referencedLabelmapImageIds);
1000
- return;
1001
- }
1002
- if (currentIndex !== -1 && layer.imageIds?.[currentIndex]) {
1003
- labelmapImageIds.push(layer.imageIds[currentIndex]);
1004
- return;
1005
- }
1006
- layer.imageIds?.some((candidateImageId) => {
1007
- const viewableImageId = viewport.isReferenceViewable({ referencedImageId: candidateImageId }, { asOverlay: true });
1008
- if (viewableImageId) {
1009
- labelmapImageIds.push(candidateImageId);
1010
- }
1011
- return !!viewableImageId;
1012
- });
1013
- });
1014
- const resolvedImageIds = Array.from(new Set(labelmapImageIds));
1015
- const key = this.generateMapKey({
1016
- segmentationId,
1017
- referenceImageId,
1018
- });
1019
- this.setLabelmapImageIds(segmentationId, key, resolvedImageIds);
1020
- if (!this.stackLabelmapImageIdReferenceMap.has(segmentationId)) {
1021
- this.stackLabelmapImageIdReferenceMap.set(segmentationId, new Map());
1022
- }
1023
- const activeSegmentIndex = Object.keys(segmentation.segments).find((segmentIndex) => segmentation.segments[segmentIndex].active);
1024
- const activeImageId = activeSegmentIndex
1025
- ? (0,_labelmapSegmentBindings_js__rspack_import_4/* .getLabelmapForSegment */.r)(segmentation, Number(activeSegmentIndex))
1026
- ?.imageIds?.[currentIndex]
1027
- : undefined;
1028
- this.stackLabelmapImageIdReferenceMap
1029
- .get(segmentationId)
1030
- .set(referenceImageId, activeImageId ?? resolvedImageIds[0]);
1031
- return resolvedImageIds;
1032
- }
1033
- getCurrentLabelmapImageIdForViewport(viewportId, segmentationId) {
1034
- const enabledElement = (0,_cornerstonejs_core__rspack_import_0.getEnabledElementByViewportId)(viewportId);
1035
- if (!enabledElement) {
1036
- return;
1037
- }
1038
- const { viewport } = enabledElement;
1039
- const viewportRenderMode = (0,_helpers_getViewportLabelmapRenderMode_js__rspack_import_1/* ["default"] */.A)(viewport);
1040
- if (viewportRenderMode !== 'image' ||
1041
- typeof viewport.getCurrentImageId !== 'function') {
1042
- return;
1043
- }
1044
- const currentImageId = viewport.getCurrentImageId();
1045
- const currentImageIds = this.getCurrentLabelmapImageIdsForViewport(viewportId, segmentationId);
1046
- if (!currentImageIds?.length) {
1047
- return;
1048
- }
1049
- const segmentation = this.getSegmentation(segmentationId);
1050
- const currentIndex = viewport
1051
- .getImageIds()
1052
- .indexOf(currentImageId);
1053
- const activeSegmentIndex = segmentation
1054
- ? Object.keys(segmentation.segments).find((segmentIndex) => segmentation.segments[segmentIndex].active)
1055
- : undefined;
1056
- const activeImageId = segmentation && activeSegmentIndex
1057
- ? (0,_labelmapSegmentBindings_js__rspack_import_4/* .getLabelmapForSegment */.r)(segmentation, Number(activeSegmentIndex))
1058
- ?.imageIds?.[currentIndex]
1059
- : undefined;
1060
- return activeImageId ?? currentImageIds[0];
1061
- }
1062
- getStackSegmentationImageIdsForViewport(viewportId, segmentationId) {
1063
- const segmentation = this.getSegmentation(segmentationId);
1064
- if (!segmentation) {
1065
- return [];
1066
- }
1067
- this.updateAllLabelmapSegmentationImageReferences(viewportId, segmentationId);
1068
- const enabledElement = (0,_cornerstonejs_core__rspack_import_0.getEnabledElementByViewportId)(viewportId);
1069
- const imageIds = enabledElement?.viewport.getImageIds?.() ?? [];
1070
- const imageIdMap = (0,_labelmapLegacyAdapter_js__rspack_import_5/* .getReferencedImageIdToCurrentImageIdMap */._)(segmentation);
1071
- return imageIds.flatMap((imageId) => imageIdMap.get(imageId) ?? []);
1072
- }
1073
- updateLabelmapSegmentationReferences(segmentationId, viewport, labelmapImageIds, updateCallback) {
1074
- const referenceImageId = viewport.getCurrentImageId();
1075
- let viewableLabelmapImageIdFound = false;
1076
- for (const labelmapImageId of labelmapImageIds) {
1077
- const viewableImageId = viewport.isReferenceViewable({ referencedImageId: labelmapImageId }, { asOverlay: true });
1078
- if (viewableImageId) {
1079
- viewableLabelmapImageIdFound = true;
1080
- this.stackLabelmapImageIdReferenceMap
1081
- .get(segmentationId)
1082
- .set(referenceImageId, labelmapImageId);
1083
- this.updateLabelmapImageIdReferenceMap({
1084
- segmentationId,
1085
- referenceImageId,
1086
- labelmapImageId,
1087
- });
1088
- }
1089
- }
1090
- updateCallback?.(viewport, segmentationId, labelmapImageIds);
1091
- return viewableLabelmapImageIdFound
1092
- ? this.stackLabelmapImageIdReferenceMap
1093
- .get(segmentationId)
1094
- .get(referenceImageId)
1095
- : undefined;
1096
- }
1097
- updateAllLabelmapSegmentationImageReferences(viewportId, segmentationId) {
1098
- const segmentation = this.getSegmentation(segmentationId);
1099
- if (!segmentation) {
1100
- return;
1101
- }
1102
- if (!this.stackLabelmapImageIdReferenceMap.has(segmentationId)) {
1103
- this.stackLabelmapImageIdReferenceMap.set(segmentationId, new Map());
1104
- }
1105
- const { representationData } = segmentation;
1106
- if (!representationData.Labelmap) {
1107
- return;
1108
- }
1109
- const labelmapImageIds = this.getLabelmapImageIds(representationData);
1110
- const enabledElement = (0,_cornerstonejs_core__rspack_import_0.getEnabledElementByViewportId)(viewportId);
1111
- if (!enabledElement || !labelmapImageIds?.length) {
1112
- return;
1113
- }
1114
- const stackViewport = enabledElement.viewport;
1115
- const scanKey = this.generateScanKey('all', stackViewport, labelmapImageIds);
1116
- if (scanKey && this.hasCompletedScan(segmentationId, scanKey)) {
1117
- return;
1118
- }
1119
- if (scanKey) {
1120
- this.markCompletedScan(segmentationId, scanKey);
1121
- }
1122
- this.updateLabelmapSegmentationReferences(segmentationId, stackViewport, labelmapImageIds, (stackViewport, segmentationId, labelmapImageIds) => {
1123
- const imageIds = stackViewport.getImageIds();
1124
- imageIds.forEach((referenceImageId, index) => {
1125
- for (const labelmapImageId of labelmapImageIds) {
1126
- const viewableImageId = stackViewport.isReferenceViewable({ referencedImageId: labelmapImageId, sliceIndex: index }, { asOverlay: true, withNavigation: true });
1127
- if (viewableImageId) {
1128
- this.stackLabelmapImageIdReferenceMap
1129
- .get(segmentationId)
1130
- .set(referenceImageId, labelmapImageId);
1131
- this.updateLabelmapImageIdReferenceMap({
1132
- segmentationId,
1133
- referenceImageId,
1134
- labelmapImageId,
1135
- });
1136
- }
1137
- }
1138
- });
1139
- });
1140
- }
1141
- updateLabelmapImageIdReferenceMap({ segmentationId, referenceImageId, labelmapImageId, }) {
1142
- const key = this.generateMapKey({ segmentationId, referenceImageId });
1143
- if (!this.labelmapImageIdReferenceMap.has(key)) {
1144
- this.setLabelmapImageIds(segmentationId, key, [labelmapImageId]);
1145
- return;
1146
- }
1147
- const currentValues = this.labelmapImageIdReferenceMap.get(key) ?? [];
1148
- const newValues = Array.from(new Set([...currentValues, labelmapImageId]));
1149
- this.setLabelmapImageIds(segmentationId, key, newValues);
1150
- }
1151
- generateMapKey({ segmentationId, referenceImageId }) {
1152
- return `${segmentationId}-${referenceImageId}`;
1153
- }
1154
- }
1155
- /* export default */ __webpack_exports__.A = (LabelmapImageReferenceResolver);
1156
-
1157
-
1158
832
  },
1159
833
  53325(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
1160
834
  /* import */ var _cornerstonejs_core__rspack_import_0 = __webpack_require__(62721);
1161
835
  /* import */ var _normalizeLabelmapSegmentationData_js__rspack_import_1 = __webpack_require__(18782);
1162
836
  /* import */ var _labelmapImageIdMapping_js__rspack_import_2 = __webpack_require__(27749);
837
+ /* import */ var _dynamicLabelmapVolume_js__rspack_import_3 = __webpack_require__(74136);
838
+
1163
839
 
1164
840
 
1165
841
 
@@ -1221,7 +897,32 @@ function getOrCreateLabelmapVolume(layer) {
1221
897
  if (cachedVolume) {
1222
898
  return tagLabelmapVolume(cachedVolume);
1223
899
  }
1224
- return tagLabelmapVolume(_cornerstonejs_core__rspack_import_0.volumeLoader.createAndCacheVolumeFromImagesSync(volumeId, imageIds));
900
+ return tagLabelmapVolume((0,_dynamicLabelmapVolume_js__rspack_import_3/* .createDynamicLabelmapVolume */.Ix)(volumeId, layer) ??
901
+ _cornerstonejs_core__rspack_import_0.volumeLoader.createAndCacheVolumeFromImagesSync(volumeId, imageIds));
902
+ }
903
+ const staticLabelmapLayers = new WeakSet();
904
+ function getOrCreateDynamicLabelmapVolume(segmentation) {
905
+ const layer = getLabelmap(segmentation, (0,_normalizeLabelmapSegmentationData_js__rspack_import_1/* .ensureLabelmapState */.uk)(segmentation)?.primaryLabelmapId);
906
+ if (!layer || staticLabelmapLayers.has(layer)) {
907
+ return;
908
+ }
909
+ const volumeId = layer.volumeId ?? layer.geometryVolumeId ?? `${layer.labelmapId}-geometry`;
910
+ const cachedVolume = _cornerstonejs_core__rspack_import_0.cache.getVolume(volumeId);
911
+ const volume = cachedVolume
912
+ ? (0,_dynamicLabelmapVolume_js__rspack_import_3/* .isDynamicLabelmapVolume */.UP)(cachedVolume)
913
+ ? cachedVolume
914
+ : undefined
915
+ : layer.imageIds?.length &&
916
+ !layer.volumeId &&
917
+ !hasDuplicateReferencedImageIds(layer) &&
918
+ (0,_dynamicLabelmapVolume_js__rspack_import_3/* .createDynamicLabelmapVolume */.Ix)(volumeId, layer);
919
+ if (!volume) {
920
+ staticLabelmapLayers.add(layer);
921
+ return;
922
+ }
923
+ layer.geometryVolumeId ??= layer.volumeId ? undefined : volumeId;
924
+ (0,_dynamicLabelmapVolume_js__rspack_import_3/* .setDynamicLabelmapVolumeId */.v0)(segmentation.segmentationId, volumeId);
925
+ return tagLabelmapVolume(volume);
1225
926
  }
1226
927
  function getOrCreateMergedStackLabelmapVolume(layer) {
1227
928
  if (layer.volumeId || !hasDuplicateReferencedImageIds(layer)) {
@@ -1334,6 +1035,7 @@ __webpack_require__.d(__webpack_exports__, {
1334
1035
  Hs: () => (getLabelmap),
1335
1036
  M4: () => (getLabelmapForImageId),
1336
1037
  X1: () => (tagLabelmapVolume),
1038
+ bx: () => (getOrCreateDynamicLabelmapVolume),
1337
1039
  kL: () => (getOrCreateLabelmapVolume),
1338
1040
  m: () => (getLabelmaps)
1339
1041
  });
@@ -5309,7 +5011,7 @@ class BrushTool extends _LabelmapBaseTool_js__rspack_import_9/* ["default"] */.A
5309
5011
  viewport,
5310
5012
  strategy: activeStrategy,
5311
5013
  });
5312
- if (!operationData) {
5014
+ if (!operationData || !strategyData) {
5313
5015
  return;
5314
5016
  }
5315
5017
  const memo = this.createMemo(operationData.segmentationId, strategyData.segmentationVoxelManager);
@@ -9075,6 +8777,8 @@ async function runGrowCut(referenceVolumeId, labelmapVolumeId, options = DEFAULT
9075
8777
  let numIterations = Math.floor(Math.sqrt(rows ** 2 + columns ** 2 + numSlices ** 2) / 2);
9076
8778
  numIterations = Math.min(numIterations, 500);
9077
8779
  const labelmapData = labelmap.voxelManager.getCompleteScalarDataArray();
8780
+ const getTimePoint = () => labelmap.voxelManager.getCurrentDimensionGroupNumber?.();
8781
+ const startTimePoint = getTimePoint();
9078
8782
  let volumePixelData = volume.voxelManager.getCompleteScalarDataArray();
9079
8783
  if (!(volumePixelData instanceof Float32Array)) {
9080
8784
  volumePixelData = new Float32Array(volumePixelData);
@@ -9354,6 +9058,9 @@ async function runGrowCut(referenceVolumeId, labelmapVolumeId, options = DEFAULT
9354
9058
  const maxX = boundsResult[3];
9355
9059
  const maxY = boundsResult[4];
9356
9060
  const maxZ = boundsResult[5];
9061
+ if (getTimePoint() !== startTimePoint) {
9062
+ return;
9063
+ }
9357
9064
  labelmap.voxelManager.setCompleteScalarDataArray(labelmapData);
9358
9065
  labelmap.voxelManager.clearBounds();
9359
9066
  labelmap.voxelManager.setBounds([