From b6b918efbfc1bafb8e73a1edd27a881a965cecc0 Mon Sep 17 00:00:00 2001 From: wangxiaoshuang <825034831@qq.com> Date: Wed, 15 Apr 2026 14:22:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E5=88=86=E5=89=B2=E5=88=86?= =?UTF-8?q?=E7=BB=84=E6=97=B6=EF=BC=8C=E5=88=86=E7=BB=84=E5=92=8C=E5=88=86?= =?UTF-8?q?=E5=89=B2=E5=88=86=E6=AE=B5=E7=9A=84=E5=90=8D=E7=A7=B0=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E8=AE=BE=E7=BD=AE=E9=BB=98=E8=AE=A4=E5=80=BC=E3=80=81?= =?UTF-8?q?=E9=83=A8=E5=88=86=E5=88=86=E5=89=B2=E9=97=AE=E9=A2=98=E8=A7=A3?= =?UTF-8?q?=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dicoms3D/components/MPRViewport.vue | 18 +- .../reading/dicoms3D/components/ReadPage.vue | 7 +- .../dicoms3D/components/SegmentForm.vue | 11 +- .../dicoms3D/components/Segmentations.vue | 162 +++++++++--------- .../dicoms3D/components/VolumeViewport.vue | 14 +- .../components/helpers/segmentations.js | 1 + .../reading-unit/components/ReadingRules.vue | 144 ++++++++++++++++ 7 files changed, 252 insertions(+), 105 deletions(-) diff --git a/src/views/trials/trials-panel/reading/dicoms3D/components/MPRViewport.vue b/src/views/trials/trials-panel/reading/dicoms3D/components/MPRViewport.vue index c80ad06b..e7577a70 100644 --- a/src/views/trials/trials-panel/reading/dicoms3D/components/MPRViewport.vue +++ b/src/views/trials/trials-panel/reading/dicoms3D/components/MPRViewport.vue @@ -40,10 +40,10 @@
Location: {{ `${Number(imageInfo.location).toFixed(digitPlaces)} mm` - }}
+ }}
Slice Thickness: {{ `${Number(imageInfo.sliceThickness).toFixed(digitPlaces)} mm` - }}
+ }}
WW/WL: {{ imageInfo.wwwc }}
@@ -195,31 +195,31 @@ export default { this.initViewport() }) DicomEvent.$on('createSegmentationRepresentation', (segmentationId) => { - if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.VisitTaskId !== this.series.VisitTaskId) return false + if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.TaskInfo.VisitTaskId !== this.series.TaskInfo.VisitTaskId) return false createSegmentationRepresentation(this.viewportId, segmentationId) }) DicomEvent.$on('viewSegmentation', (obj) => { - if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.VisitTaskId !== this.series.VisitTaskId) return false + if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.TaskInfo.VisitTaskId !== this.series.TaskInfo.VisitTaskId) return false viewSegmentation(obj, this.viewportId) }) DicomEvent.$on('viewSegment', (obj) => { - if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.VisitTaskId !== this.series.VisitTaskId) return false + if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.TaskInfo.VisitTaskId !== this.series.TaskInfo.VisitTaskId) return false viewSegment(obj, this.viewportId) }) DicomEvent.$on('jumpBidirectional', (obj) => { - if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.VisitTaskId !== this.series.VisitTaskId) return false + if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.TaskInfo.VisitTaskId !== this.series.TaskInfo.VisitTaskId) return false jumpBidirectional(obj, this.viewportId, this.volumeId) }) DicomEvent.$on('viewBidirectional', (obj) => { - if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.VisitTaskId !== this.series.VisitTaskId) return false + if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.TaskInfo.VisitTaskId !== this.series.TaskInfo.VisitTaskId) return false viewBidirectional(obj, this.viewportId) }) DicomEvent.$on('changeColor', (obj) => { - if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.VisitTaskId !== this.series.VisitTaskId) return false + if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.TaskInfo.VisitTaskId !== this.series.TaskInfo.VisitTaskId) return false changeColor(obj, this.viewportId) }) DicomEvent.$on('resetViewport', () => { - if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.VisitTaskId !== this.series.VisitTaskId) return false + if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.TaskInfo.VisitTaskId !== this.series.TaskInfo.VisitTaskId) return false resetViewport(this.viewportId) }) DicomEvent.$on('renderSegmentation', async (viewportId) => { diff --git a/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue b/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue index 1bc59f41..860762d7 100644 --- a/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue +++ b/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue @@ -366,9 +366,9 @@ @@ -2030,6 +2030,7 @@ export default { const errorMsg = { message: 'annotation Not allowed to operate' } throw errorMsg } + if (this.activeTool === 'CircularEraser') return false const i = this.tools.findIndex(i => i.toolName === annotation.metadata.toolName) if (i === -1) { if (annotation.metadata.toolName === SegmentBidirectionalTool.toolName) { diff --git a/src/views/trials/trials-panel/reading/dicoms3D/components/SegmentForm.vue b/src/views/trials/trials-panel/reading/dicoms3D/components/SegmentForm.vue index c72d319c..53de004f 100644 --- a/src/views/trials/trials-panel/reading/dicoms3D/components/SegmentForm.vue +++ b/src/views/trials/trials-panel/reading/dicoms3D/components/SegmentForm.vue @@ -113,12 +113,15 @@ export default { if (find) { this.form.studyId = this.series.StudyId this.handleChange(null, 'study') - let findSeries = find.SeriesArr.some(item => item.Id === this.form.seriesId) - if (findSeries) { - this.form.seriesId = this.series.Id - this.handleChange(null, 'series') + if (find.SeriesArr && find.SeriesArr.length > 0) { + let findSeries = find.SeriesArr.some(item => item.Id === this.form.seriesId) + if (findSeries) { + this.form.seriesId = this.series.Id + this.handleChange(null, 'series') + } } + } } diff --git a/src/views/trials/trials-panel/reading/dicoms3D/components/Segmentations.vue b/src/views/trials/trials-panel/reading/dicoms3D/components/Segmentations.vue index 97a9cf3a..31bbd75f 100644 --- a/src/views/trials/trials-panel/reading/dicoms3D/components/Segmentations.vue +++ b/src/views/trials/trials-panel/reading/dicoms3D/components/Segmentations.vue @@ -123,7 +123,7 @@ {{ $t('trials:reading:Segmentations:title:InactiveSegmentationsShow') - }} + }}
{{ index + 1 }}
@@ -323,6 +323,12 @@ export default { return {} } }, + trialCriterion: { + type: Object, + default: () => { + return {} + } + }, segId: { type: String, default: '' @@ -686,11 +692,30 @@ export default { // this.selectSegment(segment, s ? false : true) // this.readingSegmentByConfig() }, + getSegmentationName(num = 1) { + let defaultSegmentationName = this.trialCriterion.DefaultSegmentName.SegmentationName + let name = defaultSegmentationName + let has = this.segmentList.find(item => item.name === name) + if (has) { + name = defaultSegmentationName + num + has = this.segmentList.find(item => item.name === name) + num++ + if (has) name = this.getSegmentationName(num) + } + return name + }, + getSegmentName(arr, num = 1) { + let defaultSegmentName = arr[0].SegmentLabel + let name = defaultSegmentName + num + let has = arr.find(item => item.SegmentLabel === name) + num++ + if (has) name = this.getSegmentName(arr, num) + return name + }, async addSegmentGroup() { - let viewportIds = this.viewportIds // let segmentationId = this.$guid(); let obj = { - name: this.$t('trials:reading:Segmentations:name:SegmentGroup') + (this.segmentList.length + 1), + name: this.getSegmentationName(), view: true, segmentationId: null, isSaved: false, @@ -698,47 +723,14 @@ export default { } let segmentationId = await this.addOrUpdateSegmentation({ name: obj.name }) obj.segmentationId = segmentationId - let o = { - segmentIndex: 1, - segmentationId, - SegmentLabel: 'Segment 1', - color: this.colors[0], - stats: null, - bidirectional: null, - bidirectionalView: true, - view: true, - lock: false - } - let id = await this.addOrUpdateSegment({ name: o.SegmentLabel, color: o.color, segmentIndex: o.segmentIndex, segmentationId: o.segmentationId }) - o.id = id - obj.segments.push(o); - this.segmentList.push(obj); - this.segmentationId = obj.segmentationId; await this.createSegmentation(obj.segmentationId) this.createSegmentationRepresentation(obj.segmentationId) - this.segmentIndex = 1 - this.changeColor(this.colors[0], { segmentationId: obj.segmentationId, segmentIndex: 1, color: this.colors[0] }) - // viewportIds.forEach(id => { - // segmentation.config.color.setSegmentIndexColor(id, obj.segmentationId, 1, this.hex2Rgb(this.colors[0])) - // }) - this.selectSegmentGroup() - }, - async addSegment() { - let viewportIds = this.viewportIds; - if (this.segmentList.length <= 0) { - let obj = { - name: this.$t('trials:reading:Segmentations:name:SegmentGroup') + 1, - view: true, - isSaved: false, - segments: [] - } - let segmentationId = await this.addOrUpdateSegmentation({ name: obj.name }) - obj.segmentationId = segmentationId + this.trialCriterion.DefaultSegmentName.SegmentNameList.forEach(async (SegmentName, index) => { let o = { - segmentIndex: 1, + segmentIndex: index + 1, segmentationId, - SegmentLabel: 'Segment 1', - color: this.colors[0], + SegmentLabel: SegmentName, + color: this.colors[index], stats: null, bidirectional: null, bidirectionalView: true, @@ -747,14 +739,52 @@ export default { } let id = await this.addOrUpdateSegment({ name: o.SegmentLabel, color: o.color, segmentIndex: o.segmentIndex, segmentationId: o.segmentationId }) o.id = id - obj.segments.push(o); + obj.segments.splice(index, 0, o); + this.changeColor(this.colors[index], { segmentationId: obj.segmentationId, segmentIndex: index + 1, color: this.colors[index] }) + }) + this.segmentList.push(obj); + this.segmentationId = obj.segmentationId; + this.segmentIndex = 1 + // segmentation.segmentIndex.setActiveSegmentIndex(this.segmentationId, 1); + // viewportIds.forEach(id => { + // segmentation.config.color.setSegmentIndexColor(id, obj.segmentationId, 1, this.hex2Rgb(this.colors[0])) + // }) + // this.selectSegmentGroup() + }, + async addSegment() { + if (this.segmentList.length <= 0) { + let obj = { + name: this.getSegmentationName(), + view: true, + isSaved: false, + segments: [] + } + let segmentationId = await this.addOrUpdateSegmentation({ name: obj.name }) + obj.segmentationId = segmentationId + await this.createSegmentation(segmentationId) + this.createSegmentationRepresentation(segmentationId) + this.trialCriterion.DefaultSegmentName.SegmentNameList.forEach(async (SegmentName, index) => { + let o = { + segmentIndex: index + 1, + segmentationId, + SegmentLabel: SegmentName, + color: this.colors[index], + stats: null, + bidirectional: null, + bidirectionalView: true, + view: true, + lock: false + } + let id = await this.addOrUpdateSegment({ name: o.SegmentLabel, color: o.color, segmentIndex: o.segmentIndex, segmentationId: o.segmentationId }) + o.id = id + obj.segments.splice(index, 0, o); + this.changeColor(this.colors[index], { segmentationId: obj.segmentationId, segmentIndex: index + 1, color: this.colors[index] }) + }) this.segmentList.push(obj); - this.segmentationId = this.segmentList[0].segmentationId; - await this.createSegmentation(this.segmentationId) - this.createSegmentationRepresentation(this.segmentationId) + this.segmentationId = segmentationId; this.segmentIndex = 1 - segmentation.segmentIndex.setActiveSegmentIndex(this.segmentList[0].segmentationId, 1); - this.changeColor(this.colors[0], { segmentationId: this.segmentList[0].segmentationId, segmentIndex: 1, color: this.colors[0] }) + // segmentation.segmentIndex.setActiveSegmentIndex(this.segmentList[0].segmentationId, 1); + // this.changeColor(this.colors[0], { segmentationId: this.segmentList[0].segmentationId, segmentIndex: 1, color: this.colors[0] }) // viewportIds.forEach(id => { // segmentation.config.color.setSegmentIndexColor(id, this.segmentList[0].segmentationId, 1, this.hex2Rgb(this.colors[0])) // }) @@ -767,7 +797,7 @@ export default { let obj = { segmentIndex: segmentIndex, segmentationId: this.segmentationId, - SegmentLabel: `Segment ${segmentIndex}`, + SegmentLabel: this.getSegmentName(item.segments), color: item.segments.length >= this.colors.length ? this.colors[0] : this.colors[item.segments.length], stats: null, bidirectional: null, @@ -784,7 +814,7 @@ export default { obj.id = id item.segments.push(obj) this.segmentIndex = obj.segmentIndex - segmentation.segmentIndex.setActiveSegmentIndex(obj.segmentationId, obj.segmentIndex); + // segmentation.segmentIndex.setActiveSegmentIndex(obj.segmentationId, obj.segmentIndex); this.changeColor(obj.color, { segmentationId: obj.segmentationId, segmentIndex: obj.segmentIndex, color: obj.color }) // viewportIds.forEach(id => { // segmentation.config.color.setSegmentIndexColor(id, obj.segmentationId, obj.segmentIndex, this.hex2Rgb(obj.color)) @@ -1457,7 +1487,6 @@ export default { list.forEach(item => { this.createSegmentConfiguration(item.segmentIndex, item.segmentationId); }) - const renderingEngine = getRenderingEngine(this.renderingEngineId) const viewportId = `${this.viewportKey}-${this.activeViewportIndex}` const viewport = renderingEngine.getViewport(viewportId); @@ -1530,7 +1559,7 @@ export default { answer = segment.stats && segment.stats[imageToolAttribute] ? Number((segment.stats[imageToolAttribute]).value).toFixed(this.digitPlaces) : '' } let o = { - Answer: answer, + Answer: answer === '-Infinity' ? null : answer, QuestionId: item.QuestionId, RowId: item.RowId, SegmentId: item.SegmentId, @@ -1599,12 +1628,6 @@ export default { segments: [] } this.segmentList.push(obj) - // if (item.SEGUrl) { - // await this.readSegmentation(obj) - // } else { - // await this.createSegmentation(obj.segmentationId) - // // this.createSegmentationRepresentation(obj.segmentationId) - // } } if (!this.segmentationId) { this.segmentationId = obj.segmentationId @@ -1627,38 +1650,13 @@ export default { id: s.Id } obj.segments.push(o) - // this.selectSegment(o, false) - // this.changeColor(s.ColorRgb, o) - // this.lockSegment(o, true) } if (!this.segmentIndex) { this.segmentIndex = s.SegmentNumber } }) - // this.$nextTick(() => { - // if (SEGMENT) { - // // console.log(SEGMENT, 'SEGMENT') - // return this.getBidirectional(obj.segments, SEGMENT) - // } - // this.getBidirectional(obj.segments, null, false) - // }) } - // if (this.segmentationId && this.segmentIndex && this.segmentList && this.segmentList.length > 0) { - // let o = this.segmentList.find(item => item.segmentationId === this.segmentationId) - // if (o) { - // let s = o.segments.find(item => item.segmentIndex === this.segmentIndex) - // this.selectSegmentGroup(s) - // } else { - // this.segmentationId = this.segmentList[0].segmentationId - // this.segmentIndex = this.segmentationId ? this.segmentList[0].segments[0].segmentIndex : null - // if (this.segmentationId && this.segmentIndex) { - // this.selectSegmentGroup(this.segmentList[0].segments[0]) - // } - // } - // } this.isloaded = false - // this.loading = true - // this.readingSegmentByConfig() } } catch (err) { // this.loading = false diff --git a/src/views/trials/trials-panel/reading/dicoms3D/components/VolumeViewport.vue b/src/views/trials/trials-panel/reading/dicoms3D/components/VolumeViewport.vue index 14b79e27..10ffe9af 100644 --- a/src/views/trials/trials-panel/reading/dicoms3D/components/VolumeViewport.vue +++ b/src/views/trials/trials-panel/reading/dicoms3D/components/VolumeViewport.vue @@ -213,31 +213,31 @@ export default { this.initViewport() }) DicomEvent.$on('createSegmentationRepresentation', (segmentationId) => { - if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.VisitTaskId !== this.series.VisitTaskId) return false + if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.TaskInfo.VisitTaskId !== this.series.TaskInfo.VisitTaskId) return false createSegmentationRepresentation(this.viewportId, segmentationId) }) DicomEvent.$on('viewSegmentation', (obj) => { - if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.VisitTaskId !== this.series.VisitTaskId) return false + if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.TaskInfo.VisitTaskId !== this.series.TaskInfo.VisitTaskId) return false viewSegmentation(obj, this.viewportId) }) DicomEvent.$on('viewSegment', (obj) => { - if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.VisitTaskId !== this.series.VisitTaskId) return false + if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.TaskInfo.VisitTaskId !== this.series.TaskInfo.VisitTaskId) return false viewSegment(obj, this.viewportId) }) DicomEvent.$on('jumpBidirectional', (obj) => { - if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.VisitTaskId !== this.series.VisitTaskId) return false + if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.TaskInfo.VisitTaskId !== this.series.TaskInfo.VisitTaskId) return false jumpBidirectional(obj, this.viewportId, this.volumeId) }) DicomEvent.$on('viewBidirectional', (obj) => { - if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.VisitTaskId !== this.series.VisitTaskId) return false + if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.TaskInfo.VisitTaskId !== this.series.TaskInfo.VisitTaskId) return false viewBidirectional(obj, this.viewportId) }) DicomEvent.$on('changeColor', (obj) => { - if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.VisitTaskId !== this.series.VisitTaskId) return false + if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.TaskInfo.VisitTaskId !== this.series.TaskInfo.VisitTaskId) return false changeColor(obj, this.viewportId) }) DicomEvent.$on('resetViewport', () => { - if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.VisitTaskId !== this.series.VisitTaskId) return false + if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.TaskInfo.VisitTaskId !== this.series.TaskInfo.VisitTaskId) return false resetViewport(this.viewportId) }) DicomEvent.$on('renderSegmentation', async (viewportId) => { diff --git a/src/views/trials/trials-panel/reading/dicoms3D/components/helpers/segmentations.js b/src/views/trials/trials-panel/reading/dicoms3D/components/helpers/segmentations.js index 79e7540e..06146058 100644 --- a/src/views/trials/trials-panel/reading/dicoms3D/components/helpers/segmentations.js +++ b/src/views/trials/trials-panel/reading/dicoms3D/components/helpers/segmentations.js @@ -333,6 +333,7 @@ function viewBidirectional(arr, viewportId) { resetViewport(viewportId) } function resetViewport(viewportId) { + console.log('resetViewport') let renderingEngine = getRenderingEngine(renderingEngineId) const viewport = renderingEngine.getViewport(viewportId) viewport.render() diff --git a/src/views/trials/trials-panel/setting/reading-unit/components/ReadingRules.vue b/src/views/trials/trials-panel/setting/reading-unit/components/ReadingRules.vue index 2ca38593..302b224e 100644 --- a/src/views/trials/trials-panel/setting/reading-unit/components/ReadingRules.vue +++ b/src/views/trials/trials-panel/setting/reading-unit/components/ReadingRules.vue @@ -52,6 +52,22 @@ + + + + + + + + + + + + + +
+ {{ + $t('common:button:new') }} + + + + + + +
+ +