分割标记橡皮檫工具问题解决
continuous-integration/drone/push Build is passing Details

rj
wangxiaoshuang 2026-05-12 10:29:35 +08:00
parent 8f808d73b5
commit a55278e323
2 changed files with 83 additions and 83 deletions

View File

@ -285,8 +285,8 @@
<el-dialog :visible.sync="visible" :close-on-click-modal="false" <el-dialog :visible.sync="visible" :close-on-click-modal="false"
:title="$t('trials:reading:Segmentations:recovery')" width="850px"> :title="$t('trials:reading:Segmentations:recovery')" width="850px">
<el-table :data="recoveryList" style="width: 100%;background-color: #1e1e1e;"> <el-table :data="recoveryList" style="width: 100%;background-color: #1e1e1e;">
<el-table-column type="index" width="50" :label="$t('dictionary:template:globalConfig:order')"> <!-- <el-table-column type="index" width="50" :label="$t('dictionary:template:globalConfig:order')">
</el-table-column> </el-table-column> -->
<el-table-column property="Version" :label="$t('trials:reading:Segmentations:table:Version')"> <el-table-column property="Version" :label="$t('trials:reading:Segmentations:table:Version')">
</el-table-column> </el-table-column>
<el-table-column property="FileSize" :label="$t('trials:reading:Segmentations:table:FileSize')"> <el-table-column property="FileSize" :label="$t('trials:reading:Segmentations:table:FileSize')">
@ -294,6 +294,8 @@
{{ fileSizeFormatter(scope.row.FileSize) }} {{ fileSizeFormatter(scope.row.FileSize) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column property="StartTime" :label="$t('trials:reading:Segmentations:table:StartTime')">
</el-table-column>
<el-table-column property="CreateTime" :label="$t('trials:reading:Segmentations:table:CreateTime')"> <el-table-column property="CreateTime" :label="$t('trials:reading:Segmentations:table:CreateTime')">
</el-table-column> </el-table-column>
<el-table-column :label="$t('common:action:action')" align="left" fixed="right"> <el-table-column :label="$t('common:action:action')" align="left" fixed="right">
@ -331,6 +333,7 @@ const {
LabelMapEditWithContourTool, LabelMapEditWithContourTool,
SegmentBidirectionalTool, SegmentBidirectionalTool,
CrosshairsTool, CrosshairsTool,
BrushTool,
utilities: CStUtils, utilities: CStUtils,
} = cornerstoneTools; } = cornerstoneTools;
@ -729,6 +732,9 @@ export default {
toolGroup.setToolActive(toolName, { toolGroup.setToolActive(toolName, {
bindings: [{ mouseButton: MouseBindings.Primary }] bindings: [{ mouseButton: MouseBindings.Primary }]
}) })
// if (toolName === 'CircularEraser') {
// console.log(toolGroup.getToolInstance(toolName))
// }
this.$emit('update:activeTool', toolName) this.$emit('update:activeTool', toolName)
this.setBrushSize(toolName) this.setBrushSize(toolName)
if (this.ThresholdTools.includes(toolName)) { if (this.ThresholdTools.includes(toolName)) {
@ -799,17 +805,19 @@ export default {
} }
let res = await restoreSegmentationVersion(data) let res = await restoreSegmentationVersion(data)
if (res.IsSuccess) { if (res.IsSuccess) {
segmentation.removeSegmentation(this.segmentationId)
segmentation.state.removeSegmentation(this.segmentationId)
let annotations = annotation.state.getAllAnnotations().filter(item => item.metadata.segmentationId && this.segmentationId === item.metadata.segmentationId && item.metadata.toolName === "SegmentBidirectional"); let annotations = annotation.state.getAllAnnotations().filter(item => item.metadata.segmentationId && this.segmentationId === item.metadata.segmentationId && item.metadata.toolName === "SegmentBidirectional");
annotations.forEach(item => { annotations.forEach(item => {
annotation.state.removeAnnotation(item.annotationUID) annotation.state.removeAnnotation(item.annotationUID)
}) })
let volume = cache.getVolume(this.segmentationId) // volume
// 1. Volume // 1.volume()
volume.destroy(); // let volume = cache.getVolume(this.segmentationId)
// 2. // // 1. Volume
volume.removeFromCache(); // volume.destroy();
// // 2.
// volume.removeFromCache();
// 2.
segmentation.removeSegmentation(this.segmentationId)
let imageId = null let imageId = null
if (this.curSegmentGroup.oldSegUrl) { if (this.curSegmentGroup.oldSegUrl) {
imageId = `wadouri:${this.OSSclientConfig.basePath}${this.curSegmentGroup.oldSegUrl}` imageId = `wadouri:${this.OSSclientConfig.basePath}${this.curSegmentGroup.oldSegUrl}`
@ -821,10 +829,15 @@ export default {
if (imageId && cache.getImage(imageId)) { if (imageId && cache.getImage(imageId)) {
cache.removeImageLoadObject(imageId) cache.removeImageLoadObject(imageId)
} }
this.getSegmentation(this.segmentationId)
DicomEvent.$emit('renderSegmentationBychangeSegmention') let r = await this.getSegmentation(this.segmentationId)
if (!r) return false
this.visible = false this.visible = false
this.$message.success(this.$t("trials:reading:Segmentations:message:restoreSuccess")) this.$message.success(this.$t("trials:reading:Segmentations:message:restoreSuccess"))
this.resetViewport()
this.$nextTick(() => {
DicomEvent.$emit('renderSegmentationBychangeSegmention')
})
} }
return false return false
} catch (err) { } catch (err) {
@ -1109,7 +1122,7 @@ export default {
if (key === 'segmentGroup') { if (key === 'segmentGroup') {
let group = this.segmentList.find(i => i.segmentationId === this.segmentationId) let group = this.segmentList.find(i => i.segmentationId === this.segmentationId)
group.name = name group.name = name
this.addOrUpdateSegmentation({ name, id: group.segmentationId }) this.addOrUpdateSegmentation({ name, id: group.segmentationId, url: group.segUrl })
} else { } else {
item.SegmentLabel = name item.SegmentLabel = name
this.addOrUpdateSegment({ name: item.SegmentLabel, color: item.color, segmentIndex: item.segmentIndex, segmentationId: item.segmentationId, segmentJson: JSON.stringify({ stats: item.stats, bidirectional: item.bidirectional }), id: item.id }) this.addOrUpdateSegment({ name: item.SegmentLabel, color: item.color, segmentIndex: item.segmentIndex, segmentationId: item.segmentationId, segmentJson: JSON.stringify({ stats: item.stats, bidirectional: item.bidirectional }), id: item.id })
@ -1630,24 +1643,6 @@ export default {
let segmentList = list ? list : this.segmentList let segmentList = list ? list : this.segmentList
if (segmentList.length <= 0) return false if (segmentList.length <= 0) return false
this.$emit("setToolsPassive") this.$emit("setToolsPassive")
// let questionNeedChange = false;
// if (saveSegment) {
// for (let i = 0; i < segmentList.length; i++) {
// let segmentGroup = segmentList[i]
// let data = {
// SegmentationId: segmentGroup.segmentationId
// }
// let res = await this.getSegmentBindingList(data)
// if (res && res.length > 0) {
// questionNeedChange = true
// break
// }
// }
// if (questionNeedChange) {
// let confirm = await this.$confirm(this.$t("segment:confirm:questionNeedChange"))
// if (!confirm) return false
// }
// }
this.$emit("update:globalLoading", true) this.$emit("update:globalLoading", true)
this.$emit("update:loadingText", this.$t("segment:loadingText:saveSegmentation")) this.$emit("update:loadingText", this.$t("segment:loadingText:saveSegmentation"))
let IsBeSegment = false let IsBeSegment = false
@ -1827,8 +1822,8 @@ export default {
} }
}, },
async getSegmentation(segmentationId) { async getSegmentation(segmentationId) {
return new Promise(async (resolve, reject) => {
try { try {
this.$emit('setToolsPassive')
let data = { let data = {
SeriesId: this.series.Id, SeriesId: this.series.Id,
VisitTaskId: this.series.TaskInfo.VisitTaskId, VisitTaskId: this.series.TaskInfo.VisitTaskId,
@ -1877,10 +1872,16 @@ export default {
this.segmentIndex = obj.segments[0].segmentIndex this.segmentIndex = obj.segments[0].segmentIndex
} }
this.isloaded = false this.isloaded = false
resolve(true)
} else {
resolve(false)
} }
} catch (err) { } catch (err) {
console.log(err) console.log(err)
resolve(false)
} }
})
}, },
// //
async getSegmentationList() { async getSegmentationList() {

View File

@ -67,7 +67,6 @@ async function readSegmentation(obj, series, segmentationId, isFile = false) {
const imageIdObj = await cornerstoneDICOMImageLoader.wadouri.loadImage(`wadouri:${Vue.prototype.OSSclientConfig.basePath}${obj}`).promise const imageIdObj = await cornerstoneDICOMImageLoader.wadouri.loadImage(`wadouri:${Vue.prototype.OSSclientConfig.basePath}${obj}`).promise
imageId = imageIdObj.imageId imageId = imageIdObj.imageId
} }
console.log(imageId, 'imageId')
const image = await imageLoader.loadAndCacheImage(imageId); const image = await imageLoader.loadAndCacheImage(imageId);
if (!image) { if (!image) {