From f997cec4fb24059dfbe06e45ee0f2e6ec9f5623b Mon Sep 17 00:00:00 2001 From: wangxiaoshuang <825034831@qq.com> Date: Thu, 15 Jan 2026 16:02:19 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9D=9EDICOM=E9=98=85=E7=89=87=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E6=94=AF=E6=8C=81=E6=B5=8B=E9=87=8F=E4=B8=8E=E6=A0=87?= =?UTF-8?q?=E6=B3=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../reading/dicoms3D/components/toolConfig.js | 37 ++++++++++------ .../visit-review/components/FileViewer.vue | 43 ++++++++++++++++++- 2 files changed, 64 insertions(+), 16 deletions(-) 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 b92ed1c8..9dd68cc1 100644 --- a/src/views/trials/trials-panel/reading/dicoms3D/components/toolConfig.js +++ b/src/views/trials/trials-panel/reading/dicoms3D/components/toolConfig.js @@ -313,6 +313,15 @@ const config = { 'isDisabled': false, 'disabledReason': '' }, + { + 'name': '长短径测量工具', + 'icon': 'bidirection', + 'toolName': 'Bidirectional', + 'props': ['length', 'width'], + 'i18nKey': 'trials:reading:button:bidirectional', + 'isDisabled': false, + 'disabledReason': '' + }, { 'name': '矩形工具', 'icon': 'rectangle', @@ -322,15 +331,6 @@ const config = { 'isDisabled': false, 'disabledReason': '' }, - { - 'name': '箭头工具', - 'icon': 'arrow', - 'toolName': 'ArrowAnnotate', - 'props': [], - 'i18nKey': 'trials:reading:button:arrowAnnotate', - 'isDisabled': false, - 'disabledReason': '' - }, { 'name': '圆形工具', 'icon': 'oval', @@ -349,6 +349,15 @@ const config = { 'isDisabled': false, 'disabledReason': '' }, + { + 'name': '自由曲线', + 'icon': 'polygon', + 'toolName': 'PlanarFreehandROI', + 'props': ['area', 'mean', 'max', 'stdDev', 'perimeter'], + 'i18nKey': 'trials:reading:button:planarFreehandROI', + 'isDisabled': false, + 'disabledReason': '' + }, { 'name': '角度工具', 'icon': 'angle', @@ -359,11 +368,11 @@ const config = { 'disabledReason': '' }, { - 'name': '自由曲线', - 'icon': 'polygon', - 'toolName': 'PlanarFreehandROI', - 'props': ['area', 'mean', 'max', 'stdDev', 'perimeter'], - 'i18nKey': 'trials:reading:button:planarFreehandROI', + 'name': '箭头工具', + 'icon': 'arrow', + 'toolName': 'ArrowAnnotate', + 'props': [], + 'i18nKey': 'trials:reading:button:arrowAnnotate', 'isDisabled': false, 'disabledReason': '' }, diff --git a/src/views/trials/trials-panel/reading/visit-review/components/FileViewer.vue b/src/views/trials/trials-panel/reading/visit-review/components/FileViewer.vue index a874ede7..1ddbf378 100644 --- a/src/views/trials/trials-panel/reading/visit-review/components/FileViewer.vue +++ b/src/views/trials/trials-panel/reading/visit-review/components/FileViewer.vue @@ -308,7 +308,8 @@ const { LengthTool, EllipticalROITool, CircleROITool, - AngleTool + AngleTool, + BidirectionalTool, // cursors } = cornerstoneTools const { MouseBindings, Events: toolsEvents } = csToolsEnums @@ -607,7 +608,7 @@ export default { cornerstoneTools.addTool(EraserTool) cornerstoneTools.addTool(LengthTool) cornerstoneTools.addTool(LengthscaleTool) - + cornerstoneTools.addTool(BidirectionalTool) viewportIds.forEach((viewportId, i) => { const toolGroupId = `canvas-${i}` const toolGroup = ToolGroupManager.createToolGroup(toolGroupId) @@ -635,6 +636,10 @@ export default { cachedStats: false, getTextLines: this.getRectangleROIToolTextLines }) + toolGroup.addTool(BidirectionalTool.toolName, { + // cachedStats: true + getTextLines: this.getBidirectionalToolTextLines + }) toolGroup.addTool(EllipticalROITool.toolName, { cachedStats: false, getTextLines: this.getEllipticalROIToolTextLines @@ -684,6 +689,7 @@ export default { toolGroup.setToolPassive(SplineROITool.toolName) toolGroup.setToolPassive(LengthTool.toolName) toolGroup.setToolPassive(LengthscaleTool.toolName) + toolGroup.setToolPassive(BidirectionalTool.toolName) } else { toolGroup.setToolEnabled(ArrowAnnotateTool.toolName) toolGroup.setToolEnabled(RectangleROITool.toolName) @@ -694,6 +700,7 @@ export default { toolGroup.setToolEnabled(SplineROITool.toolName) toolGroup.setToolEnabled(LengthTool.toolName) toolGroup.setToolEnabled(LengthscaleTool.toolName) + toolGroup.setToolEnabled(BidirectionalTool.toolName) } toolGroup.setToolPassive(EraserTool.toolName) }) @@ -1430,6 +1437,38 @@ export default { } return textLines }, + // 长短径工具注释 + getBidirectionalToolTextLines(data, targetId) { + const { cachedStats, label } = data + const { length, width, unit } = cachedStats[targetId] + let ps = null + const path = targetId.split(`web:${this.OSSclientConfig.basePath}`)[1] + const i = this.psArr.findIndex(i => i.Path === path) + if (i > -1 && this.psArr[i].PS) { + ps = parseFloat(this.psArr[i].PS).toFixed(3) + } + const textLines = [] + if (label) { + textLines.push(data.status ? `${label}(${data.status})` : label) + } + if (length === undefined) { + return textLines + } + if (ps) { + textLines.push( + `L: ${this.reRound(csUtils.roundNumber(length * ps), this.digitPlaces)} mm`, + `S: ${this.reRound(csUtils.roundNumber(width * ps), this.digitPlaces)} mm` + ) + } else { + textLines.push( + `L: ${this.reRound(csUtils.roundNumber(length), this.digitPlaces)} ${unit || unit}`, + `S: ${this.reRound(csUtils.roundNumber(length), this.digitPlaces)} ${unit}` + ) + } + + + return textLines + }, // 直线工具注释 getLengthToolTextLines(data, targetId) { const cachedVolumeStats = data.cachedStats[targetId]