分割部分问题解决
parent
afc35daffa
commit
c12da4de3e
|
|
@ -120,6 +120,10 @@ export default {
|
|||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
isMPR: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
actionConfiguration: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
|
|
@ -251,6 +255,7 @@ export default {
|
|||
},
|
||||
SegmentConfig: {
|
||||
handler() {
|
||||
if (!this.isMPR) return false
|
||||
if (!this.segmentationId) return false
|
||||
if (!this.series.TaskInfo) return false
|
||||
readingSegmentByConfig(this.series, this.series.TaskInfo, this.viewportId, this.segmentationId, this.SegmentConfig)
|
||||
|
|
@ -258,11 +263,13 @@ export default {
|
|||
deep: true
|
||||
},
|
||||
segmentIndex() {
|
||||
if (!this.isMPR) return false
|
||||
if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.VisitTaskId !== this.series.VisitTaskId) return false
|
||||
if (this.segmentIndex <= 0) return false
|
||||
selectSegment(this.viewportId, this.segmentationId, this.segmentIndex)
|
||||
},
|
||||
segmentationId() {
|
||||
if (!this.isMPR) return false
|
||||
if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.VisitTaskId !== this.series.VisitTaskId) return false
|
||||
if (!this.segmentationId) return false
|
||||
selectSegmentation(this.viewportId, this.segmentationId)
|
||||
|
|
@ -665,8 +672,11 @@ export default {
|
|||
renderingEngine.render()
|
||||
}, 100)
|
||||
}
|
||||
await renderSegmentation(this.series, this.series.TaskInfo, this.viewportId, this.SegmentConfig, this.renderingEngineId, null, this.actionConfiguration, this.segmentationId, this.segmentIndex)
|
||||
DicomEvent.$emit('SegmentationLoading', this.viewportId)
|
||||
if (this.isMPR) {
|
||||
await renderSegmentation(this.series, this.series.TaskInfo, this.viewportId, this.SegmentConfig, this.renderingEngineId, null, this.actionConfiguration, this.segmentationId, this.segmentIndex)
|
||||
DicomEvent.$emit('SegmentationLoading', this.viewportId)
|
||||
}
|
||||
|
||||
let volume = cache.getVolume(this.volumeId)
|
||||
// console.log(volume, 'volume')
|
||||
if (this.series.orientation === 'AXIAL' && this.series.curIndex) return this.setFullScreen(this.series.curIndex)
|
||||
|
|
|
|||
|
|
@ -344,7 +344,7 @@
|
|||
:viewport-index="index" :histogramVisible="histogramVisible"
|
||||
:actionConfiguration="actionConfiguration" :SegmentConfig="SegmentConfig"
|
||||
:segmentationId.sync="segId" :segmentIndex.sync="segIndex" :curSegSeries.sync="curSegSeries"
|
||||
:MPRInfo="MPRInfo" @activeViewport="activeViewport" @setMPRInfo="setMPRInfo"
|
||||
:isMPR="isMPR" :MPRInfo="MPRInfo" @activeViewport="activeViewport" @setMPRInfo="setMPRInfo"
|
||||
@toggleTaskByViewport="toggleTaskByViewport" @previewCD="previewCD"
|
||||
@renderAnnotations="renderAnnotations" @contentMouseup="contentMouseup"
|
||||
@resetHistogram="resetHistogram" v-resize="(e) => handleSizeChange(e, `viewport-MPR-${index}`)" />
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@
|
|||
</el-switch>
|
||||
<span style="margin-left: 5px;">{{
|
||||
$t('trials:reading:Segmentations:title:InactiveSegmentationsShow')
|
||||
}}</span>
|
||||
}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<template v-if="segmentList.length > 0">
|
||||
|
|
@ -163,7 +163,8 @@
|
|||
<i class="el-icon-warning-outline" style="color:red;margin-right: 5px;"
|
||||
:title="$t('trials:reading:Segmentations:tip:segmentationIsNotSave')"
|
||||
v-if="!curSegmentGroup.isSaved"></i>
|
||||
<el-button type="success" size="small" :disabled="saveLoading || isMPR"
|
||||
<el-button type="success" size="small"
|
||||
:disabled="saveLoading || isMPR || curSegmentGroup.isSaved"
|
||||
@click="saveSegmentGroup([curSegmentGroup])">
|
||||
{{ $t("trials:reading:Segmentations:button:save") }}
|
||||
</el-button>
|
||||
|
|
@ -253,7 +254,8 @@
|
|||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
<div class="saveBtnBox" v-if="readingTaskState < 2 && segmentList && segmentList.length > 1">
|
||||
<el-button type="success" size="small" :disabled="saveLoading || isMPR" @click="saveSegmentGroup()">
|
||||
<el-button type="success" size="small" :disabled="saveLoading || isMPR || curSegmentGroup.isSaved"
|
||||
@click="saveSegmentGroup()">
|
||||
{{ $t("trials:reading:Segmentations:button:saveAll") }}
|
||||
</el-button>
|
||||
</div>
|
||||
|
|
@ -1537,7 +1539,7 @@ export default {
|
|||
segmentGroup.segUrl = this.$getObjectName(result.url)
|
||||
DicomEvent.$emit("IsBeSegment", { StudyId: this.series.StudyId, Id: this.series.Id, IsBeSegment: true })
|
||||
} else {
|
||||
segmentGroup.segUrl = null
|
||||
return this.$confirm(this.$t("segment:saveSegmention:notSEG"))
|
||||
}
|
||||
|
||||
this.addOrUpdateSegmentation({ name: segmentGroup.name, id: segmentGroup.segmentationId, url: segmentGroup.segUrl })
|
||||
|
|
|
|||
|
|
@ -112,6 +112,7 @@ async function loadSegmentation(arrayBuffer, series, segmentationId) {
|
|||
})
|
||||
const megmentGroup =
|
||||
segmentation.state.getSegmentation(segmentationId);
|
||||
if (!megmentGroup) return false
|
||||
const { imageIds } = megmentGroup.representationData.Labelmap;
|
||||
const derivedSegmentationImages = imageIds.map(imageId =>
|
||||
cache.getImage(imageId)
|
||||
|
|
@ -226,10 +227,11 @@ async function readingSegmentByConfig(series, visitInfo, viewportId, segmentatio
|
|||
)
|
||||
}
|
||||
function selectSegmentation(viewportId, segmentationId) {
|
||||
if (!segmentation.state.getSegmentation(segmentationId)) return false
|
||||
segmentation.activeSegmentation.setActiveSegmentation(viewportId, segmentationId)
|
||||
}
|
||||
function selectSegment(viewportId, segmentationId, segmentIndex) {
|
||||
if (!segmentIndex || !segmentationId) return false
|
||||
if (!segmentIndex || !segmentationId || !segmentation.state.getSegmentation(segmentationId)) return false
|
||||
selectSegmentation(viewportId, segmentationId)
|
||||
segmentation.segmentIndex.setActiveSegmentIndex(segmentationId, segmentIndex);
|
||||
}
|
||||
|
|
@ -354,63 +356,66 @@ async function renderSegmentation(series, visitInfo, viewportId, SegmentConfig,
|
|||
PageSize: 9999,
|
||||
PageIndex: 1,
|
||||
}
|
||||
let res = await getSegmentationList(data);
|
||||
if (res.IsSuccess) {
|
||||
let list = res.Result.CurrentPageData;
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
let item = list[i]
|
||||
if (!segmentationId) segmentationId = item.Id
|
||||
await createSegmentation(viewportId, series.SeriesInstanceUid, item.Id)
|
||||
if (item.SEGUrl) await readSegmentation(item.SEGUrl, series, item.Id)
|
||||
createSegmentationRepresentation(viewportId, item.Id)
|
||||
if (!viewportInfo[viewportId]) {
|
||||
viewportInfo[viewportId] = [item.Id]
|
||||
} else {
|
||||
viewportInfo[viewportId].push(item.Id)
|
||||
}
|
||||
let params = {
|
||||
SegmentationId: item.Id,
|
||||
PageSize: 9999,
|
||||
PageIndex: 1,
|
||||
}
|
||||
let r = await getSegmentList(params)
|
||||
if (r.IsSuccess) {
|
||||
let segments = r.Result.CurrentPageData
|
||||
segments.forEach(s => {
|
||||
if (!segmentIndex) segmentIndex = s.SegmentNumber
|
||||
let SegmentJson = s.SegmentJson ? JSON.parse(s.SegmentJson) : {};
|
||||
segmentation.segmentIndex.setActiveSegmentIndex(s.SegmentationId, s.SegmentNumber);
|
||||
segmentation.config.color.setSegmentIndexColor(viewportId, s.SegmentationId, s.SegmentNumber, hex2Rgb(s.ColorRgb))
|
||||
segmentation.segmentLocking.setSegmentIndexLocked(s.SegmentationId, s.SegmentNumber, s.IsLock)
|
||||
if (SegmentJson.bidirectional) {
|
||||
let an = annotation.state.getAllAnnotations().find(i => i.metadata.segmentationId === s.SegmentationId && i.metadata.segmentIndex === SegmentJson.bidirectional.segmentIndex && i.metadata.toolName === "SegmentBidirectional");
|
||||
if (!an) {
|
||||
let { majorAxis, minorAxis } = SegmentJson.bidirectional
|
||||
// createSegmentConfiguration(s.SegmentNumber, s.SegmentationId, viewportId, actionConfiguration)
|
||||
SegmentBidirectionalTool.hydrate(viewportId, [majorAxis, minorAxis], {
|
||||
segmentIndex: s.SegmentNumber,
|
||||
segmentationId: s.SegmentationId,
|
||||
})
|
||||
setTimeout(async () => {
|
||||
let res = await getSegmentationList(data);
|
||||
if (res.IsSuccess) {
|
||||
let list = res.Result.CurrentPageData;
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
let item = list[i]
|
||||
if (!segmentationId) segmentationId = item.Id
|
||||
await createSegmentation(viewportId, series.SeriesInstanceUid, item.Id)
|
||||
if (item.SEGUrl) await readSegmentation(item.SEGUrl, series, item.Id)
|
||||
createSegmentationRepresentation(viewportId, item.Id)
|
||||
if (!viewportInfo[viewportId]) {
|
||||
viewportInfo[viewportId] = [item.Id]
|
||||
} else {
|
||||
viewportInfo[viewportId].push(item.Id)
|
||||
}
|
||||
let params = {
|
||||
SegmentationId: item.Id,
|
||||
PageSize: 9999,
|
||||
PageIndex: 1,
|
||||
}
|
||||
let r = await getSegmentList(params)
|
||||
if (r.IsSuccess) {
|
||||
let segments = r.Result.CurrentPageData
|
||||
segments.forEach(s => {
|
||||
if (!segmentIndex) segmentIndex = s.SegmentNumber
|
||||
let SegmentJson = s.SegmentJson ? JSON.parse(s.SegmentJson) : {};
|
||||
segmentation.segmentIndex.setActiveSegmentIndex(s.SegmentationId, s.SegmentNumber);
|
||||
segmentation.config.color.setSegmentIndexColor(viewportId, s.SegmentationId, s.SegmentNumber, hex2Rgb(s.ColorRgb))
|
||||
segmentation.segmentLocking.setSegmentIndexLocked(s.SegmentationId, s.SegmentNumber, s.IsLock)
|
||||
if (SegmentJson.bidirectional) {
|
||||
let an = annotation.state.getAllAnnotations().find(i => i.metadata.segmentationId === s.SegmentationId && i.metadata.segmentIndex === SegmentJson.bidirectional.segmentIndex && i.metadata.toolName === "SegmentBidirectional");
|
||||
if (!an) {
|
||||
let { majorAxis, minorAxis } = SegmentJson.bidirectional
|
||||
// createSegmentConfiguration(s.SegmentNumber, s.SegmentationId, viewportId, actionConfiguration)
|
||||
SegmentBidirectionalTool.hydrate(viewportId, [majorAxis, minorAxis], {
|
||||
segmentIndex: s.SegmentNumber,
|
||||
segmentationId: s.SegmentationId,
|
||||
})
|
||||
}
|
||||
an = annotation.state.getAllAnnotations().find(i => i.metadata.segmentationId === s.SegmentationId && i.metadata.segmentIndex === SegmentJson.bidirectional.segmentIndex && i.metadata.toolName === "SegmentBidirectional");
|
||||
if (an) {
|
||||
annotation.locking.setAnnotationLocked(an.annotationUID, true)
|
||||
annotation.visibility.setAnnotationVisibility(an.annotationUID, true)
|
||||
}
|
||||
}
|
||||
an = annotation.state.getAllAnnotations().find(i => i.metadata.segmentationId === s.SegmentationId && i.metadata.segmentIndex === SegmentJson.bidirectional.segmentIndex && i.metadata.toolName === "SegmentBidirectional");
|
||||
if (an) {
|
||||
annotation.locking.setAnnotationLocked(an.annotationUID, true)
|
||||
annotation.visibility.setAnnotationVisibility(an.annotationUID, true)
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
if (segmentationId && segmentIndex) {
|
||||
selectSegment(viewportId, segmentationId, segmentIndex)
|
||||
}
|
||||
})
|
||||
}
|
||||
if (segmentationId && segmentIndex) {
|
||||
selectSegment(viewportId, segmentationId, segmentIndex)
|
||||
}
|
||||
|
||||
if (Segment) {
|
||||
jumpBidirectional(Segment, viewportId, series.SeriesInstanceUid)
|
||||
if (Segment) {
|
||||
jumpBidirectional(Segment, viewportId, series.SeriesInstanceUid)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
readingSegmentByConfig(series, visitInfo, viewportId, segmentationId, SegmentConfig)
|
||||
readingSegmentByConfig(series, visitInfo, viewportId, segmentationId, SegmentConfig)
|
||||
}, 500)
|
||||
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue