分割清除内存问题
continuous-integration/drone/push Build is passing Details

uat_us
wangxiaoshuang 2026-04-17 11:49:00 +08:00
parent 43aa371c36
commit 74c5d032fb
2 changed files with 10 additions and 3 deletions

View File

@ -402,6 +402,7 @@ export default {
this.statsKey = getCustomizeStandardsSegmentDicomTools('Labelmap')[0].props.filter(item => item !== 'width' && item !== 'length')
// console.log(segmentation, 'segmentation')
// console.log(annotation, 'annotation')
console.log(cache, 'cache')
eventTarget.addEventListener(
'CORNERSTONE_TOOLS_SEGMENTATION_DATA_MODIFIED',
this.segmentationModifiedCallback
@ -885,6 +886,11 @@ export default {
if (!res) return false
segmentation.removeSegmentation(this.segmentationId)
segmentation.state.removeSegmentation(this.segmentationId)
let volume = cache.getVolume(this.segmentationId)
// 1. Volume
volume.destroy();
// 2.
volume.removeFromCache();
let groupIndex = this.segmentList.findIndex(item => item.segmentationId === this.segmentationId)
this.segmentList.splice(groupIndex, 1)
let annotations = annotation.state.getAllAnnotations().filter(item => item.metadata.segmentationId === this.segmentationId);
@ -895,7 +901,7 @@ export default {
this.segmentationId = this.segmentList[0].segmentationId;
this.selectSegmentGroup()
} else {
this.segmentationId = ''
this.segmentationId = null
}
// this.readingSegmentByConfig()
this.resetViewport()

View File

@ -229,6 +229,7 @@ function selectSegmentation(viewportId, segmentationId) {
segmentation.activeSegmentation.setActiveSegmentation(viewportId, segmentationId)
}
function selectSegment(viewportId, segmentationId, segmentIndex) {
if (!segmentIndex) return false
selectSegmentation(viewportId, segmentationId)
segmentation.segmentIndex.setActiveSegmentIndex(segmentationId, segmentIndex);
}