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

@ -226,7 +226,7 @@
: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>
@ -318,7 +318,7 @@ export default {
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 = [
{ {
@ -467,7 +466,6 @@ export default {
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}`
const toolGroup = ToolGroupManager.createToolGroup(toolGroupId) const toolGroup = ToolGroupManager.createToolGroup(toolGroupId)
@ -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 = ''
// //
@ -879,8 +877,8 @@ 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 })
} }
@ -947,16 +945,16 @@ 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 {
@ -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(`Mean: ${csUtils.roundNumber(mean)} ${modalityUnit}`)
textLines.push(`Max: ${csUtils.roundNumber(max)} ${modalityUnit}`); textLines.push(`Max: ${csUtils.roundNumber(max)} ${modalityUnit}`)
textLines.push(`Std Dev: ${csUtils.roundNumber(stdDev)} ${modalityUnit}`); textLines.push(`Std Dev: ${csUtils.roundNumber(stdDev)} ${modalityUnit}`)
return textLines; return textLines
}, },
debounce(callback, delay) { debounce(callback, delay) {
let timerId let timerId
@ -1148,7 +1146,6 @@ export default {
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,7 +251,7 @@ 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)
} }
@ -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 {