From ca579f8731aeeaf0e273386d6e12a9c9ce86ff85 Mon Sep 17 00:00:00 2001
From: caiyiling <1321909229@qq.com>
Date: Mon, 28 Apr 2025 10:19:37 +0800
Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E9=98=85=E7=89=87?=
=?UTF-8?q?=E6=9B=B4=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../trials-panel/reading/dicoms/index.vue | 2 +-
.../reading/dicoms3D/components/ReadPage.vue | 113 +++++++++++++++++-
.../dicoms3D/components/VisitReview.vue | 22 ++--
.../reading/dicoms3D/components/toolConfig.js | 2 +-
.../reading-unit/components/ReadingRules.vue | 2 +-
5 files changed, 125 insertions(+), 16 deletions(-)
diff --git a/src/views/trials/trials-panel/reading/dicoms/index.vue b/src/views/trials/trials-panel/reading/dicoms/index.vue
index 2694034a..a5076f13 100644
--- a/src/views/trials/trials-panel/reading/dicoms/index.vue
+++ b/src/views/trials/trials-panel/reading/dicoms/index.vue
@@ -2,7 +2,7 @@
@@ -481,7 +508,7 @@ import {
import * as cornerstoneTools from '@cornerstonejs/tools'
import initLibraries from '@/views/trials/trials-panel/reading/dicoms/components/Fusion/js/initLibraries'
import html2canvas from 'html2canvas'
-import { getTools, getCustomizeStandardsTools } from './toolConfig'
+import { getTools, getCustomizeStandardsTools, config } from './toolConfig'
import StudyList from './StudyList'
import Viewport from './Viewport'
import mRecisit from './mRecist/QuestionList'
@@ -511,6 +538,7 @@ const {
ArrowAnnotateTool,
RectangleROITool,
PlanarFreehandROITool,
+ CircleROITool,
EraserTool
// cursors
} = cornerstoneTools
@@ -616,7 +644,8 @@ export default {
digitPlaces: 2,
instanceInfo: {},
lastViewportTaskIds: [],
- markedSeriesIds: []
+ markedSeriesIds: [],
+ customizeStandards: []
}
},
computed: {
@@ -696,6 +725,7 @@ export default {
this.digitPlaces = digitPlaces === -1 ? this.digitPlaces : digitPlaces
if (this.criterionType === 0) {
this.tools = getCustomizeStandardsTools(this.taskInfo.ReadingToolList)
+ this.customizeStandards = [...config.customizeStandards]
} else {
this.tools = getTools(this.criterionType)
}
@@ -781,7 +811,7 @@ export default {
},
// 加载检查及标注信息
async loadTaskDetails(taskInfo, taskIndex) {
- return new Promise(async (resolve, reject)=>{
+ return new Promise(async(resolve, reject) => {
try {
const sujectVisitId = taskInfo.VisitId
const taskId = taskInfo.VisitTaskId
@@ -872,7 +902,6 @@ export default {
reject(e)
}
})
-
},
// 设置初始化序列信息
setInitSeries() {
@@ -979,6 +1008,7 @@ export default {
cornerstoneTools.addTool(LengthTool)
cornerstoneTools.addTool(BidirectionalTool)
cornerstoneTools.addTool(ScaleOverlayTool)
+ cornerstoneTools.addTool(CircleROITool)
viewportIds.forEach((viewportId, i) => {
const toolGroupId = `viewport-${i}`
@@ -1020,6 +1050,9 @@ export default {
// cachedStats: true
getTextLines: this.getBidirectionalToolTextLines
})
+ toolGroup.addTool(CircleROITool.toolName, {
+ getTextLines: this.getCircleROIToolTextLines
+ })
toolGroup.setToolActive(StackScrollTool.toolName, {
bindings: [{ mouseButton: MouseBindings.Wheel }]
@@ -1037,12 +1070,14 @@ export default {
toolGroup.setToolPassive(PlanarFreehandROITool.toolName)
toolGroup.setToolPassive(LengthTool.toolName)
toolGroup.setToolPassive(BidirectionalTool.toolName)
+ toolGroup.setToolPassive(CircleROITool.toolName)
} else {
toolGroup.setToolEnabled(ArrowAnnotateTool.toolName)
toolGroup.setToolEnabled(RectangleROITool.toolName)
toolGroup.setToolEnabled(PlanarFreehandROITool.toolName)
toolGroup.setToolEnabled(LengthTool.toolName)
toolGroup.setToolEnabled(BidirectionalTool.toolName)
+ toolGroup.setToolEnabled(CircleROITool.toolName)
}
toolGroup.setToolPassive(EraserTool.toolName)
})
@@ -1216,6 +1251,11 @@ export default {
if (this.readingTaskState === 2) return
const { annotation } = e.detail
if (!annotation) return
+ const i = this.tools.findIndex(i => i.toolName === annotation.metadata.toolName)
+ if (i === -1) {
+ this.setToolsPassive()
+ return
+ }
if (annotation.metadata.toolName === 'PlanarFreehandROI' && !annotation.data.contour.closed) return
const series = this.$refs[`viewport-${this.activeViewportIndex}`][0].series
if (series && series.TaskInfo.VisitTaskId && series.TaskInfo.VisitTaskId === this.taskInfo.VisitTaskId) {
@@ -1271,6 +1311,11 @@ export default {
const { annotation } = e.detail
if (!annotation.highlighted) return
if (!annotation) return
+ const i = this.tools.findIndex(i => i.toolName === annotation.metadata.toolName)
+ if (i === -1) {
+ this.setToolsPassive()
+ return
+ }
if (!annotation.data.label) return
if (annotation.metadata.toolName === 'PlanarFreehandROI' && !annotation.data.contour.closed) return
const series = this.$refs[`viewport-${this.activeViewportIndex}`][0].series
@@ -1515,6 +1560,52 @@ export default {
return textLines
},
+ getCircleROIToolTextLines(data, targetId) {
+ const cachedVolumeStats = data.cachedStats[targetId]
+ const {
+ radius,
+ radiusUnit,
+ area,
+ mean,
+ stdDev,
+ max,
+ isEmptyArea,
+ areaUnit,
+ modalityUnit
+ } = cachedVolumeStats
+ const textLines = []
+ if (data.label) {
+ textLines.push(data.label)
+ }
+
+ if (radius) {
+ const radiusLine = isEmptyArea
+ ? `Radius: Oblique not supported`
+ : `Radius: ${csUtils.roundNumber(radius)} ${radiusUnit}`
+ textLines.push(radiusLine)
+ }
+
+ if (area) {
+ const areaLine = isEmptyArea
+ ? `Area: Oblique not supported`
+ : `Area: ${csUtils.roundNumber(area)} ${areaUnit}`
+ textLines.push(areaLine)
+ }
+
+ if (mean) {
+ textLines.push(`Mean: ${csUtils.roundNumber(mean)} ${modalityUnit}`)
+ }
+
+ if (max) {
+ textLines.push(`Max: ${csUtils.roundNumber(max)} ${modalityUnit}`)
+ }
+
+ if (stdDev) {
+ textLines.push(`Std Dev: ${csUtils.roundNumber(stdDev)} ${modalityUnit}`)
+ }
+
+ return textLines
+ },
// 激活工具
setToolActive(toolName) {
const toolGroupId = `viewport-${this.activeViewportIndex}`
@@ -1555,7 +1646,18 @@ export default {
}
}
},
-
+ setMoreToolActive(toolName) {
+ if (this.readingTaskState === 2) return
+ const series = this.$refs[`viewport-${this.activeViewportIndex}`][0].series
+ if (series && series.TaskInfo.VisitTaskId && series.TaskInfo.VisitTaskId === this.taskInfo.VisitTaskId) {
+ const toolGroupId = `viewport-${this.activeViewportIndex}`
+ const toolGroup = ToolGroupManager.getToolGroup(toolGroupId)
+ toolGroup.setToolActive(toolName, {
+ bindings: [{ mouseButton: MouseBindings.Primary }]
+ })
+ this.activeTool = toolName
+ }
+ },
setToolsPassive() {
if (!this.activeTool) return
const toolGroupIds = ['viewport-0', 'viewport-1', 'viewport-2', 'viewport-3']
@@ -1994,7 +2096,6 @@ export default {
if (obj.TaskInfo.VisitTaskId !== this.taskInfo.VisitTaskId) {
this.setToolsPassive()
}
-
},
async showMultiFrame(obj) {
this.$refs[`viewport-${this.activeViewportIndex}`][0].setSeriesInfo(obj, true)
diff --git a/src/views/trials/trials-panel/reading/dicoms3D/components/VisitReview.vue b/src/views/trials/trials-panel/reading/dicoms3D/components/VisitReview.vue
index ae9799f3..cab09675 100644
--- a/src/views/trials/trials-panel/reading/dicoms3D/components/VisitReview.vue
+++ b/src/views/trials/trials-panel/reading/dicoms3D/components/VisitReview.vue
@@ -3,16 +3,23 @@
-
+
-
-
-
+
+
+
@@ -43,6 +50,7 @@ export default {
}
},
mounted() {
+ console.log(this.readingTool)
this.taskInfo = JSON.parse(localStorage.getItem('taskInfo'))
},
methods: {
diff --git a/src/views/trials/trials-panel/reading/dicoms3D/components/toolConfig.js b/src/views/trials/trials-panel/reading/dicoms3D/components/toolConfig.js
index 628bc33c..bed00225 100644
--- a/src/views/trials/trials-panel/reading/dicoms3D/components/toolConfig.js
+++ b/src/views/trials/trials-panel/reading/dicoms3D/components/toolConfig.js
@@ -269,7 +269,7 @@ const config = {
'i18nKey': 'trials:reading:button:Circle',
'isDisabled': false,
'disabledReason': ''
- },
+ }
]
}
const getTools = (criterionType) => {
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 c7d04817..1c098689 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
@@ -66,7 +66,7 @@