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.$refs['measurementList'].modifyMeasuredData(data)
this.activeTool = '' this.activeTool = ''
}, },
saveImage() { async saveImage() {
this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].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) { setDicomCanvasWwwc(v) {

View File

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

View File

@ -232,7 +232,9 @@ export default {
methods: { methods: {
handleVolumeNewImage(e) { handleVolumeNewImage(e) {
const { imageIndex } = e.detail 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) renderingEngine = getRenderingEngine(this.renderingEngineId)
viewport = renderingEngine.getViewport(this.viewportId) viewport = renderingEngine.getViewport(this.viewportId)