1
continuous-integration/drone/push Build is passing Details

uat
caiyiling 2025-03-18 17:55:22 +08:00
parent d753fbc2ab
commit 9277d48c85
2 changed files with 72 additions and 76 deletions

View File

@ -70,7 +70,7 @@
> >
<svg-icon icon-class="polygon" class="svg-icon" /> <svg-icon icon-class="polygon" class="svg-icon" />
</div> --> </div> -->
<div <div
:class="['tool-item', readingTaskState === 2 ? 'tool-disabled' : '', activeTool === 'Eraser' ? 'tool-item-active' : '']" :class="['tool-item', readingTaskState === 2 ? 'tool-disabled' : '', activeTool === 'Eraser' ? 'tool-item-active' : '']"
:title="$t('trials:dicom-show:Eraser')" :title="$t('trials:dicom-show:Eraser')"
@ -161,7 +161,7 @@
</div> </div>
</div> </div>
<div :ref="`sliderBox-${index}`" class="right-slider-box" @click.stop="clickSlider($event, index)"> <div :ref="`sliderBox-${index}`" class="right-slider-box" @click.stop="clickSlider($event, index)">
<div :style="{top: v.height + '%'}" class="slider" @click.stop.prevent="() => {return}" @mousedown.stop="sliderMousedown($event, index)"/> <div :style="{top: v.height + '%'}" class="slider" @click.stop.prevent="() => {return}" @mousedown.stop="sliderMousedown($event, index)" />
</div> </div>
</div> </div>
<div v-show="v.fileType === 'application/pdf' && fullScreenIndex === null " class="content flex_col"> <div v-show="v.fileType === 'application/pdf' && fullScreenIndex === null " class="content flex_col">
@ -225,12 +225,12 @@
:close-on-press-escape="false" :close-on-press-escape="false"
:show-close="false" :show-close="false"
width="400px" width="400px"
> >
<el-form :model="form" :rules="rules" ref="lengthForm"> <el-form ref="lengthForm" :model="form" :rules="rules">
<el-form-item label="" prop="length"> <el-form-item label="" prop="length">
<el-input v-model="form.length" type="number"> <el-input v-model="form.length" type="number">
<template slot="append">mm</template> <template slot="append">mm</template>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
@ -316,9 +316,9 @@ export default {
}, },
rules: { rules: {
length: [ length: [
{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' }, { required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' },
{ pattern: /^\d+$/, message: this.$t('trials:noneDicom:message:msg3'), trigger: ['blur', 'change'] } { pattern: /^\d+$/, message: this.$t('trials:noneDicom:message:msg3'), trigger: ['blur', 'change'] }
], ]
} }
} }
}, },
@ -391,7 +391,7 @@ export default {
isMove: false, isMove: false,
height: 0 height: 0
})) }))
let digitPlaces = Number(localStorage.getItem('digitPlaces')) const digitPlaces = Number(localStorage.getItem('digitPlaces'))
this.digitPlaces = digitPlaces === -1 ? this.digitPlaces : digitPlaces this.digitPlaces = digitPlaces === -1 ? this.digitPlaces : digitPlaces
this.initLoader() this.initLoader()
window.addEventListener('message', this.handleIframeMessage) window.addEventListener('message', this.handleIframeMessage)
@ -429,7 +429,6 @@ export default {
element.oncontextmenu = (e) => e.preventDefault() element.oncontextmenu = (e) => e.preventDefault()
resizeObserver.observe(element) resizeObserver.observe(element)
element.addEventListener('CORNERSTONE_STACK_NEW_IMAGE', this.stackNewImage) element.addEventListener('CORNERSTONE_STACK_NEW_IMAGE', this.stackNewImage)
}) })
const viewportInputArray = [ const viewportInputArray = [
{ {
@ -466,7 +465,6 @@ export default {
cornerstoneTools.addTool(SplineROITool) cornerstoneTools.addTool(SplineROITool)
cornerstoneTools.addTool(EraserTool) cornerstoneTools.addTool(EraserTool)
cornerstoneTools.addTool(LengthTool) cornerstoneTools.addTool(LengthTool)
viewportIds.forEach((viewportId, i) => { viewportIds.forEach((viewportId, i) => {
const toolGroupId = `canvas-${i}` const toolGroupId = `canvas-${i}`
@ -499,13 +497,13 @@ export default {
// 'spline' // 'spline'
// ) // )
toolGroup.addTool(SplineROITool.toolName) toolGroup.addTool(SplineROITool.toolName)
toolGroup.addTool(EraserTool.toolName) toolGroup.addTool(EraserTool.toolName)
toolGroup.addTool(LengthTool.toolName, { toolGroup.addTool(LengthTool.toolName, {
getTextLines: this.getLengthToolTextLines, getTextLines: this.getLengthToolTextLines,
cachedStats: false cachedStats: false
}) })
toolGroup.setToolActive(StackScrollTool.toolName, { toolGroup.setToolActive(StackScrollTool.toolName, {
bindings: [{ mouseButton: MouseBindings.Wheel }] bindings: [{ mouseButton: MouseBindings.Wheel }]
}) })
@ -548,12 +546,12 @@ export default {
this.renderHistoryAnnotationTaskIds.push(obj.VisitTaskId) this.renderHistoryAnnotationTaskIds.push(obj.VisitTaskId)
// let arr = [] // let arr = []
obj.Annotations.map(i => { obj.Annotations.map(i => {
const annotation = i.MeasureData const annotation = i.MeasureData
annotation.annotationId = i.Id annotation.annotationId = i.Id
cornerstoneTools.annotation.state.addAnnotation(annotation) cornerstoneTools.annotation.state.addAnnotation(annotation)
if (obj.ReadingTaskState === 2) { if (obj.ReadingTaskState === 2) {
cornerstoneTools.annotation.locking.setAnnotationLocked(annotation.annotationUID) cornerstoneTools.annotation.locking.setAnnotationLocked(annotation.annotationUID)
} }
}) })
}, },
// //
@ -649,7 +647,7 @@ export default {
this.rows = parseInt(command.split('*')[0]) this.rows = parseInt(command.split('*')[0])
this.cols = parseInt(command.split('*')[1]) this.cols = parseInt(command.split('*')[1])
if (this.rows === 1 && this.cols === 1) { if (this.rows === 1 && this.cols === 1) {
this.$nextTick(()=>{ this.$nextTick(() => {
this.activeCanvas(0) this.activeCanvas(0)
}) })
} }
@ -790,9 +788,9 @@ export default {
if (toolName === 'Length') { if (toolName === 'Length') {
const renderingEngine = getRenderingEngine(renderingEngineId) const renderingEngine = getRenderingEngine(renderingEngineId)
const viewport = renderingEngine.getViewport(`canvas-${this.activeCanvasIndex}`) const viewport = renderingEngine.getViewport(`canvas-${this.activeCanvasIndex}`)
let imageId = viewport.csImage.imageId const imageId = viewport.csImage.imageId
let annotations = cornerstoneTools.annotation.state.getAllAnnotations() const annotations = cornerstoneTools.annotation.state.getAllAnnotations()
let idx = annotations.findIndex(i=>i.metadata.referencedImageId === imageId && i.metadata.toolName === 'Length') const idx = annotations.findIndex(i => i.metadata.referencedImageId === imageId && i.metadata.toolName === 'Length')
if (idx > -1) { if (idx > -1) {
this.activeTool = '' this.activeTool = ''
// //
@ -858,7 +856,7 @@ export default {
const fileList = this.viewportInfos[i].fileList const fileList = this.viewportInfos[i].fileList
const fileIndex = fileList.findIndex(f => f.Path === path) const fileIndex = fileList.findIndex(f => f.Path === path)
if (annotation.metadata.toolName === 'Length') { if (annotation.metadata.toolName === 'Length') {
this.$emit('setPS', {NoneDicomFileId: fileList[fileIndex].Id,Path: fileList[fileIndex].Path, PS: null}) this.$emit('setPS', { NoneDicomFileId: fileList[fileIndex].Id, Path: fileList[fileIndex].Path, PS: null })
} }
}, },
async annotationModifiedListener(e) { async annotationModifiedListener(e) {
@ -879,10 +877,10 @@ export default {
if (annotation.metadata.toolName === 'Length') { if (annotation.metadata.toolName === 'Length') {
const value = annotation.data.l const value = annotation.data.l
if (value) { if (value) {
let cachedStats = Object.keys(annotation.data.cachedStats) const cachedStats = Object.keys(annotation.data.cachedStats)
let ps = value / annotation.data.cachedStats[cachedStats[0]].length const ps = value / annotation.data.cachedStats[cachedStats[0]].length
annotation.data.ps = ps annotation.data.ps = ps
this.$emit('setPS', {NoneDicomFileId: fileList[fileIndex].Id,Path: fileList[fileIndex].Path, PS: ps}) this.$emit('setPS', { NoneDicomFileId: fileList[fileIndex].Id, Path: fileList[fileIndex].Path, PS: ps })
} }
this.setToolsPassive() this.setToolsPassive()
} }
@ -928,7 +926,7 @@ export default {
this.setToolsPassive() this.setToolsPassive()
return return
} }
const params = { const params = {
id: '', id: '',
visitTaskId: this.viewportInfos[i].taskInfo.VisitTaskId, visitTaskId: this.viewportInfos[i].taskInfo.VisitTaskId,
@ -939,7 +937,7 @@ export default {
} }
const res = await addNoneDicomMark(params) const res = await addNoneDicomMark(params)
annotation.annotationId = res.Result annotation.annotationId = res.Result
const renderingEngine = getRenderingEngine(renderingEngineId) const renderingEngine = getRenderingEngine(renderingEngineId)
const viewport = renderingEngine.getViewport(`canvas-${this.activeCanvasIndex}`) const viewport = renderingEngine.getViewport(`canvas-${this.activeCanvasIndex}`)
viewport.render() viewport.render()
@ -947,18 +945,18 @@ export default {
// this.$message.success(this.$t('common:message:savedSuccessfully')) // this.$message.success(this.$t('common:message:savedSuccessfully'))
}, },
async saveForm() { async saveForm() {
let validate = await this.$refs.lengthForm.validate() const validate = await this.$refs.lengthForm.validate()
if (!validate) return if (!validate) return
let value = this.form.length const value = this.form.length
let annotation = this.form.annotationObj.annotation const annotation = this.form.annotationObj.annotation
let fileList = this.form.annotationObj.fileList const fileList = this.form.annotationObj.fileList
let fileIndex = this.form.annotationObj.fileIndex const fileIndex = this.form.annotationObj.fileIndex
if (value) { if (value) {
annotation.data.l = parseFloat(value) annotation.data.l = parseFloat(value)
let cachedStats = Object.keys(annotation.data.cachedStats) const cachedStats = Object.keys(annotation.data.cachedStats)
let ps = parseFloat(value) / annotation.data.cachedStats[cachedStats[0]].length const ps = parseFloat(value) / annotation.data.cachedStats[cachedStats[0]].length
annotation.data.ps = ps annotation.data.ps = ps
this.$emit('setPS', {NoneDicomFileId: fileList[fileIndex].Id,Path: fileList[fileIndex].Path, PS: ps}) this.$emit('setPS', { NoneDicomFileId: fileList[fileIndex].Id, Path: fileList[fileIndex].Path, PS: ps })
} else { } else {
cornerstoneTools.annotation.state.removeAnnotation(annotation.annotationUID) cornerstoneTools.annotation.state.removeAnnotation(annotation.annotationUID)
return return
@ -973,7 +971,7 @@ export default {
} }
const res = await addNoneDicomMark(params) const res = await addNoneDicomMark(params)
annotation.annotationId = res.Result annotation.annotationId = res.Result
const renderingEngine = getRenderingEngine(renderingEngineId) const renderingEngine = getRenderingEngine(renderingEngineId)
const viewport = renderingEngine.getViewport(`canvas-${this.activeCanvasIndex}`) const viewport = renderingEngine.getViewport(`canvas-${this.activeCanvasIndex}`)
viewport.render() viewport.render()
@ -994,53 +992,53 @@ export default {
textLines.push(`L: ${parseFloat(data.l).toFixed(this.digitPlaces)} mm`) textLines.push(`L: ${parseFloat(data.l).toFixed(this.digitPlaces)} mm`)
textLines.push(`PS: ${parseFloat(data.l / length).toFixed(3)} mm/px`) textLines.push(`PS: ${parseFloat(data.l / length).toFixed(3)} mm/px`)
} }
return textLines; return textLines
}, },
getPlanarFreehandROIToolTextLines(data, targetId) { getPlanarFreehandROIToolTextLines(data, targetId) {
const cachedVolumeStats = data.cachedStats[targetId]; const cachedVolumeStats = data.cachedStats[targetId]
const { const {
area, area,
mean, mean,
stdDev, stdDev,
length, // length,
perimeter, perimeter,
max, max,
isEmptyArea, isEmptyArea,
unit, unit,
areaUnit, areaUnit,
modalityUnit, modalityUnit
} = cachedVolumeStats || {}; } = cachedVolumeStats || {}
const textLines = []; const textLines = []
let ps = null let ps = null
let path = targetId.split(`web:${this.OSSclientConfig.basePath}`)[1] const path = targetId.split(`web:${this.OSSclientConfig.basePath}`)[1]
let i = this.psArr.findIndex(i=>i.Path === path) const i = this.psArr.findIndex(i => i.Path === path)
if (i > -1 && this.psArr[i].PS) { if (i > -1 && this.psArr[i].PS) {
ps = parseFloat(this.psArr[i].PS).toFixed(3) ps = parseFloat(this.psArr[i].PS).toFixed(3)
} }
if (area) { if (area) {
const areaLine = isEmptyArea const areaLine = isEmptyArea
? `Area: Oblique not supported` ? `Area: Oblique not supported`
: `Area: ${ps ? parseFloat(area * ps * ps).toFixed(this.digitPlaces) : parseFloat(area).toFixed(this.digitPlaces)} ${ps ? 'mm' + '\xb2' : areaUnit}`; : `Area: ${ps ? parseFloat(area * ps * ps).toFixed(this.digitPlaces) : parseFloat(area).toFixed(this.digitPlaces)} ${ps ? 'mm' + '\xb2' : areaUnit}`
textLines.push(areaLine); textLines.push(areaLine)
} }
if (mean) { if (mean) {
textLines.push(`Mean: ${parseFloat(mean).toFixed(this.digitPlaces)} ${modalityUnit}`); textLines.push(`Mean: ${parseFloat(mean).toFixed(this.digitPlaces)} ${modalityUnit}`)
} }
if (Number.isFinite(max)) { if (Number.isFinite(max)) {
textLines.push(`Max: ${csUtils.roundNumber(max)} ${modalityUnit}`); textLines.push(`Max: ${csUtils.roundNumber(max)} ${modalityUnit}`)
} }
if (stdDev) { if (stdDev) {
textLines.push(`Std Dev: ${csUtils.roundNumber(stdDev)} ${modalityUnit}`); textLines.push(`Std Dev: ${csUtils.roundNumber(stdDev)} ${modalityUnit}`)
} }
if (perimeter) { if (perimeter) {
if (ps) { if (ps) {
textLines.push(`Perimeter: ${ parseFloat(perimeter * ps).toFixed(this.digitPlaces) } mm`); textLines.push(`Perimeter: ${parseFloat(perimeter * ps).toFixed(this.digitPlaces)} mm`)
} else { } else {
textLines.push(`Perimeter: ${ parseFloat(perimeter).toFixed(this.digitPlaces) } ${unit}`); textLines.push(`Perimeter: ${parseFloat(perimeter).toFixed(this.digitPlaces)} ${unit}`)
} }
} }
@ -1049,34 +1047,34 @@ export default {
// textLines.push(`${csUtils.roundNumber(length)} ${unit}`); // textLines.push(`${csUtils.roundNumber(length)} ${unit}`);
// } // }
return textLines; return textLines
}, },
getRectangleROIToolTextLines(data, targetId) { getRectangleROIToolTextLines(data, targetId) {
const cachedVolumeStats = data.cachedStats[targetId]; const cachedVolumeStats = data.cachedStats[targetId]
const { area, mean, max, stdDev, areaUnit, modalityUnit } = cachedVolumeStats; const { area, mean, max, stdDev, areaUnit, modalityUnit } = cachedVolumeStats
if (mean === undefined) { if (mean === undefined) {
return; return
} }
const textLines = []; const textLines = []
let ps = null let ps = null
let path = targetId.split(`web:${this.OSSclientConfig.basePath}`)[1] const path = targetId.split(`web:${this.OSSclientConfig.basePath}`)[1]
let i = this.psArr.findIndex(i=>i.Path === path) const i = this.psArr.findIndex(i => i.Path === path)
if (i > -1 && this.psArr[i].PS) { if (i > -1 && this.psArr[i].PS) {
ps = parseFloat(this.psArr[i].PS).toFixed(3) ps = parseFloat(this.psArr[i].PS).toFixed(3)
} }
if (ps) { if (ps) {
textLines.push(`Area: ${parseFloat(area * ps * ps).toFixed(this.digitPlaces)} ${'mm' + '\xb2'}`); textLines.push(`Area: ${parseFloat(area * ps * ps).toFixed(this.digitPlaces)} ${'mm' + '\xb2'}`)
} else { } else {
textLines.push(`Area: ${parseFloat(area).toFixed(this.digitPlaces)} ${areaUnit}`); textLines.push(`Area: ${parseFloat(area).toFixed(this.digitPlaces)} ${areaUnit}`)
} }
textLines.push(`Mean: ${csUtils.roundNumber(mean)} ${modalityUnit}`);
textLines.push(`Max: ${csUtils.roundNumber(max)} ${modalityUnit}`);
textLines.push(`Std Dev: ${csUtils.roundNumber(stdDev)} ${modalityUnit}`);
return textLines; textLines.push(`Mean: ${csUtils.roundNumber(mean)} ${modalityUnit}`)
textLines.push(`Max: ${csUtils.roundNumber(max)} ${modalityUnit}`)
textLines.push(`Std Dev: ${csUtils.roundNumber(stdDev)} ${modalityUnit}`)
return textLines
}, },
debounce(callback, delay) { debounce(callback, delay) {
let timerId let timerId
@ -1147,8 +1145,7 @@ export default {
viewport.setImageIdIndex(sliceIdx) viewport.setImageIdIndex(sliceIdx)
viewport.render() viewport.render()
// } // }
// this.$emit('toggleImage', { taskId: this.viewportInfos[i].taskInfo.VisitTaskId, studyId: this.viewportInfos[i].studyId, imageIndex: sliceIdx }) // this.$emit('toggleImage', { taskId: this.viewportInfos[i].taskInfo.VisitTaskId, studyId: this.viewportInfos[i].studyId, imageIndex: sliceIdx })
}, },
sliderMouseleave(e, index) { sliderMouseleave(e, index) {
const i = this.viewportInfos.findIndex(i => i.index === index) const i = this.viewportInfos.findIndex(i => i.index === index)

View File

@ -51,7 +51,7 @@
<file-viewer <file-viewer
ref="fileViewer" ref="fileViewer"
:related-study-info="relatedStudyInfo" :related-study-info="relatedStudyInfo"
:psArr="psArr" :ps-arr="psArr"
@toggleTaskByViewer="toggleTaskByViewer" @toggleTaskByViewer="toggleTaskByViewer"
@toggleTask="toggleTask" @toggleTask="toggleTask"
@toggleImage="toggleImage" @toggleImage="toggleImage"
@ -178,7 +178,6 @@ export default {
this.taskInfo = JSON.parse(localStorage.getItem('taskInfo')) this.taskInfo = JSON.parse(localStorage.getItem('taskInfo'))
this.trialId = this.$route.query.trialId this.trialId = this.$route.query.trialId
this.getRelatedTask() this.getRelatedTask()
}, },
methods: { methods: {
// //
@ -252,12 +251,12 @@ export default {
visitTaskId: visitTaskId visitTaskId: visitTaskId
} }
const res = await getNoneDicomMarkListOutDto(params) const res = await getNoneDicomMarkListOutDto(params)
let arr = res.Result.NoneDicomMarkList.map(i=>{ const arr = res.Result.NoneDicomMarkList.map(i => {
if (typeof i.MeasureData === 'string') { if (typeof i.MeasureData === 'string') {
i.MeasureData = JSON.parse(i.MeasureData) i.MeasureData = JSON.parse(i.MeasureData)
} }
if (i.MeasureData.metadata.toolName === 'Length' && this.psArr.findIndex(p=>p.NoneDicomFileId === i.NoneDicomFileId) === -1) { if (i.MeasureData.metadata.toolName === 'Length' && this.psArr.findIndex(p => p.NoneDicomFileId === i.NoneDicomFileId) === -1) {
this.psArr.push({NoneDicomFileId: i.NoneDicomFileId, Path: i.Path, PS: i.MeasureData.data.ps}) this.psArr.push({ NoneDicomFileId: i.NoneDicomFileId, Path: i.Path, PS: i.MeasureData.data.ps })
} }
return i return i
}) })
@ -272,7 +271,7 @@ export default {
}) })
}, },
setPS(obj) { setPS(obj) {
let i = this.psArr.findIndex(p=>p.NoneDicomFileId === obj.NoneDicomFileId) const i = this.psArr.findIndex(p => p.NoneDicomFileId === obj.NoneDicomFileId)
if (i > -1) { if (i > -1) {
this.psArr[i].PS = obj.PS this.psArr[i].PS = obj.PS
} else { } else {
@ -313,7 +312,7 @@ export default {
toggleImage(obj) { toggleImage(obj) {
this.$refs[obj.taskId][0].activeImage(obj) this.$refs[obj.taskId][0].activeImage(obj)
}, },
previewCD(taskId) { previewCD(taskId) {
this.isClinicalDataFullscreen = false this.isClinicalDataFullscreen = false
this.dialogVisible = true this.dialogVisible = true