融合页面工具优化

uat_us^2
caiyiling 2026-04-30 16:44:00 +08:00
parent 72b1a3906d
commit 1b6e53819c
4 changed files with 185 additions and 99 deletions

View File

@ -179,17 +179,18 @@
<Viewport ref="CT_AXIAL" :index="1" :active-index="activeIndex" <Viewport ref="CT_AXIAL" :index="1" :active-index="activeIndex"
:is-reading-show-subject-info="isReadingShowSubjectInfo" :series-info="ctSeries" :is-reading-show-subject-info="isReadingShowSubjectInfo" :series-info="ctSeries"
:rendering-engine-id="renderingEngineId" viewport-id="CT_AXIAL" :volume="ctVolume" :rendering-engine-id="renderingEngineId" viewport-id="CT_AXIAL" :volume="ctVolume"
:measure-datas="measureDatas" :style="1 === activeIndex ? viewportStyle : {}" /> :measure-datas="measureDatas" :style="1 === activeIndex ? viewportStyle : {}"
@fusionSlicePointChange="handleFusionSlicePointChange" />
<Viewport ref="PT_AXIAL" :index="2" :active-index="activeIndex" <Viewport ref="PT_AXIAL" :index="2" :active-index="activeIndex"
:is-reading-show-subject-info="isReadingShowSubjectInfo" :series-info="petSeries" :is-reading-show-subject-info="isReadingShowSubjectInfo" :series-info="petSeries"
:rendering-engine-id="renderingEngineId" viewport-id="PT_AXIAL" :volume="ptVolume" :rendering-engine-id="renderingEngineId" viewport-id="PT_AXIAL" :volume="ptVolume"
:measure-datas="measureDatas" :style="2 === activeIndex ? viewportStyle : {}" :measure-datas="measureDatas" :style="2 === activeIndex ? viewportStyle : {}"
@upperRangeChange="upperRangeChange" /> @upperRangeChange="upperRangeChange" @fusionSlicePointChange="handleFusionSlicePointChange" />
<Viewport ref="FUSION_AXIAL" :index="3" :active-index="activeIndex" <Viewport ref="FUSION_AXIAL" :index="3" :active-index="activeIndex"
:is-reading-show-subject-info="isReadingShowSubjectInfo" :series-info="petSeries" :ct-series-info="ctSeries" :is-reading-show-subject-info="isReadingShowSubjectInfo" :series-info="petSeries" :ct-series-info="ctSeries"
:rendering-engine-id="renderingEngineId" viewport-id="FUSION_AXIAL" :volume="ptVolume" :rendering-engine-id="renderingEngineId" viewport-id="FUSION_AXIAL" :volume="ptVolume"
:measure-datas="measureDatas" :rgb-preset-name="rgbPresetName" :style="3 === activeIndex ? viewportStyle : {}" :measure-datas="measureDatas" :rgb-preset-name="rgbPresetName" :style="3 === activeIndex ? viewportStyle : {}"
@upperRangeChange="upperRangeChange" /> @upperRangeChange="upperRangeChange" @fusionSlicePointChange="handleFusionSlicePointChange" />
<Viewport ref="PET_MIP_CORONAL" :index="4" :active-index="activeIndex" <Viewport ref="PET_MIP_CORONAL" :index="4" :active-index="activeIndex"
:is-reading-show-subject-info="isReadingShowSubjectInfo" :series-info="petSeries" :is-reading-show-subject-info="isReadingShowSubjectInfo" :series-info="petSeries"
:rendering-engine-id="renderingEngineId" viewport-id="PET_MIP_CORONAL" :measure-datas="measureDatas" :rendering-engine-id="renderingEngineId" viewport-id="PET_MIP_CORONAL" :measure-datas="measureDatas"
@ -1186,6 +1187,36 @@ export default {
} }
return colors[viewportId] || '#0000ff' return colors[viewportId] || '#0000ff'
}, },
handleFusionSlicePointChange({ viewportId, worldPoint }) {
if (!this.isFusion) return
if (!viewportId || !Array.isArray(worldPoint) || worldPoint.length < 3) return
if (viewportId === viewportIds.PETMIP.CORONAL) return
const activeViewportId = this.activeIndex === 1
? viewportIds.CT.AXIAL
: this.activeIndex === 2
? viewportIds.PT.AXIAL
: this.activeIndex === 3
? viewportIds.FUSION.AXIAL
: viewportIds.PETMIP.CORONAL
if (viewportId !== activeViewportId) return
const renderEngine = getRenderingEngine(renderingEngineId)
if (!renderEngine) return
const toolGroupCandidates = [fusionToolGroupId, mipToolGroupUID, ptToolGroupId, ctToolGroupId]
let instance = null
for (const toolGroupId of toolGroupCandidates) {
const toolGroup = ToolGroupManager.getToolGroup(toolGroupId)
instance = toolGroup.getToolInstance(FusionJumpToPointTool.toolName)
if (instance.setPoint) break
}
if (!instance.setPoint) return
instance.setPoint(worldPoint, viewportId, renderEngine.id, {
jumpToTargetViewports: false,
dispatchEvent: false,
})
},
dispatchFusionCenterPoint(retryCount = 0) { dispatchFusionCenterPoint(retryCount = 0) {
const renderEngine = getRenderingEngine(renderingEngineId) const renderEngine = getRenderingEngine(renderingEngineId)
if (!renderEngine) return if (!renderEngine) return

View File

@ -272,6 +272,24 @@ export default {
this.renderColorBar(this.presetName) this.renderColorBar(this.presetName)
} }
} }
if (this.index !== 4 && viewport) {
const width = viewport.element.clientWidth
const height = viewport.element.clientHeight
let worldPoint = null
if (width && height && viewport.canvasToWorld) {
worldPoint = viewport.canvasToWorld([width / 2, height / 2])
}
if ((!worldPoint || worldPoint.length < 3) && viewport.getCamera) {
worldPoint = viewport.getCamera()?.focalPoint
}
if (Array.isArray(worldPoint) && worldPoint.length >= 3) {
this.$emit('fusionSlicePointChange', {
viewportId: this.viewportId,
worldPoint: [...worldPoint]
})
}
}
}, },
getOrientationMarker() { getOrientationMarker() {
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line no-unused-vars

View File

@ -270,6 +270,24 @@ export default {
} }
} }
if (!this.isMip && viewport) {
const width = this.element?.clientWidth
const height = this.element?.clientHeight
let worldPoint = null
if (width && height && viewport.canvasToWorld) {
worldPoint = viewport.canvasToWorld([width / 2, height / 2])
}
if ((!worldPoint || worldPoint.length < 3) && viewport.getCamera) {
worldPoint = viewport.getCamera()?.focalPoint
}
if (Array.isArray(worldPoint) && worldPoint.length >= 3) {
this.$emit('fusionSlicePointChange', {
viewportId: this.viewportId,
worldPoint: [...worldPoint],
})
}
}
}, },
setFullScreen(index) { setFullScreen(index) {
setTimeout(() => { setTimeout(() => {

View File

@ -362,7 +362,7 @@
:viewport-index="index" :active-tool="activeTool" @activeViewport="activeViewport" :viewport-index="index" :active-tool="activeTool" @activeViewport="activeViewport"
@toggleTaskByViewport="toggleTaskByViewport" @previewCD="previewCD" @toggleTaskByViewport="toggleTaskByViewport" @previewCD="previewCD"
@renderAnnotations="renderAnnotations" @upperRangeChange="upperRangeChange" @renderAnnotations="renderAnnotations" @upperRangeChange="upperRangeChange"
@contentMouseup="contentMouseup" /> @contentMouseup="contentMouseup" @fusionSlicePointChange="handleFusionSlicePointChange" />
</div> </div>
</div> </div>
<div v-if="readingTool === 2" class="fusion-hidden-viewports"> <div v-if="readingTool === 2" class="fusion-hidden-viewports">
@ -2634,6 +2634,25 @@ export default {
if (this.isFusion) return [this.fusionToolGroupId] if (this.isFusion) return [this.fusionToolGroupId]
return [`${this.viewportKey}-0`, `${this.viewportKey}-1`, `${this.viewportKey}-2`, `${this.viewportKey}-3`] return [`${this.viewportKey}-0`, `${this.viewportKey}-1`, `${this.viewportKey}-2`, `${this.viewportKey}-3`]
}, },
handleFusionSlicePointChange({ viewportId, worldPoint }) {
if (!this.isFusion) return
if (!viewportId || !Array.isArray(worldPoint) || worldPoint.length < 3) return
const activeFusionViewportId = `viewport-fusion-${this.activeViewportIndex}`
if (viewportId !== activeFusionViewportId) return
if (viewportId === 'viewport-fusion-3') return
const renderingEngine = getRenderingEngine(renderingEngineId)
if (!renderingEngine) return
const toolGroup = ToolGroupManager.getToolGroup(this.fusionToolGroupId)
const instance = toolGroup.getToolInstance(FusionJumpToPointTool.toolName)
if (!instance.setPoint) return
instance.setPoint(worldPoint, viewportId, renderingEngine.id, {
jumpToTargetViewports: false,
dispatchEvent: false,
})
},
setFusionMipJumpEnabled(enabled) { setFusionMipJumpEnabled(enabled) {
if (!this.isFusion) return if (!this.isFusion) return
const toolGroup = ToolGroupManager.getToolGroup(this.fusionToolGroupId) const toolGroup = ToolGroupManager.getToolGroup(this.fusionToolGroupId)