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