From 4b5fee573967e07211047621067422d8a08de5ef Mon Sep 17 00:00:00 2001
From: wangxiaoshuang <825034831@qq.com>
Date: Thu, 18 Dec 2025 17:13:13 +0800
Subject: [PATCH] =?UTF-8?q?mpr=E6=B7=BB=E5=8A=A0=E5=8D=81=E5=AD=97?=
=?UTF-8?q?=E5=87=86=E6=98=9F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/icons/svg/crosshairs.svg | 1 +
.../reading/dicoms3D/components/ReadPage.vue | 97 +++++++++++++++----
.../dicoms3D/components/VolumeViewport.vue | 7 +-
.../trials-panel/setting/attachment/index.vue | 10 +-
4 files changed, 87 insertions(+), 28 deletions(-)
create mode 100644 src/icons/svg/crosshairs.svg
diff --git a/src/icons/svg/crosshairs.svg b/src/icons/svg/crosshairs.svg
new file mode 100644
index 00000000..9a86eda3
--- /dev/null
+++ b/src/icons/svg/crosshairs.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
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 88689e51..faeab3f5 100644
--- a/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue
+++ b/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue
@@ -165,6 +165,11 @@
v-if="criterionType === 0 && readingTool === 0">
+
+
+
+
@@ -517,10 +522,11 @@ const {
EraserTool,
MIPJumpToClickTool,
VolumeRotateTool,
+ CrosshairsTool,
synchronizers
// cursors
} = cornerstoneTools
-const { createCameraPositionSynchronizer, createVOISynchronizer } = synchronizers
+const { createCameraPositionSynchronizer, createVOISynchronizer, createSlabThicknessSynchronizer } = synchronizers
const newStyles = {
global: {
color: 'rgb(255, 0, 0)',
@@ -665,7 +671,8 @@ export default {
ManualsClose: false,
- isMPR: false
+ isMPR: false,
+ volumeToolGroupId: "share-viewport-volume"
}
},
computed: {
@@ -1167,11 +1174,16 @@ export default {
cornerstoneTools.addTool(CobbAngleTool)
cornerstoneTools.addTool(MIPJumpToClickTool)
cornerstoneTools.addTool(VolumeRotateTool)
+ cornerstoneTools.addTool(CrosshairsTool)
viewportIds.forEach((viewportId, i) => {
// const toolGroupId = `viewport-${i}`
- const toolGroupId = viewportId
- const toolGroup = ToolGroupManager.createToolGroup(toolGroupId)
+ let toolGroupId = viewportId
+ if (volumeViewportIds.includes(viewportId)) {
+ toolGroupId = this.volumeToolGroupId
+ }
+
+ const toolGroup = ToolGroupManager.getToolGroup(toolGroupId) ? ToolGroupManager.getToolGroup(toolGroupId) : ToolGroupManager.createToolGroup(toolGroupId)
toolGroup.addViewport(viewportId, renderingEngineId)
toolGroup.addTool(StackScrollTool.toolName, {
loop: true, // 启用循环滚动
@@ -1184,6 +1196,7 @@ export default {
toolGroup.addTool(WindowLevelTool.toolName, {
targetViewportIds: volumeViewportIds
})
+ toolGroup.addTool(CrosshairsTool.toolName);
} else {
toolGroup.addTool(WindowLevelTool.toolName)
}
@@ -1296,7 +1309,7 @@ export default {
})
eventTarget.addEventListener('cornerstoneimageloadprogress', this.imageLoadProgress)
- console.log(Events, toolsEvents)
+ // console.log(Events, toolsEvents)
if (this.readingTool === 2) {
this.setUpSynchronizers()
}
@@ -2014,14 +2027,22 @@ export default {
},
// 激活工具
setToolActive(toolName) {
- const toolGroupId = `${this.viewportKey}-${this.activeViewportIndex}`
+ const toolGroupId = this.isMPR ? this.volumeToolGroupId : `${this.viewportKey}-${this.activeViewportIndex}`
const toolGroup = ToolGroupManager.getToolGroup(toolGroupId)
if (this.activeTool === toolName) {
- toolGroup.setToolPassive(this.activeTool)
+ if (toolName === CrosshairsTool.toolName) {
+ toolGroup.setToolDisabled(this.activeTool)
+ } else {
+ toolGroup.setToolPassive(this.activeTool)
+ }
this.activeTool = ''
} else {
if (this.activeTool) {
- toolGroup.setToolPassive(this.activeTool)
+ if (toolName === CrosshairsTool.toolName) {
+ toolGroup.setToolDisabled(this.activeTool)
+ } else {
+ toolGroup.setToolPassive(this.activeTool)
+ }
}
toolGroup.setToolActive(toolName, {
bindings: [{ mouseButton: MouseBindings.Primary }]
@@ -2036,14 +2057,22 @@ export default {
if (!toolObj || toolObj.isDisabled) return
const series = this.$refs[`${this.viewportKey}-${this.activeViewportIndex}`][0].series
if (series && series.TaskInfo.VisitTaskId && series.TaskInfo.VisitTaskId === this.taskInfo.VisitTaskId) {
- const toolGroupId = `${this.viewportKey}-${this.activeViewportIndex}`
+ const toolGroupId = this.isMPR ? this.volumeToolGroupId : `${this.viewportKey}-${this.activeViewportIndex}`
const toolGroup = ToolGroupManager.getToolGroup(toolGroupId)
if (this.activeTool === toolName) {
- toolGroup.setToolPassive(this.activeTool)
+ if (toolName === CrosshairsTool.toolName) {
+ toolGroup.setToolDisabled(this.activeTool)
+ } else {
+ toolGroup.setToolPassive(this.activeTool)
+ }
this.activeTool = ''
} else {
if (this.activeTool) {
- toolGroup.setToolPassive(this.activeTool)
+ if (toolName === CrosshairsTool.toolName) {
+ toolGroup.setToolDisabled(this.activeTool)
+ } else {
+ toolGroup.setToolPassive(this.activeTool)
+ }
}
toolGroup.setToolActive(toolName, {
bindings: [{ mouseButton: MouseBindings.Primary }]
@@ -2060,10 +2089,14 @@ export default {
if (this.activeTool === toolName) return
const series = this.$refs[`${this.viewportKey}-${this.activeViewportIndex}`][0].series
if (series && series.TaskInfo.VisitTaskId && series.TaskInfo.VisitTaskId === this.taskInfo.VisitTaskId) {
- const toolGroupId = `${this.viewportKey}-${this.activeViewportIndex}`
+ const toolGroupId = this.isMPR ? this.volumeToolGroupId : `${this.viewportKey}-${this.activeViewportIndex}`
const toolGroup = ToolGroupManager.getToolGroup(toolGroupId)
if (this.activeTool) {
- toolGroup.setToolPassive(this.activeTool)
+ if (toolName === CrosshairsTool.toolName) {
+ toolGroup.setToolDisabled(this.activeTool)
+ } else {
+ toolGroup.setToolPassive(this.activeTool)
+ }
}
toolGroup.setToolActive(toolName, {
bindings: [{ mouseButton: MouseBindings.Primary }]
@@ -2076,9 +2109,13 @@ export default {
if (this.activeTool && this.toolNames.includes(this.activeTool)) {
const series = this.$refs[`${this.viewportKey}-${this.activeViewportIndex}`][0].series
if (series && series.TaskInfo.VisitTaskId && series.TaskInfo.VisitTaskId === this.taskInfo.VisitTaskId) {
- const toolGroupId = `${this.viewportKey}-${this.activeViewportIndex}`
+ const toolGroupId = this.isMPR ? this.volumeToolGroupId : `${this.viewportKey}-${this.activeViewportIndex}`
const toolGroup = ToolGroupManager.getToolGroup(toolGroupId)
- toolGroup.setToolPassive(this.activeTool)
+ if (this.activeTool === CrosshairsTool.toolName) {
+ toolGroup.setToolDisabled(this.activeTool)
+ } else {
+ toolGroup.setToolPassive(this.activeTool)
+ }
this.activeTool = ''
}
}
@@ -2088,7 +2125,7 @@ export default {
this.setToolsPassive()
const series = this.$refs[`${this.viewportKey}-${this.activeViewportIndex}`][0].series
if (series && series.TaskInfo.VisitTaskId && series.TaskInfo.VisitTaskId === this.taskInfo.VisitTaskId) {
- const toolGroupId = `${this.viewportKey}-${this.activeViewportIndex}`
+ const toolGroupId = this.isMPR ? this.volumeToolGroupId : `${this.viewportKey}-${this.activeViewportIndex}`
const toolGroup = ToolGroupManager.getToolGroup(toolGroupId)
toolGroup.setToolActive(toolName, {
bindings: [{ mouseButton: MouseBindings.Primary }]
@@ -2100,11 +2137,16 @@ export default {
if (!this.activeTool) return
let toolGroupIds = [`${this.viewportKey}-0`, `${this.viewportKey}-1`, `${this.viewportKey}-2`, `${this.viewportKey}-3`]
if (this.isMPR) {
- toolGroupIds = [`${this.viewportKey}-0`, `${this.viewportKey}-1`, `${this.viewportKey}-2`]
+ // toolGroupIds = [`${this.viewportKey}-0`, `${this.viewportKey}-1`, `${this.viewportKey}-2`]
+ toolGroupIds = [this.volumeToolGroupId]
}
toolGroupIds.forEach(toolGroupId => {
const toolGroup = ToolGroupManager.getToolGroup(toolGroupId)
- toolGroup.setToolPassive(this.activeTool)
+ if (this.activeTool === CrosshairsTool.toolName) {
+ toolGroup.setToolDisabled(this.activeTool)
+ } else {
+ toolGroup.setToolPassive(this.activeTool)
+ }
})
this.activeTool = ''
},
@@ -2112,7 +2154,8 @@ export default {
if (!this.activeTool) return
let toolGroupIds = [`${this.viewportKey}-0`, `${this.viewportKey}-1`, `${this.viewportKey}-2`, `${this.viewportKey}-3`]
if (this.isMPR) {
- toolGroupIds = [`${this.viewportKey}-0`, `${this.viewportKey}-1`, `${this.viewportKey}-2`]
+ // toolGroupIds = [`${this.viewportKey}-0`, `${this.viewportKey}-1`, `${this.viewportKey}-2`]
+ toolGroupIds = [this.volumeToolGroupId]
}
toolGroupIds.forEach(toolGroupId => {
const toolGroup = ToolGroupManager.getToolGroup(toolGroupId)
@@ -2972,7 +3015,7 @@ export default {
if (this.activeTool) {
this.setToolsPassive()
}
- const toolGroupId = `${this.viewportKey}-${this.activeViewportIndex}`
+ const toolGroupId = this.isMPR ? this.volumeToolGroupId : `${this.viewportKey}-${this.activeViewportIndex}`
const toolGroup = ToolGroupManager.getToolGroup(toolGroupId)
toolGroup.setToolActive(toolName, {
bindings: [{ mouseButton: MouseBindings.Primary }]
@@ -3201,6 +3244,20 @@ export default {
viewportId
})
});
+ const synchronizer = createSlabThicknessSynchronizer('SLAB_THICKNESS_SYNCHRONIZER_ID');
+
+ // Add viewports to VOI synchronizers
+ [
+ `viewport-volume-0`,
+ `viewport-volume-1`,
+ `viewport-volume-2`
+ ].forEach((viewportId) => {
+ synchronizer.add({
+ renderingEngineId: this.renderingEngineId,
+ viewportId,
+ });
+ });
+ synchronizer.setEnabled(false);
},
setColorMap(rgbPresetName) {
const fusionViewportIds = [`viewport-fusion-1`, `viewport-fusion-2`, `viewport-fusion-3`]
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 c41845e1..dd44c9c7 100644
--- a/src/views/trials/trials-panel/reading/dicoms3D/components/VolumeViewport.vue
+++ b/src/views/trials/trials-panel/reading/dicoms3D/components/VolumeViewport.vue
@@ -40,10 +40,10 @@
Location: {{
`${Number(imageInfo.location).toFixed(digitPlaces)} mm`
- }}
+ }}
Slice Thickness: {{
`${Number(imageInfo.sliceThickness).toFixed(digitPlaces)} mm`
- }}
+ }}
WW/WL: {{ imageInfo.wwwc }}
@@ -226,7 +226,8 @@ export default {
this.imageInfo.wwwc = `${Math.round(windowWidth)}/${Math.round(windowCenter)}`
}
}
- const toolGroupId = this.viewportId
+ // const toolGroupId = this.viewportId
+ const toolGroupId = 'share-viewport-volume'
const toolGroup = cornerstoneTools.ToolGroupManager.getToolGroup(toolGroupId)
toolGroup.setToolEnabled('ScaleOverlay')
diff --git a/src/views/trials/trials-panel/setting/attachment/index.vue b/src/views/trials/trials-panel/setting/attachment/index.vue
index 1e1643e5..3c2c3a2c 100644
--- a/src/views/trials/trials-panel/setting/attachment/index.vue
+++ b/src/views/trials/trials-panel/setting/attachment/index.vue
@@ -141,14 +141,14 @@
-
+
-
+