wangxiaoshuang 2024-03-28 08:55:13 +08:00
commit 0343ba6043
3 changed files with 42 additions and 19 deletions

View File

@ -1866,8 +1866,23 @@ export default {
this.$refs['measurementList'].modifyMeasuredData(data)
this.activeTool = ''
},
saveImage() {
this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].saveImage()
async saveImage() {
// this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].saveImage()
// canvasCanvas
const divForDownloadViewport = document.querySelector(
`div[data-canvas-uid="dicomCanvas${this.currentDicomCanvasIndex}"]`
)
var canvas = await html2canvas(divForDownloadViewport)
let oImg = new Image()
oImg = canvas.toDataURL('image/png', 1)//
var oA = document.createElement('a')
var subjectCode = this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].subjectCode
var taskBlindName = this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].stack.taskBlindName
oA.download = `${subjectCode}_${taskBlindName}`// ''
oA.href = oImg
document.body.appendChild(oA)
oA.click()
oA.remove() //
},
// /
setDicomCanvasWwwc(v) {

View File

@ -528,6 +528,7 @@ export default {
activeCanvasWW: null,
activeCanvasWC: null,
fusion: { visible: false } //
// initFirstAnnotation:false
}
},
computed: {
@ -691,9 +692,9 @@ export default {
this.setUpToolGroups()
this.setUpSynchronizers()
this.$refs['CT_AXIAL'].scroll(0)
this.$refs['PT_AXIAL'].scroll(0)
this.$refs['FUSION_AXIAL'].scroll(0)
// this.$refs['CT_AXIAL'].scroll(0)
// this.$refs['PT_AXIAL'].scroll(0)
// this.$refs['FUSION_AXIAL'].scroll(0)
const viewport = renderingEngine.getViewport('CT_AXIAL')
if (viewport) {
this.defaultCamera = viewport.getCamera()
@ -709,18 +710,20 @@ export default {
}
})
eventTarget.addEventListener(cornerstoneTools.Enums.Events.ANNOTATION_ADDED, (e) => {
console.log('ANNOTATION_ADDED')
this.onAnnotationAdded(e)
})
const debouncedCallback = this.debounce((e) => {
const { annotation } = e.detail
const { remark } = annotation.data
var idx = this.initAnnotations.findIndex(i => i.orderMark === remark)
if (this.initAnnotations.length > 0 && idx > -1 && this.initAnnotations[idx].orderMark === remark && !this.initAnnotations[idx].isInit) {
this.initAnnotations[idx].isInit = true
} else {
this.onAnnotationModified(e)
}
this.onAnnotationModified(e)
// const { annotation } = e.detail
// const { remark } = annotation.data
// var idx = this.initAnnotations.findIndex(i => i.orderMark === remark)
// if (this.initAnnotations.length > 0 && idx > -1 && this.initAnnotations[idx].orderMark === remark && !this.initAnnotations[idx].isInit) {
// this.initAnnotations[idx].isInit = true
// } else {
// this.onAnnotationModified(e)
// }
// const { cachedStats } = annotation.data
// var isNotValidAnnotationNum = 0
// for (const volumeId in cachedStats) {
@ -756,6 +759,7 @@ export default {
// }
}, 120)
eventTarget.addEventListener(cornerstoneTools.Enums.Events.ANNOTATION_MODIFIED, (e) => {
console.log('ANNOTATION_MODIFIED')
debouncedCallback(e)
})
eventTarget.addEventListener(cornerstoneTools.Enums.Events.ANNOTATION_SELECTION_CHANGE, (e) => {
@ -1996,12 +2000,14 @@ export default {
if (index > -1) {
viewportId = 'PT_AXIAL'
this.$refs[viewportId].scroll(index)
} else {
index = this.ctSeries.instanceList.findIndex(i => i === instanceId)
if (index > -1) {
viewportId = 'CT_AXIAL'
this.$refs[viewportId].scroll(index)
}
}
index = this.ctSeries.instanceList.findIndex(i => i === instanceId)
if (index > -1) {
viewportId = 'CT_AXIAL'
this.$refs[viewportId].scroll(index)
}
resolve()
})
},

View File

@ -232,7 +232,9 @@ export default {
methods: {
handleVolumeNewImage(e) {
const { imageIndex } = e.detail
this.seriesInfo.imageIdIndex = imageIndex
if (this.viewportId === e.detail.viewportId && this.index !== 4) {
this.seriesInfo.imageIdIndex = imageIndex
}
renderingEngine = getRenderingEngine(this.renderingEngineId)
viewport = renderingEngine.getViewport(this.viewportId)