From a7a034014d715b9bbd91f39caf959e9a688ec6bb Mon Sep 17 00:00:00 2001 From: caiyiling <1321909229@qq.com> Date: Tue, 30 Jul 2024 09:09:20 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=85=E7=89=87=E9=A2=84=E8=A7=88=E8=BF=9B?= =?UTF-8?q?=E5=BA=A6=E6=9D=A1=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Dicom/DicomCanvas.vue | 370 +++++++++--------- src/store/modules/reading.js | 51 ++- .../reading/dicoms/components/ReadPage.vue | 2 +- .../reading/dicoms/components/ReportPage.vue | 1 - .../reading/dicoms/components/StudyList.vue | 75 ++-- .../dicoms/customize/CustomizeReadPage.vue | 2 +- .../dicoms/customize/CustomizeStudyList.vue | 118 ++++-- 7 files changed, 363 insertions(+), 256 deletions(-) diff --git a/src/components/Dicom/DicomCanvas.vue b/src/components/Dicom/DicomCanvas.vue index 752aea7f..3f693524 100644 --- a/src/components/Dicom/DicomCanvas.vue +++ b/src/components/Dicom/DicomCanvas.vue @@ -872,192 +872,192 @@ export default { this.setAllToolsPassive() }, onContextmenu(event) { - const colormapsList = cornerstone.colors.getColormapsList() - const colorItems = [] - colorItems.push({ - label: '默认值', - onClick: () => { - this.setColormap() - } - }) - colormapsList.forEach(colormap => { - const item = {} - item.label = colormap.name - item.onClick = () => { - this.setColormap(colormap.id) - } - colorItems.push(item) - }) - this.$contextmenu({ - items: [ - { - label: '移动', - divided: true, - onClick: () => { - this.setToolActive('Pan') - } - }, - { - label: '缩放', - divided: true, - children: [ - { - label: '自由缩放', - onClick: () => { - this.setToolActive('Zoom') - } - }, - { - label: '适应图像', - onClick: () => { - this.fitToWindow() - } - }, - { - label: '适应窗口', - onClick: () => { - this.fitToImage() - } - } - ] - }, - { - label: '透镜', - divided: true, - onClick: () => { - this.setToolActive('Magnify') - } - }, - { - label: '旋转', - divided: true, - children: [ - { - label: '默认值', - onClick: () => { - this.resetRotate() - } - }, - { - label: '自由旋转', - onClick: () => { - this.setToolActive('Rotate') - } - }, - { - label: '水平翻转', - onClick: () => { - this.setRotate(true, false, 0) - } - }, - { - label: '垂直翻转', - onClick: () => { - this.setRotate(false, true, 0) - } - }, - { - label: '左转90度', - onClick: () => { - this.setRotate(false, false, -90) - } - }, - { - label: '右转90度', - onClick: () => { - this.setRotate(false, false, 90) - } - } - ] - }, + // const colormapsList = cornerstone.colors.getColormapsList() + // const colorItems = [] + // colorItems.push({ + // label: '默认值', + // onClick: () => { + // this.setColormap() + // } + // }) + // colormapsList.forEach(colormap => { + // const item = {} + // item.label = colormap.name + // item.onClick = () => { + // this.setColormap(colormap.id) + // } + // colorItems.push(item) + // }) + // this.$contextmenu({ + // items: [ + // { + // label: '移动', + // divided: true, + // onClick: () => { + // this.setToolActive('Pan') + // } + // }, + // { + // label: '缩放', + // divided: true, + // children: [ + // { + // label: '自由缩放', + // onClick: () => { + // this.setToolActive('Zoom') + // } + // }, + // { + // label: '适应图像', + // onClick: () => { + // this.fitToWindow() + // } + // }, + // { + // label: '适应窗口', + // onClick: () => { + // this.fitToImage() + // } + // } + // ] + // }, + // { + // label: '透镜', + // divided: true, + // onClick: () => { + // this.setToolActive('Magnify') + // } + // }, + // { + // label: '旋转', + // divided: true, + // children: [ + // { + // label: '默认值', + // onClick: () => { + // this.resetRotate() + // } + // }, + // { + // label: '自由旋转', + // onClick: () => { + // this.setToolActive('Rotate') + // } + // }, + // { + // label: '水平翻转', + // onClick: () => { + // this.setRotate(true, false, 0) + // } + // }, + // { + // label: '垂直翻转', + // onClick: () => { + // this.setRotate(false, true, 0) + // } + // }, + // { + // label: '左转90度', + // onClick: () => { + // this.setRotate(false, false, -90) + // } + // }, + // { + // label: '右转90度', + // onClick: () => { + // this.setRotate(false, false, 90) + // } + // } + // ] + // }, - { - label: '测量', - divided: true, - minWidth: 0, - children: [ - { - label: '探针', - onClick: () => { - this.setToolActive('Probe') - } - }, - { - label: '长度测量', - onClick: () => { - this.setToolActive('Length') - } - }, - { - label: '角度测量', - onClick: () => { - this.setToolActive('Angle') - } - }, - { - label: 'Cobb测量', - onClick: () => { - this.setToolActive('CobbAngle') - } - }, - { - label: '椭圆测量', - onClick: () => { - this.setToolActive('EllipticalRoi') - } - }, - { - label: '矩形测量', - onClick: () => { - this.setToolActive('RectangleRoi') - } - }, - { - label: '多边形标记', - onClick: () => { - this.setToolActive('FreehandRoi') - } - }, - { - label: '十字线', - onClick: () => { - this.setToolActive('Bidirectional') - } - }, - { - label: '文字标注', - onClick: () => { - this.setToolActive('ArrowAnnotate') - } - } - ] - }, - { - label: '调窗', - divided: true, - onClick: () => { - this.setToolActive('Wwwc') - } - }, - { - label: '反色', - divided: true, - onClick: () => { - this.toggleInvert() - } - }, - { - label: '伪彩', - children: colorItems - } - ], - event, - // x: event.clientX, - // y: event.clientY, - customClass: 'class-a', - zIndex: 3, - minWidth: 100 - }) + // { + // label: '测量', + // divided: true, + // minWidth: 0, + // children: [ + // { + // label: '探针', + // onClick: () => { + // this.setToolActive('Probe') + // } + // }, + // { + // label: '长度测量', + // onClick: () => { + // this.setToolActive('Length') + // } + // }, + // { + // label: '角度测量', + // onClick: () => { + // this.setToolActive('Angle') + // } + // }, + // { + // label: 'Cobb测量', + // onClick: () => { + // this.setToolActive('CobbAngle') + // } + // }, + // { + // label: '椭圆测量', + // onClick: () => { + // this.setToolActive('EllipticalRoi') + // } + // }, + // { + // label: '矩形测量', + // onClick: () => { + // this.setToolActive('RectangleRoi') + // } + // }, + // { + // label: '多边形标记', + // onClick: () => { + // this.setToolActive('FreehandRoi') + // } + // }, + // { + // label: '十字线', + // onClick: () => { + // this.setToolActive('Bidirectional') + // } + // }, + // { + // label: '文字标注', + // onClick: () => { + // this.setToolActive('ArrowAnnotate') + // } + // } + // ] + // }, + // { + // label: '调窗', + // divided: true, + // onClick: () => { + // this.setToolActive('Wwwc') + // } + // }, + // { + // label: '反色', + // divided: true, + // onClick: () => { + // this.toggleInvert() + // } + // }, + // { + // label: '伪彩', + // children: colorItems + // } + // ], + // event, + // // x: event.clientX, + // // y: event.clientY, + // customClass: 'class-a', + // zIndex: 3, + // minWidth: 100 + // }) return false }, getToolSate() { diff --git a/src/store/modules/reading.js b/src/store/modules/reading.js index 6ca73932..086d77d0 100644 --- a/src/store/modules/reading.js +++ b/src/store/modules/reading.js @@ -139,6 +139,22 @@ function getQuestionAnswer(questions, questionMark, answers) { return '' } } +function getKeySeriesInfo(keyInstance, series) { + const obj = {} + const set = new Set() + var instances = series.instanceList.concat(keyInstance).filter((item) => { + if (set.has(item)) { + return true + } else { + set.add(item) + return false + } + }) + instances.map(item => { + obj[item] = { seriesId: series.seriesId, studyIndex: series.studyIndex, seriesIndex: series.seriesIndex } + }) + return obj +} const state = getDefaultState @@ -896,10 +912,39 @@ const actions = { }) }, setImageloadedInfo({ state }, obj) { + console.log('setImageloadedInfo', obj) var index = state.visitTaskList.findIndex(i => i.VisitTaskId === obj.visitTaskId) - const prefetchInstanceCount = state.visitTaskList[index].StudyList[obj.studyIndex].SeriesList[obj.seriesIndex].prefetchInstanceCount - state.visitTaskList[index].StudyList[obj.studyIndex].SeriesList[obj.seriesIndex].prefetchInstanceCount = prefetchInstanceCount + 100 - state.visitTaskList[index].StudyList[obj.studyIndex].SeriesList[obj.seriesIndex].imageloadedArr.push(obj.imageId) + // const prefetchInstanceCount = state.visitTaskList[index].StudyList[obj.studyIndex].SeriesList[obj.seriesIndex].prefetchInstanceCount + const instanceList = state.visitTaskList[index].StudyList[obj.studyIndex].SeriesList[obj.seriesIndex].instanceList + const idx = state.visitTaskList[index].StudyList.findIndex(i => i.IsCriticalSequence) + + if (!state.visitTaskList[index].StudyList[obj.studyIndex].IsCriticalSequence) { + // 当前下载的非关键序列 + console.log('当前下载的非关键序列') + if (idx > -1) { + const keyInstance = state.visitTaskList[index].StudyList[idx].SeriesList[0].instanceList + obj.markedImages = getKeySeriesInfo(keyInstance, state.visitTaskList[index].StudyList[obj.studyIndex].SeriesList[obj.seriesIndex]) + instanceList.map(i => { + if (obj.markedImages.hasOwnProperty(i) && state.visitTaskList[index].StudyList[idx].SeriesList[0].imageloadedArr.indexOf(i) < 0) { + state.visitTaskList[index].StudyList[idx].SeriesList[0].imageloadedArr.push(i) + state.visitTaskList[index].StudyList[idx].SeriesList[0].prefetchInstanceCount = state.visitTaskList[index].StudyList[idx].SeriesList[0].prefetchInstanceCount + 100 + } + }) + if (state.visitTaskList[index].StudyList[idx].SeriesList[0].imageloadedArr >= state.visitTaskList[index].StudyList[idx].SeriesList[0].instanceCount) { + state.visitTaskList[index].StudyList[idx].SeriesList[0].loadStatus = true + } + } + } + state.visitTaskList[index].StudyList[obj.studyIndex].SeriesList[obj.seriesIndex].prefetchInstanceCount = state.visitTaskList[index].StudyList[obj.studyIndex].SeriesList[obj.seriesIndex].instanceCount * 100 + state.visitTaskList[index].StudyList[obj.studyIndex].SeriesList[obj.seriesIndex].imageloadedArr = instanceList + state.visitTaskList[index].StudyList[obj.studyIndex].SeriesList[obj.seriesIndex].loadStatus = true + // const imageloadedArr = state.visitTaskList[index].StudyList[obj.studyIndex].SeriesList[obj.seriesIndex].imageloadedArr + // if (imageloadedArr.indexOf()) + + // if (state.visitTaskList[index].StudyList[0].IsCriticalSequence){ + // state.visitTaskList[index].StudyList[0].SeriesList[0].prefetchInstanceCount = prefetchInstanceCount + 100 + // state.visitTaskList[index].StudyList[obj.studyIndex].SeriesList[obj.seriesIndex].imageloadedArr.push(obj.imageId) + // } }, setStatus({ state }, obj) { var index = state.visitTaskList.findIndex(i => i.VisitTaskId === obj.visitTaskId) diff --git a/src/views/trials/trials-panel/reading/dicoms/components/ReadPage.vue b/src/views/trials/trials-panel/reading/dicoms/components/ReadPage.vue index 9f61e1fb..feec99a0 100644 --- a/src/views/trials/trials-panel/reading/dicoms/components/ReadPage.vue +++ b/src/views/trials/trials-panel/reading/dicoms/components/ReadPage.vue @@ -400,7 +400,7 @@ export default { idx > -1 ? obj = seriesList[idx] : '' } if (obj) { - const index = Math.floor(obj.imageIds.length * ((baseSeries.imageIdIndex + 1) / baseSeries.instanceCount)) + const index = Math.floor(obj.imageIds.length * ((baseSeries.imageIdIndex + 1) / baseSeries.imageIds)) obj.imageIdIndex = index > 0 ? index - 1 : 0 } return obj diff --git a/src/views/trials/trials-panel/reading/dicoms/components/ReportPage.vue b/src/views/trials/trials-panel/reading/dicoms/components/ReportPage.vue index 456c99d7..78d24774 100644 --- a/src/views/trials/trials-panel/reading/dicoms/components/ReportPage.vue +++ b/src/views/trials/trials-panel/reading/dicoms/components/ReportPage.vue @@ -104,7 +104,6 @@