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"
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-input v-model="form.length" type="number">
<template slot="append">mm</template>
@ -318,7 +318,7 @@ export default {
length: [
{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' },
{ pattern: /^\d+$/, message: this.$t('trials:noneDicom:message:msg3'), trigger: ['blur', 'change'] }
],
]
}
}
},
@ -391,7 +391,7 @@ export default {
isMove: false,
height: 0
}))
let digitPlaces = Number(localStorage.getItem('digitPlaces'))
const digitPlaces = Number(localStorage.getItem('digitPlaces'))
this.digitPlaces = digitPlaces === -1 ? this.digitPlaces : digitPlaces
this.initLoader()
window.addEventListener('message', this.handleIframeMessage)
@ -429,7 +429,6 @@ export default {
element.oncontextmenu = (e) => e.preventDefault()
resizeObserver.observe(element)
element.addEventListener('CORNERSTONE_STACK_NEW_IMAGE', this.stackNewImage)
})
const viewportInputArray = [
{
@ -467,7 +466,6 @@ export default {
cornerstoneTools.addTool(EraserTool)
cornerstoneTools.addTool(LengthTool)
viewportIds.forEach((viewportId, i) => {
const toolGroupId = `canvas-${i}`
const toolGroup = ToolGroupManager.createToolGroup(toolGroupId)
@ -790,9 +788,9 @@ export default {
if (toolName === 'Length') {
const renderingEngine = getRenderingEngine(renderingEngineId)
const viewport = renderingEngine.getViewport(`canvas-${this.activeCanvasIndex}`)
let imageId = viewport.csImage.imageId
let annotations = cornerstoneTools.annotation.state.getAllAnnotations()
let idx = annotations.findIndex(i=>i.metadata.referencedImageId === imageId && i.metadata.toolName === 'Length')
const imageId = viewport.csImage.imageId
const annotations = cornerstoneTools.annotation.state.getAllAnnotations()
const idx = annotations.findIndex(i => i.metadata.referencedImageId === imageId && i.metadata.toolName === 'Length')
if (idx > -1) {
this.activeTool = ''
//
@ -879,8 +877,8 @@ export default {
if (annotation.metadata.toolName === 'Length') {
const value = annotation.data.l
if (value) {
let cachedStats = Object.keys(annotation.data.cachedStats)
let ps = value / annotation.data.cachedStats[cachedStats[0]].length
const cachedStats = Object.keys(annotation.data.cachedStats)
const ps = value / annotation.data.cachedStats[cachedStats[0]].length
annotation.data.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'))
},
async saveForm() {
let validate = await this.$refs.lengthForm.validate()
const validate = await this.$refs.lengthForm.validate()
if (!validate) return
let value = this.form.length
let annotation = this.form.annotationObj.annotation
let fileList = this.form.annotationObj.fileList
let fileIndex = this.form.annotationObj.fileIndex
const value = this.form.length
const annotation = this.form.annotationObj.annotation
const fileList = this.form.annotationObj.fileList
const fileIndex = this.form.annotationObj.fileIndex
if (value) {
annotation.data.l = parseFloat(value)
let cachedStats = Object.keys(annotation.data.cachedStats)
let ps = parseFloat(value) / annotation.data.cachedStats[cachedStats[0]].length
const cachedStats = Object.keys(annotation.data.cachedStats)
const ps = parseFloat(value) / annotation.data.cachedStats[cachedStats[0]].length
annotation.data.ps = ps
this.$emit('setPS', { NoneDicomFileId: fileList[fileIndex].Id, Path: fileList[fileIndex].Path, PS: ps })
} else {
@ -994,53 +992,53 @@ export default {
textLines.push(`L: ${parseFloat(data.l).toFixed(this.digitPlaces)} mm`)
textLines.push(`PS: ${parseFloat(data.l / length).toFixed(3)} mm/px`)
}
return textLines;
return textLines
},
getPlanarFreehandROIToolTextLines(data, targetId) {
const cachedVolumeStats = data.cachedStats[targetId];
const cachedVolumeStats = data.cachedStats[targetId]
const {
area,
mean,
stdDev,
length,
// length,
perimeter,
max,
isEmptyArea,
unit,
areaUnit,
modalityUnit,
} = cachedVolumeStats || {};
modalityUnit
} = cachedVolumeStats || {}
const textLines = [];
const textLines = []
let ps = null
let path = targetId.split(`web:${this.OSSclientConfig.basePath}`)[1]
let i = this.psArr.findIndex(i=>i.Path === path)
const path = targetId.split(`web:${this.OSSclientConfig.basePath}`)[1]
const i = this.psArr.findIndex(i => i.Path === path)
if (i > -1 && this.psArr[i].PS) {
ps = parseFloat(this.psArr[i].PS).toFixed(3)
}
if (area) {
const areaLine = isEmptyArea
? `Area: Oblique not supported`
: `Area: ${ps ? parseFloat(area * ps * ps).toFixed(this.digitPlaces) : parseFloat(area).toFixed(this.digitPlaces)} ${ps ? 'mm' + '\xb2' : areaUnit}`;
textLines.push(areaLine);
: `Area: ${ps ? parseFloat(area * ps * ps).toFixed(this.digitPlaces) : parseFloat(area).toFixed(this.digitPlaces)} ${ps ? 'mm' + '\xb2' : areaUnit}`
textLines.push(areaLine)
}
if (mean) {
textLines.push(`Mean: ${parseFloat(mean).toFixed(this.digitPlaces)} ${modalityUnit}`);
textLines.push(`Mean: ${parseFloat(mean).toFixed(this.digitPlaces)} ${modalityUnit}`)
}
if (Number.isFinite(max)) {
textLines.push(`Max: ${csUtils.roundNumber(max)} ${modalityUnit}`);
textLines.push(`Max: ${csUtils.roundNumber(max)} ${modalityUnit}`)
}
if (stdDev) {
textLines.push(`Std Dev: ${csUtils.roundNumber(stdDev)} ${modalityUnit}`);
textLines.push(`Std Dev: ${csUtils.roundNumber(stdDev)} ${modalityUnit}`)
}
if (perimeter) {
if (ps) {
textLines.push(`Perimeter: ${ parseFloat(perimeter * ps).toFixed(this.digitPlaces) } mm`);
textLines.push(`Perimeter: ${parseFloat(perimeter * ps).toFixed(this.digitPlaces)} mm`)
} 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}`);
// }
return textLines;
return textLines
},
getRectangleROIToolTextLines(data, targetId) {
const cachedVolumeStats = data.cachedStats[targetId];
const { area, mean, max, stdDev, areaUnit, modalityUnit } = cachedVolumeStats;
const cachedVolumeStats = data.cachedStats[targetId]
const { area, mean, max, stdDev, areaUnit, modalityUnit } = cachedVolumeStats
if (mean === undefined) {
return;
return
}
const textLines = [];
const textLines = []
let ps = null
let path = targetId.split(`web:${this.OSSclientConfig.basePath}`)[1]
let i = this.psArr.findIndex(i=>i.Path === path)
const path = targetId.split(`web:${this.OSSclientConfig.basePath}`)[1]
const i = this.psArr.findIndex(i => i.Path === path)
if (i > -1 && this.psArr[i].PS) {
ps = parseFloat(this.psArr[i].PS).toFixed(3)
}
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 {
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}`);
textLines.push(`Mean: ${csUtils.roundNumber(mean)} ${modalityUnit}`)
textLines.push(`Max: ${csUtils.roundNumber(max)} ${modalityUnit}`)
textLines.push(`Std Dev: ${csUtils.roundNumber(stdDev)} ${modalityUnit}`)
return textLines;
return textLines
},
debounce(callback, delay) {
let timerId
@ -1148,7 +1146,6 @@ export default {
viewport.render()
// }
// this.$emit('toggleImage', { taskId: this.viewportInfos[i].taskInfo.VisitTaskId, studyId: this.viewportInfos[i].studyId, imageIndex: sliceIdx })
},
sliderMouseleave(e, index) {
const i = this.viewportInfos.findIndex(i => i.index === index)

View File

@ -51,7 +51,7 @@
<file-viewer
ref="fileViewer"
:related-study-info="relatedStudyInfo"
:psArr="psArr"
:ps-arr="psArr"
@toggleTaskByViewer="toggleTaskByViewer"
@toggleTask="toggleTask"
@toggleImage="toggleImage"
@ -178,7 +178,6 @@ export default {
this.taskInfo = JSON.parse(localStorage.getItem('taskInfo'))
this.trialId = this.$route.query.trialId
this.getRelatedTask()
},
methods: {
//
@ -252,7 +251,7 @@ export default {
visitTaskId: visitTaskId
}
const res = await getNoneDicomMarkListOutDto(params)
let arr = res.Result.NoneDicomMarkList.map(i=>{
const arr = res.Result.NoneDicomMarkList.map(i => {
if (typeof i.MeasureData === 'string') {
i.MeasureData = JSON.parse(i.MeasureData)
}
@ -272,7 +271,7 @@ export default {
})
},
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) {
this.psArr[i].PS = obj.PS
} else {