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 @@ - + - +