From 10487640cdaa99edac2d19977c0286f75fdf45f1 Mon Sep 17 00:00:00 2001 From: caiyiling <1321909229@qq.com> Date: Fri, 18 Apr 2025 16:01:00 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=A7=86=E5=9B=BE=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E7=BB=B4=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../reading/dicoms3D/components/ReadPage.vue | 12 +++++++----- .../reading/dicoms3D/components/Viewport.vue | 8 +++++++- 2 files changed, 14 insertions(+), 6 deletions(-) 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 2508f272..ad45a1f8 100644 --- a/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue +++ b/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue @@ -1433,11 +1433,11 @@ export default { viewport.render() } else if (type === 4) { const { rotation } = viewport.getViewPresentation() - viewport.setViewPresentation({ rotation: rotation + 90 }) + viewport.setViewPresentation({ rotation: rotation === 0 ? 270 : rotation - 90 }) viewport.render() } else if (type === 5) { const { rotation } = viewport.getViewPresentation() - viewport.setViewPresentation({ rotation: rotation - 90 }) + viewport.setViewPresentation({ rotation: rotation + 90 }) viewport.render() } this.$refs[`viewport-${this.activeViewportIndex}`][0].rotateOrientationMarkers(type) @@ -1624,10 +1624,9 @@ export default { bindHotKey() { const container = this.$refs['container'] container.addEventListener('keydown', event => { - event.preventDefault() - var idx = this.hotKeyList.findIndex(i => i.code === event.code && i.ctrlKey === event.ctrlKey && i.shiftKey === event.shiftKey && i.altKey === event.altKey) + let idx = this.hotKeyList.findIndex(i => i.code === event.code && i.ctrlKey === event.ctrlKey && i.shiftKey === event.shiftKey && i.altKey === event.altKey) if (idx === -1) return - var shortcutKeyEnum = this.hotKeyList[idx].shortcutKeyEnum + let shortcutKeyEnum = this.hotKeyList[idx].shortcutKeyEnum if (shortcutKeyEnum === 1) { // 前一图像视口 @@ -1705,6 +1704,9 @@ export default { const viewportIds = ['viewport-0', 'viewport-1', 'viewport-2', 'viewport-3'] renderingEngine.renderViewports(viewportIds) } + event.stopImmediatePropagation() + event.stopPropagation() + event.preventDefault() }) }, // 重置热键信息 diff --git a/src/views/trials/trials-panel/reading/dicoms3D/components/Viewport.vue b/src/views/trials/trials-panel/reading/dicoms3D/components/Viewport.vue index 637207a9..76268fab 100644 --- a/src/views/trials/trials-panel/reading/dicoms3D/components/Viewport.vue +++ b/src/views/trials/trials-panel/reading/dicoms3D/components/Viewport.vue @@ -110,6 +110,9 @@ import { utilities as csUtils } from '@cornerstonejs/core' import * as cornerstoneTools from '@cornerstonejs/tools' +const { + ToolGroupManager +} = cornerstoneTools import { vec3 } from 'gl-matrix' export default { name: 'ImageViewport', @@ -202,6 +205,9 @@ export default { // this.imageInfo.wwwc = `${Math.round(detail.image.windowWidth)}/${Math.round(detail.image.windowCenter)}` this.getOrientationMarker() this.$emit('renderAnnotations', this.series) + // const toolGroupId = `viewport-${this.viewportIndex}` + // const toolGroup = ToolGroupManager.getToolGroup(toolGroupId) + // toolGroup.setToolEnabled('ScaleOverlay'); }, voiModified(e) { const renderingEngine = getRenderingEngine(this.renderingEngineId) @@ -284,7 +290,7 @@ export default { const viewport = renderingEngine.getViewport(this.viewportId) if (isPlay) { - cornerstoneTools.utilities.cine.playClip(viewport.element, { framesPerSecond }) + cornerstoneTools.utilities.cine.playClip(viewport.element, { framesPerSecond, loop: false }) } else { cornerstoneTools.utilities.cine.stopClip(viewport.element) } From c657bb878304b193a59d6694b5223b5624f879f9 Mon Sep 17 00:00:00 2001 From: caiyiling <1321909229@qq.com> Date: Fri, 18 Apr 2025 16:46:27 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=A0=87=E6=B3=A8=E5=BA=8F=E5=88=97?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E7=BB=B4=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../reading/dicoms3D/components/ReadPage.vue | 30 ++++++++++++++++--- .../reading/dicoms3D/components/StudyList.vue | 12 ++++++-- 2 files changed, 35 insertions(+), 7 deletions(-) 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 ad45a1f8..54c7f7dd 100644 --- a/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue +++ b/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue @@ -25,6 +25,7 @@ v-if="selectArr.includes(s.VisitTaskId) && s.StudyList.length > 0" :ref="s.VisitTaskId" :visit-task-info="s" + :markedSeriesIds="markedSeriesIds" @activeSeries="activeSeries" /> @@ -573,7 +574,8 @@ export default { lastViewportTaskId: '', digitPlaces: 2, instanceInfo: {}, - lastViewportTaskIds: [] + lastViewportTaskIds: [], + markedSeriesIds: [] } }, computed: { @@ -711,7 +713,16 @@ export default { if (!this.selectArr.includes(item.VisitTaskId)) { this.selectArr.push(item.VisitTaskId) } + if (item.IsCurrentTask) { + this.markedSeriesIds = [] + annotations.map(i=> { + if (i.MeasureData && i.MeasureData.seriesId) { + this.markedSeriesIds.push(i.MeasureData.seriesId) + } + }) + } } + this.visitTaskList.push({ ...item, StudyList: studyList, @@ -1075,7 +1086,6 @@ export default { }) }, addAnnotationListeners() { - console.log(toolsEvents) const debouncedCallback = this.debounce((evt) => { this.annotationModifiedListener(evt) }, 100) @@ -1109,7 +1119,7 @@ export default { console.log(arr) }, annotationAddedListener(e) { - console.log('annotationAddedListener', e) + }, annotationCompletedListener(e) { console.log('Completed') @@ -1128,9 +1138,12 @@ export default { annotation.sliceThickness = series.SliceThickness annotation.numberOfFrames = isNaN(parseInt(params.frame)) ? null : parseInt(params.frame) annotation.markTool = annotation.metadata.toolName + // this.$refs['ecrf'].setAnnotation({ annotation, toolName: annotation.metadata.toolName }) this.$refs[`ecrf_${this.lastViewportTaskId}`][0].setAnnotation({ annotation, toolName: annotation.metadata.toolName }) + this.markedSeriesIds.push(series.Id) } + this.setToolsPassive() }, annotationModifiedListener(e) { @@ -1147,7 +1160,16 @@ export default { this.setToolsPassive() }, annotationRemovedListener(e) { - + if (this.readingTaskState === 2) return + const { annotation } = e.detail + if (!annotation) return + if (annotation.visitTaskId === this.taskInfo.VisitTaskId && annotation.seriesId) { + const index = this.markedSeriesIds.indexOf(annotation.seriesId) + if (index !== -1) { + this.markedSeriesIds.splice(index, 1) + } + } + console.log(this.markedSeriesIds) }, removeAnnotation(annotation) { cornerstoneTools.annotation.state.removeAnnotation(annotation.annotationUID) diff --git a/src/views/trials/trials-panel/reading/dicoms3D/components/StudyList.vue b/src/views/trials/trials-panel/reading/dicoms3D/components/StudyList.vue index 9ebbed55..94a191f9 100644 --- a/src/views/trials/trials-panel/reading/dicoms3D/components/StudyList.vue +++ b/src/views/trials/trials-panel/reading/dicoms3D/components/StudyList.vue @@ -48,7 +48,7 @@
@@ -80,8 +80,8 @@ {{ series.Modality }}: {{ series.InstanceCount }} image
-
- +
+
@@ -106,6 +106,12 @@ export default { default() { return {} } + }, + markedSeriesIds: { + type: Array, + default() { + return [] + } } }, data() { From aea6a3f8c874828ecabc2c28c8c76e0f129862ca Mon Sep 17 00:00:00 2001 From: caiyiling <1321909229@qq.com> Date: Fri, 18 Apr 2025 17:02:52 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E7=97=85=E7=81=B6=E5=AF=B9=E9=BD=90?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../reading/dicoms3D/components/ReadPage.vue | 14 +++++++++----- .../reading/dicoms3D/components/StudyList.vue | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) 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 54c7f7dd..3b16a915 100644 --- a/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue +++ b/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue @@ -2030,12 +2030,15 @@ export default { return } else if (Object.keys(firstAddSeries).length !== 0 && Object.keys(currentAddSeries).length === 0) { // 当前访视序列与首次出现病灶的序列对齐 - currentAddSeries = this.getRelatedSeries(this.visitTaskList[index], firstAddSeries) + // currentAddSeries = this.getRelatedSeries(this.visitTaskList[index], firstAddSeries) - if (Object.keys(currentAddSeries).length === 0) { - // 未找到对齐的,则就显示当前最后一个窗口现实的序列信息 - currentAddSeries = this.$refs[`viewport-${this.cells.length - 1}`][0].series - } + // if (Object.keys(currentAddSeries).length === 0) { + // // 未找到对齐的,则就显示当前最后一个窗口现实的序列信息 + // currentAddSeries = this.$refs[`viewport-${this.cells.length - 1}`][0].series + // } + + // 显示当前序列 + currentAddSeries = this.$refs[`viewport-${this.cells.length - 1}`][0].series } } else { // 无序 @@ -2050,6 +2053,7 @@ export default { if (i === this.cells.length - 1) { this.$refs[`viewport-${i}`][0].setSeriesInfo(currentAddSeries, true) this.activeViewportIndex = i + this.$refs[currentAddSeries.TaskInfo.VisitTaskId][0].setSeriesActive(currentAddSeries.StudyIndex, currentAddSeries.SeriesIndex) } else { this.$refs[`viewport-${i}`][0].setSeriesInfo(firstAddSeries, true) } diff --git a/src/views/trials/trials-panel/reading/dicoms3D/components/StudyList.vue b/src/views/trials/trials-panel/reading/dicoms3D/components/StudyList.vue index 94a191f9..58a30484 100644 --- a/src/views/trials/trials-panel/reading/dicoms3D/components/StudyList.vue +++ b/src/views/trials/trials-panel/reading/dicoms3D/components/StudyList.vue @@ -80,7 +80,7 @@ {{ series.Modality }}: {{ series.InstanceCount }} image -
+