自定义阅片更改
continuous-integration/drone/push Build is passing Details

uat
caiyiling 2025-04-28 10:19:37 +08:00
parent 92d41dff28
commit ca579f8731
5 changed files with 125 additions and 16 deletions

View File

@ -2,7 +2,7 @@
<div ref="container" style="width:100%;height:100%" class="dicom-container"> <div ref="container" style="width:100%;height:100%" class="dicom-container">
<!-- 访视阅片 --> <!-- 访视阅片 -->
<div v-if="readingCategory=== 1 && (CriterionType === 7 || ((CriterionType === 1 || CriterionType === 0) && readingVersionEnum === 1)) " class="reading-wrapper"> <div v-if="readingCategory=== 1 && (CriterionType === 7 || ((CriterionType === 1 || CriterionType === 0) && readingVersionEnum === 1)) " class="reading-wrapper">
<VisitReview :readingTool="readingTool" /> <VisitReview :reading-tool="readingTool" />
</div> </div>
<div v-else-if="(isReadingTaskViewInOrder === 1 || ((isReadingTaskViewInOrder !== 1) && isShow)) && readingCategory=== 1 && CriterionType !== 0" class="reading-wrapper"> <div v-else-if="(isReadingTaskViewInOrder === 1 || ((isReadingTaskViewInOrder !== 1) && isShow)) && readingCategory=== 1 && CriterionType !== 0" class="reading-wrapper">
<el-tabs v-model="activeName" v-loading="loading" :before-leave="beforeLeave"> <el-tabs v-model="activeName" v-loading="loading" :before-leave="beforeLeave">

View File

@ -270,6 +270,33 @@
> >
<svg-icon icon-class="refresh" class="svg-icon" /> <svg-icon icon-class="refresh" class="svg-icon" />
</div> </div>
<!-- 更多 -->
<div
v-if="criterionType === 0"
class="tool-item"
:title="$t('trials:reading:button:more')"
@click.stop="showPanel($event)"
@mouseleave="toolMouseout"
>
<div class="dropdown">
<div
class="icon"
data-tool="more"
>
<svg-icon icon-class="more" class="svg-icon" />
<i class="el-icon-arrow-down" style="color:#fff;" />
</div>
<div class="dropdown-content">
<ul style="width:100px;">
<li v-for="i in customizeStandards" :key="i.toolName" style="text-align:left;">
<a href="#" @click.prevent="setMoreToolActive(i.toolName)">
{{ $t(i.i18nKey) }}
</a>
</li>
</ul>
</div>
</div>
</div>
</div> </div>
<div> <div>
@ -481,7 +508,7 @@ import {
import * as cornerstoneTools from '@cornerstonejs/tools' import * as cornerstoneTools from '@cornerstonejs/tools'
import initLibraries from '@/views/trials/trials-panel/reading/dicoms/components/Fusion/js/initLibraries' import initLibraries from '@/views/trials/trials-panel/reading/dicoms/components/Fusion/js/initLibraries'
import html2canvas from 'html2canvas' import html2canvas from 'html2canvas'
import { getTools, getCustomizeStandardsTools } from './toolConfig' import { getTools, getCustomizeStandardsTools, config } from './toolConfig'
import StudyList from './StudyList' import StudyList from './StudyList'
import Viewport from './Viewport' import Viewport from './Viewport'
import mRecisit from './mRecist/QuestionList' import mRecisit from './mRecist/QuestionList'
@ -511,6 +538,7 @@ const {
ArrowAnnotateTool, ArrowAnnotateTool,
RectangleROITool, RectangleROITool,
PlanarFreehandROITool, PlanarFreehandROITool,
CircleROITool,
EraserTool EraserTool
// cursors // cursors
} = cornerstoneTools } = cornerstoneTools
@ -616,7 +644,8 @@ export default {
digitPlaces: 2, digitPlaces: 2,
instanceInfo: {}, instanceInfo: {},
lastViewportTaskIds: [], lastViewportTaskIds: [],
markedSeriesIds: [] markedSeriesIds: [],
customizeStandards: []
} }
}, },
computed: { computed: {
@ -696,6 +725,7 @@ export default {
this.digitPlaces = digitPlaces === -1 ? this.digitPlaces : digitPlaces this.digitPlaces = digitPlaces === -1 ? this.digitPlaces : digitPlaces
if (this.criterionType === 0) { if (this.criterionType === 0) {
this.tools = getCustomizeStandardsTools(this.taskInfo.ReadingToolList) this.tools = getCustomizeStandardsTools(this.taskInfo.ReadingToolList)
this.customizeStandards = [...config.customizeStandards]
} else { } else {
this.tools = getTools(this.criterionType) this.tools = getTools(this.criterionType)
} }
@ -872,7 +902,6 @@ export default {
reject(e) reject(e)
} }
}) })
}, },
// //
setInitSeries() { setInitSeries() {
@ -979,6 +1008,7 @@ export default {
cornerstoneTools.addTool(LengthTool) cornerstoneTools.addTool(LengthTool)
cornerstoneTools.addTool(BidirectionalTool) cornerstoneTools.addTool(BidirectionalTool)
cornerstoneTools.addTool(ScaleOverlayTool) cornerstoneTools.addTool(ScaleOverlayTool)
cornerstoneTools.addTool(CircleROITool)
viewportIds.forEach((viewportId, i) => { viewportIds.forEach((viewportId, i) => {
const toolGroupId = `viewport-${i}` const toolGroupId = `viewport-${i}`
@ -1020,6 +1050,9 @@ export default {
// cachedStats: true // cachedStats: true
getTextLines: this.getBidirectionalToolTextLines getTextLines: this.getBidirectionalToolTextLines
}) })
toolGroup.addTool(CircleROITool.toolName, {
getTextLines: this.getCircleROIToolTextLines
})
toolGroup.setToolActive(StackScrollTool.toolName, { toolGroup.setToolActive(StackScrollTool.toolName, {
bindings: [{ mouseButton: MouseBindings.Wheel }] bindings: [{ mouseButton: MouseBindings.Wheel }]
@ -1037,12 +1070,14 @@ export default {
toolGroup.setToolPassive(PlanarFreehandROITool.toolName) toolGroup.setToolPassive(PlanarFreehandROITool.toolName)
toolGroup.setToolPassive(LengthTool.toolName) toolGroup.setToolPassive(LengthTool.toolName)
toolGroup.setToolPassive(BidirectionalTool.toolName) toolGroup.setToolPassive(BidirectionalTool.toolName)
toolGroup.setToolPassive(CircleROITool.toolName)
} else { } else {
toolGroup.setToolEnabled(ArrowAnnotateTool.toolName) toolGroup.setToolEnabled(ArrowAnnotateTool.toolName)
toolGroup.setToolEnabled(RectangleROITool.toolName) toolGroup.setToolEnabled(RectangleROITool.toolName)
toolGroup.setToolEnabled(PlanarFreehandROITool.toolName) toolGroup.setToolEnabled(PlanarFreehandROITool.toolName)
toolGroup.setToolEnabled(LengthTool.toolName) toolGroup.setToolEnabled(LengthTool.toolName)
toolGroup.setToolEnabled(BidirectionalTool.toolName) toolGroup.setToolEnabled(BidirectionalTool.toolName)
toolGroup.setToolEnabled(CircleROITool.toolName)
} }
toolGroup.setToolPassive(EraserTool.toolName) toolGroup.setToolPassive(EraserTool.toolName)
}) })
@ -1216,6 +1251,11 @@ export default {
if (this.readingTaskState === 2) return if (this.readingTaskState === 2) return
const { annotation } = e.detail const { annotation } = e.detail
if (!annotation) return 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 if (annotation.metadata.toolName === 'PlanarFreehandROI' && !annotation.data.contour.closed) return
const series = this.$refs[`viewport-${this.activeViewportIndex}`][0].series const series = this.$refs[`viewport-${this.activeViewportIndex}`][0].series
if (series && series.TaskInfo.VisitTaskId && series.TaskInfo.VisitTaskId === this.taskInfo.VisitTaskId) { if (series && series.TaskInfo.VisitTaskId && series.TaskInfo.VisitTaskId === this.taskInfo.VisitTaskId) {
@ -1271,6 +1311,11 @@ export default {
const { annotation } = e.detail const { annotation } = e.detail
if (!annotation.highlighted) return if (!annotation.highlighted) return
if (!annotation) 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.data.label) return
if (annotation.metadata.toolName === 'PlanarFreehandROI' && !annotation.data.contour.closed) return if (annotation.metadata.toolName === 'PlanarFreehandROI' && !annotation.data.contour.closed) return
const series = this.$refs[`viewport-${this.activeViewportIndex}`][0].series const series = this.$refs[`viewport-${this.activeViewportIndex}`][0].series
@ -1515,6 +1560,52 @@ export default {
return textLines 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) { setToolActive(toolName) {
const toolGroupId = `viewport-${this.activeViewportIndex}` 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() { setToolsPassive() {
if (!this.activeTool) return if (!this.activeTool) return
const toolGroupIds = ['viewport-0', 'viewport-1', 'viewport-2', 'viewport-3'] const toolGroupIds = ['viewport-0', 'viewport-1', 'viewport-2', 'viewport-3']
@ -1994,7 +2096,6 @@ export default {
if (obj.TaskInfo.VisitTaskId !== this.taskInfo.VisitTaskId) { if (obj.TaskInfo.VisitTaskId !== this.taskInfo.VisitTaskId) {
this.setToolsPassive() this.setToolsPassive()
} }
}, },
async showMultiFrame(obj) { async showMultiFrame(obj) {
this.$refs[`viewport-${this.activeViewportIndex}`][0].setSeriesInfo(obj, true) this.$refs[`viewport-${this.activeViewportIndex}`][0].setSeriesInfo(obj, true)

View File

@ -3,16 +3,23 @@
<el-tabs v-model="activeName"> <el-tabs v-model="activeName">
<!-- 阅片 --> <!-- 阅片 -->
<el-tab-pane v-if="taskInfo" :label="$t('trials:reading:tabTitle:review')" name="read"> <el-tab-pane v-if="taskInfo" :label="$t('trials:reading:tabTitle:review')" name="read">
<read-page ref="readPage" v-if="!readingTool" /> <read-page v-if="!readingTool" ref="readPage" />
<PetCtReadPage v-else-if="readingTool === 2" /> <PetCtReadPage v-else-if="readingTool === 2" />
</el-tab-pane> </el-tab-pane>
<!-- 报告 --> <!-- 报告 -->
<el-tab-pane v-if="taskInfo && !taskInfo.IseCRFShowInDicomReading" :label="$t('trials:reading:tabTitle:report')" <el-tab-pane
name="report"> v-if="taskInfo && !taskInfo.IseCRFShowInDicomReading"
<report-page v-if="activeName === 'report' && taskInfo.CriterionType !== 0" :label="$t('trials:reading:tabTitle:report')"
@setReadingTaskState="setReadingTaskState" /> name="report"
<customize-report-page v-if="activeName === 'report' && taskInfo.CriterionType === 0" >
@setReadingTaskState="setReadingTaskState" /> <report-page
v-if="activeName === 'report' && taskInfo.CriterionType !== 0"
@setReadingTaskState="setReadingTaskState"
/>
<customize-report-page
v-if="activeName === 'report' && taskInfo.CriterionType === 0"
@setReadingTaskState="setReadingTaskState"
/>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
@ -43,6 +50,7 @@ export default {
} }
}, },
mounted() { mounted() {
console.log(this.readingTool)
this.taskInfo = JSON.parse(localStorage.getItem('taskInfo')) this.taskInfo = JSON.parse(localStorage.getItem('taskInfo'))
}, },
methods: { methods: {

View File

@ -269,7 +269,7 @@ const config = {
'i18nKey': 'trials:reading:button:Circle', 'i18nKey': 'trials:reading:button:Circle',
'isDisabled': false, 'isDisabled': false,
'disabledReason': '' 'disabledReason': ''
}, }
] ]
} }
const getTools = (criterionType) => { const getTools = (criterionType) => {

View File

@ -66,7 +66,7 @@
</el-form-item> </el-form-item>
<!-- 测量工具 --> <!-- 测量工具 -->
<el-form-item <el-form-item
v-if="CriterionType === 0 && form.ReadingTool === 0 && form.ReadingTaskViewEnum === 1" v-if="CriterionType === 0 && form.ReadingTool === 0 && form.ReadingVersionEnum === 1"
:label="$t('trials:readingUnit:readingRules:title:measureTool')" :label="$t('trials:readingUnit:readingRules:title:measureTool')"
> >
<el-checkbox-group <el-checkbox-group