分割标记橡皮檫工具问题解决
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
8f808d73b5
commit
a55278e323
|
|
@ -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,60 +1822,66 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async getSegmentation(segmentationId) {
|
async getSegmentation(segmentationId) {
|
||||||
try {
|
return new Promise(async (resolve, reject) => {
|
||||||
this.$emit('setToolsPassive')
|
try {
|
||||||
let data = {
|
let data = {
|
||||||
SeriesId: this.series.Id,
|
SeriesId: this.series.Id,
|
||||||
VisitTaskId: this.series.TaskInfo.VisitTaskId,
|
VisitTaskId: this.series.TaskInfo.VisitTaskId,
|
||||||
PageSize: 9999,
|
PageSize: 9999,
|
||||||
PageIndex: 1,
|
PageIndex: 1,
|
||||||
}
|
|
||||||
this.loading = true;
|
|
||||||
let res = await getSegmentationList(data);
|
|
||||||
this.loading = false;
|
|
||||||
if (res.IsSuccess) {
|
|
||||||
// this.segmentList = []
|
|
||||||
// this.segmentationId = null;
|
|
||||||
// this.segmentIndex = null;
|
|
||||||
let list = res.Result.CurrentPageData;
|
|
||||||
for (let i = 0; i < list.length; i++) {
|
|
||||||
let item = list[i]
|
|
||||||
if (item.Id !== segmentationId) continue;
|
|
||||||
let obj = this.segmentList.find(i => i.segmentationId === item.Id)
|
|
||||||
if (!obj) continue;
|
|
||||||
obj.name = item.SegmentationName;
|
|
||||||
obj.segUrl = item.SEGUrl;
|
|
||||||
obj.isSaved = item.IsSaved;
|
|
||||||
obj.segmentationId = item.Id;
|
|
||||||
obj.segments = []
|
|
||||||
if (!this.segmentationId) {
|
|
||||||
this.segmentationId = obj.segmentationId
|
|
||||||
}
|
|
||||||
let segments = await this.getSegmentList(item.Id)
|
|
||||||
segments.forEach((s, index) => {
|
|
||||||
let SegmentJson = s.SegmentJson ? JSON.parse(s.SegmentJson) : {};
|
|
||||||
let o = {
|
|
||||||
segmentIndex: s.SegmentNumber,
|
|
||||||
segmentationId: s.SegmentationId,
|
|
||||||
SegmentLabel: s.SegmentName,
|
|
||||||
color: s.ColorRgb,
|
|
||||||
stats: SegmentJson.stats,
|
|
||||||
bidirectional: SegmentJson.bidirectional,
|
|
||||||
bidirectionalView: true,
|
|
||||||
view: true,
|
|
||||||
lock: s.IsLock,
|
|
||||||
id: s.Id
|
|
||||||
}
|
|
||||||
obj.segments.push(o)
|
|
||||||
|
|
||||||
})
|
|
||||||
this.segmentIndex = obj.segments[0].segmentIndex
|
|
||||||
}
|
}
|
||||||
this.isloaded = false
|
this.loading = true;
|
||||||
|
let res = await getSegmentationList(data);
|
||||||
|
this.loading = false;
|
||||||
|
if (res.IsSuccess) {
|
||||||
|
// this.segmentList = []
|
||||||
|
// this.segmentationId = null;
|
||||||
|
// this.segmentIndex = null;
|
||||||
|
let list = res.Result.CurrentPageData;
|
||||||
|
for (let i = 0; i < list.length; i++) {
|
||||||
|
let item = list[i]
|
||||||
|
if (item.Id !== segmentationId) continue;
|
||||||
|
let obj = this.segmentList.find(i => i.segmentationId === item.Id)
|
||||||
|
if (!obj) continue;
|
||||||
|
obj.name = item.SegmentationName;
|
||||||
|
obj.segUrl = item.SEGUrl;
|
||||||
|
obj.isSaved = item.IsSaved;
|
||||||
|
obj.segmentationId = item.Id;
|
||||||
|
obj.segments = []
|
||||||
|
if (!this.segmentationId) {
|
||||||
|
this.segmentationId = obj.segmentationId
|
||||||
|
}
|
||||||
|
let segments = await this.getSegmentList(item.Id)
|
||||||
|
segments.forEach((s, index) => {
|
||||||
|
let SegmentJson = s.SegmentJson ? JSON.parse(s.SegmentJson) : {};
|
||||||
|
let o = {
|
||||||
|
segmentIndex: s.SegmentNumber,
|
||||||
|
segmentationId: s.SegmentationId,
|
||||||
|
SegmentLabel: s.SegmentName,
|
||||||
|
color: s.ColorRgb,
|
||||||
|
stats: SegmentJson.stats,
|
||||||
|
bidirectional: SegmentJson.bidirectional,
|
||||||
|
bidirectionalView: true,
|
||||||
|
view: true,
|
||||||
|
lock: s.IsLock,
|
||||||
|
id: s.Id
|
||||||
|
}
|
||||||
|
obj.segments.push(o)
|
||||||
|
|
||||||
|
})
|
||||||
|
this.segmentIndex = obj.segments[0].segmentIndex
|
||||||
|
}
|
||||||
|
this.isloaded = false
|
||||||
|
resolve(true)
|
||||||
|
} else {
|
||||||
|
resolve(false)
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err)
|
||||||
|
resolve(false)
|
||||||
}
|
}
|
||||||
} catch (err) {
|
})
|
||||||
console.log(err)
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
// 获取分割组
|
// 获取分割组
|
||||||
async getSegmentationList() {
|
async getSegmentationList() {
|
||||||
|
|
|
||||||
|
|
@ -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) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue