suv测量工具优化
parent
ef732066f4
commit
f6eab06c78
|
@ -690,46 +690,46 @@ export default {
|
|||
})
|
||||
|
||||
const debouncedCallback = this.debounce((e) => {
|
||||
const { annotation } = e.detail
|
||||
const { cachedStats } = annotation.data
|
||||
var isNotValidAnnotationNum = 0
|
||||
for (const volumeId in cachedStats) {
|
||||
var statObj = cachedStats[volumeId]
|
||||
var arr = Object.keys(statObj)
|
||||
if (arr.length < 2) {
|
||||
++isNotValidAnnotationNum
|
||||
}
|
||||
}
|
||||
if (isNotValidAnnotationNum === 0) {
|
||||
// const { annotation } = e.detail
|
||||
this.onAnnotationModified(e)
|
||||
} else {
|
||||
// console.log('异常标记:', annotation)
|
||||
// const { remark } = annotation.data
|
||||
// if (remark === 'Liver' || remark === 'Mediastinum') {
|
||||
// this.$refs['questions'].setOutsideMeasuredData(annotation)
|
||||
// } else {
|
||||
// this.$refs['tableQuestions'].setOutsideMeasuredData(annotation)
|
||||
// const { cachedStats } = annotation.data
|
||||
// var isNotValidAnnotationNum = 0
|
||||
// for (const volumeId in cachedStats) {
|
||||
// var statObj = cachedStats[volumeId]
|
||||
// var arr = Object.keys(statObj)
|
||||
// if (arr.length < 2) {
|
||||
// ++isNotValidAnnotationNum
|
||||
// }
|
||||
// }
|
||||
// if (!annotation.isHandleOutsideImage) {
|
||||
// this.onAnnotationModified(e)
|
||||
// } else {
|
||||
// // console.log('异常标记:', annotation)
|
||||
// // const { remark } = annotation.data
|
||||
// // if (remark === 'Liver' || remark === 'Mediastinum') {
|
||||
// // this.$refs['questions'].setOutsideMeasuredData(annotation)
|
||||
// // } else {
|
||||
// // this.$refs['tableQuestions'].setOutsideMeasuredData(annotation)
|
||||
// // }
|
||||
// // 移除标记
|
||||
// // this.removeAnnotation({ otherMeasureData: annotation })
|
||||
// // const { remark } = annotation.data
|
||||
// // // 清除病灶上的标记信息
|
||||
// // if (remark === 'Liver' || remark === 'Mediastinum') {
|
||||
// // this.$refs['questions'].clearMeasuredData(remark)
|
||||
// // // 激活工具
|
||||
// // this.setNonTargetMeasurementStatus({ status: true, toolName: 'CircleROI' })
|
||||
// // } else {
|
||||
// // this.$refs['tableQuestions'].clearMeasuredData()
|
||||
// // // 激活工具
|
||||
// // this.setBasicToolActive('CircleROI')
|
||||
// // }
|
||||
// }
|
||||
// 移除标记
|
||||
this.removeAnnotation({ otherMeasureData: annotation })
|
||||
const { remark } = annotation.data
|
||||
// 清除病灶上的标记信息
|
||||
if (remark === 'Liver' || remark === 'Mediastinum') {
|
||||
this.$refs['questions'].clearMeasuredData(remark)
|
||||
// 激活工具
|
||||
this.setNonTargetMeasurementStatus({ status: true, toolName: 'CircleROI' })
|
||||
} else {
|
||||
this.$refs['tableQuestions'].clearMeasuredData()
|
||||
// 激活工具
|
||||
this.setBasicToolActive('CircleROI')
|
||||
}
|
||||
}
|
||||
}, 120)
|
||||
eventTarget.addEventListener(cornerstoneTools.Enums.Events.ANNOTATION_MODIFIED, (e) => {
|
||||
debouncedCallback(e)
|
||||
})
|
||||
eventTarget.addEventListener(cornerstoneTools.Enums.Events.ANNOTATION_SELECTION_CHANGE, (e) => {
|
||||
console.log(e)
|
||||
const { detail } = e
|
||||
const { selection } = detail
|
||||
if (selection && selection.length > 0) {
|
||||
|
@ -833,7 +833,6 @@ export default {
|
|||
if (this.isNonTargetMeasurement || annotation.data.remark === 'Liver' || annotation.data.remark === 'Mediastinum') {
|
||||
this.$refs['questions'].setMeasuredData(measureData)
|
||||
} else {
|
||||
console.log('onAnnotationAdded')
|
||||
this.$refs['tableQuestions'] && this.$refs['tableQuestions'].setMeasuredData(measureData)
|
||||
}
|
||||
|
||||
|
|
|
@ -234,7 +234,7 @@
|
|||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { uploadReadingAnswerImage } from '@/api/trials'
|
||||
// import { uploadReadingAnswerImage } from '@/api/trials'
|
||||
import { mapGetters } from 'vuex'
|
||||
export default {
|
||||
name: 'QuestionItem',
|
||||
|
|
|
@ -60,7 +60,8 @@ export default {
|
|||
suvmaxId: '',
|
||||
questionFormChangeState: false,
|
||||
questionFormChangeNum: 0,
|
||||
isInsideVolume: true
|
||||
lungIsInsideVolume: true,
|
||||
liverIsInsideVolume: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
@ -196,7 +197,7 @@ export default {
|
|||
handleSave() {
|
||||
this.$refs['questions'].validate((valid) => {
|
||||
if (!valid) return
|
||||
if (!this.isInsideVolume) {
|
||||
if (!this.lungIsInsideVolume || !this.liverIsInsideVolume) {
|
||||
this.$alert('当前标记在图像外,不允许保存!', '提示', {
|
||||
callback: action => {
|
||||
this.$message({
|
||||
|
@ -308,7 +309,9 @@ export default {
|
|||
FusionEvent.$emit('imageLocation', { otherMeasureData: otherMeasureData })
|
||||
},
|
||||
setMeasuredData(measurement) {
|
||||
this.isInsideVolume = true
|
||||
if (measurement.data.isHandleOutsideImage) {
|
||||
this.setOutsideMeasuredData(measurement)
|
||||
} else {
|
||||
var idx = -1
|
||||
if (this.currentQsId) {
|
||||
// 新增
|
||||
|
@ -321,6 +324,7 @@ export default {
|
|||
if (idx === -1) return
|
||||
var obj = this.measurements[idx]
|
||||
var remark = obj.QuestionType === 51 ? 'Liver' : obj.QuestionType === 52 ? 'Mediastinum' : ''
|
||||
obj.QuestionType === 51 ? this.liverIsInsideVolume = true : obj.QuestionType === 52 ? this.lungIsInsideVolume = true : ''
|
||||
measurement.data.data.remark = remark
|
||||
this.measurements[idx].OtherMeasureData = measurement.data
|
||||
this.measurements[idx].OtherMarkTool = measurement.data.metadata.toolName
|
||||
|
@ -342,9 +346,14 @@ export default {
|
|||
}
|
||||
FusionEvent.$emit('addOrUpdateAnnotations', { data })
|
||||
this.questionFormChangeState = true
|
||||
}
|
||||
},
|
||||
setOutsideMeasuredData(measurement) {
|
||||
this.isInsideVolume = false
|
||||
console.log('setOutsideMeasuredData: ', measurement)
|
||||
if ((measurement.data.remark === 'Liver' && this.liverIsInsideVolume === false) || (measurement.data.remark === 'Mediastinum' && this.lungIsInsideVolume === false)) {
|
||||
return
|
||||
}
|
||||
|
||||
var idx = -1
|
||||
if (this.currentQsId) {
|
||||
// 新增
|
||||
|
@ -352,24 +361,24 @@ export default {
|
|||
this.currentQsId = ''
|
||||
} else {
|
||||
// 编辑
|
||||
idx = this.measurements.findIndex(i => i.OrderMarkName === measurement.data.remark)
|
||||
idx = this.measurements.findIndex(i => i.OrderMarkName === measurement.data.data.remark)
|
||||
}
|
||||
if (idx === -1) return
|
||||
var obj = this.measurements[idx]
|
||||
var remark = obj.QuestionType === 51 ? 'Liver' : obj.QuestionType === 52 ? 'Mediastinum' : ''
|
||||
measurement.data.remark = remark
|
||||
this.measurements[idx].OtherMeasureData = measurement
|
||||
this.measurements[idx].OtherMarkTool = measurement.metadata.toolName
|
||||
obj.QuestionType === 51 ? this.liverIsInsideVolume = false : obj.QuestionType === 52 ? this.lungIsInsideVolume = false : ''
|
||||
measurement.data.data.remark = remark
|
||||
this.measurements[idx].OtherMeasureData = measurement.data
|
||||
this.measurements[idx].OtherMarkTool = measurement.data.metadata.toolName
|
||||
|
||||
// 添加标记
|
||||
var data = {
|
||||
OtherMeasureData: measurement,
|
||||
OtherMeasureData: measurement.data,
|
||||
QuestionId: obj.QuestionId,
|
||||
VisitTaskId: this.visitTaskId,
|
||||
OrderMarkName: remark
|
||||
}
|
||||
if (measurement.metadata.toolName === 'CircleROI') {
|
||||
// const suvMax = measurement.suvMax
|
||||
if (measurement.type === 'CircleROI') {
|
||||
this.$set(this.questionForm, obj.QuestionId, null)
|
||||
var pet5PS = this.setpet5PS()
|
||||
this.questionForm[this.pet5PSId] = pet5PS
|
||||
|
|
|
@ -521,9 +521,12 @@ export default {
|
|||
this.$emit('resetQuestions', { isLymphLesion, lesionPart, lesionOrgan, suvMax, saveTypeEnum: this.questionForm.saveTypeEnum, rowIndex: this.rowIndex, questionId: this.parentQsId, anwsers: this.questionForm })
|
||||
},
|
||||
setMeasureData(measureData, isInit = false) {
|
||||
console.log('setMeasureData')
|
||||
this.isInsideVolume = true
|
||||
return new Promise(resolve => {
|
||||
if (measureData.data.isHandleOutsideImage) {
|
||||
this.setOutsideMeasuredData(measureData)
|
||||
} else {
|
||||
this.isInsideVolume = true
|
||||
|
||||
if (measureData) {
|
||||
// 获取SUVmax(20)
|
||||
var SUVmax = measureData.suvMax ? measureData.suvMax : null
|
||||
|
@ -608,10 +611,14 @@ export default {
|
|||
this.organList = []
|
||||
this.getOrganInfoList()
|
||||
}
|
||||
}
|
||||
resolve()
|
||||
})
|
||||
},
|
||||
setOutsideMeasuredData(measureData) {
|
||||
if (this.isInsideVolume === false) {
|
||||
return
|
||||
}
|
||||
this.isInsideVolume = false
|
||||
var suvObj = this.questions.find(i => i.QuestionMark === 20)
|
||||
this.$set(this.questionForm, suvObj.Id, '')
|
||||
|
@ -627,7 +634,6 @@ export default {
|
|||
const lesionOrgan = this.getQuestionVal(6)
|
||||
var suvMax = this.getQuestionVal(20)
|
||||
this.$emit('resetQuestions', { isLymphLesion: isLymph, lesionPart, lesionOrgan, suvMax, saveTypeEnum: this.questionForm.saveTypeEnum, rowIndex: this.rowIndex, questionId: this.parentQsId, anwsers: this.questionForm })
|
||||
this.toolType = measureData.type
|
||||
if (this.questionForm.MeasureData) {
|
||||
this.organList = []
|
||||
this.getOrganInfoList()
|
||||
|
@ -742,7 +748,6 @@ export default {
|
|||
}
|
||||
// suv测量值可以测量为0,但不能与病灶、肝脏、纵隔血池绑定。
|
||||
if (this.questionForm.OtherMeasureData) {
|
||||
console.log(this.questionForm.OtherMeasureData)
|
||||
var suvmax = this.getQuestionVal(20)
|
||||
if (suvmax === 0) {
|
||||
this.$confirm(this.$t('当前病灶suv测量值为0,不允许保存!'), {
|
||||
|
|
|
@ -520,7 +520,6 @@ export default {
|
|||
return
|
||||
},
|
||||
getUnSaveTarget() {
|
||||
console.log('getUnSaveTarget')
|
||||
this.unSaveTargets = []
|
||||
this.tableQuestions.map(item => {
|
||||
if (item.TableQuestions && item.TableQuestions.Answers) {
|
||||
|
@ -532,7 +531,6 @@ export default {
|
|||
})
|
||||
}
|
||||
})
|
||||
// console.log(this.unSaveTargets)
|
||||
return this.unSaveTargets
|
||||
},
|
||||
getAllUnSaveLesions() {
|
||||
|
|
|
@ -18,7 +18,7 @@ const {
|
|||
} = cornerstoneTools
|
||||
// const { getWorldWidthAndHeightFromTwoPoints } = utilities.planar
|
||||
// const { roundNumber } = utilities
|
||||
const { hideElementCursor } = cursors.elementCursor
|
||||
const { hideElementCursor,resetElementCursor } = cursors.elementCursor
|
||||
const { getAnnotations,addAnnotation } = annotation.state
|
||||
const { isAnnotationVisible } = annotation.visibility
|
||||
const { isAnnotationLocked } = annotation.locking
|
||||
|
@ -428,7 +428,6 @@ class CircleROITool extends cornerstoneTools.CircleROITool {
|
|||
enabledElement,
|
||||
modalityUnitOptions
|
||||
) => {
|
||||
console.log('_calculateCachedStats')
|
||||
const data = annotation.data
|
||||
const { viewportId, renderingEngineId } = enabledElement
|
||||
|
||||
|
@ -549,12 +548,15 @@ class CircleROITool extends cornerstoneTools.CircleROITool {
|
|||
perimeter: (2 * Math.PI * (worldWidth / 2)) / scale,
|
||||
modalityUnit
|
||||
}
|
||||
annotation.isHandleOutsideImage = false
|
||||
} else {
|
||||
this.isHandleOutsideImage = false
|
||||
this.isHandleOutsideImage = true
|
||||
|
||||
cachedStats[targetId] = {
|
||||
Modality: metadata.Modality
|
||||
Modality: metadata.Modality,
|
||||
areaUnit: getCalibratedAreaUnits(null, image)
|
||||
}
|
||||
annotation.isHandleOutsideImage = true
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue