mpr查看标记和标记截图问题
parent
ae536a7fc4
commit
09e5bcb3b7
|
|
@ -703,7 +703,7 @@ export default {
|
||||||
},
|
},
|
||||||
immediate: true
|
immediate: true
|
||||||
},
|
},
|
||||||
currentReadingTaskState() { console.log(this.currentReadingTaskState, 'currentReadingTaskState') },
|
// currentReadingTaskState() { console.log(this.currentReadingTaskState, 'currentReadingTaskState') },
|
||||||
activeTaskId: {
|
activeTaskId: {
|
||||||
immediate: true,
|
immediate: true,
|
||||||
handler(id) {
|
handler(id) {
|
||||||
|
|
@ -722,7 +722,7 @@ export default {
|
||||||
this.clipPlaying = false
|
this.clipPlaying = false
|
||||||
this.fps = 15
|
this.fps = 15
|
||||||
}
|
}
|
||||||
if (index === this.cells.length - 1 && series) {
|
if (index === this.cells.length - 1 && series && series.TaskInfo) {
|
||||||
this.lastViewportTaskId = series.TaskInfo.VisitTaskId
|
this.lastViewportTaskId = series.TaskInfo.VisitTaskId
|
||||||
this.currentVisitInfo = series.TaskInfo
|
this.currentVisitInfo = series.TaskInfo
|
||||||
}
|
}
|
||||||
|
|
@ -1047,7 +1047,6 @@ export default {
|
||||||
const element2 = this.$refs['viewport-1'][0].$el
|
const element2 = this.$refs['viewport-1'][0].$el
|
||||||
const element3 = this.$refs['viewport-2'][0].$el
|
const element3 = this.$refs['viewport-2'][0].$el
|
||||||
const element4 = this.$refs['viewport-3'][0].$el
|
const element4 = this.$refs['viewport-3'][0].$el
|
||||||
console.log(Enums.OrientationAxis)
|
|
||||||
let viewportInputArray = [
|
let viewportInputArray = [
|
||||||
{
|
{
|
||||||
viewportId: 'viewport-0',
|
viewportId: 'viewport-0',
|
||||||
|
|
@ -1089,7 +1088,7 @@ export default {
|
||||||
type: ViewportType.ORTHOGRAPHIC,
|
type: ViewportType.ORTHOGRAPHIC,
|
||||||
element: volumeElement2,
|
element: volumeElement2,
|
||||||
defaultOptions: {
|
defaultOptions: {
|
||||||
orientation: Enums.OrientationAxis.CORONAL
|
orientation: Enums.OrientationAxis.SAGITTAL
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -1097,7 +1096,7 @@ export default {
|
||||||
type: ViewportType.ORTHOGRAPHIC,
|
type: ViewportType.ORTHOGRAPHIC,
|
||||||
element: volumeElement3,
|
element: volumeElement3,
|
||||||
defaultOptions: {
|
defaultOptions: {
|
||||||
orientation: Enums.OrientationAxis.SAGITTAL
|
orientation: Enums.OrientationAxis.CORONAL
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
@ -1506,7 +1505,6 @@ export default {
|
||||||
const referencedImageId = annotation.metadata.referencedImageId
|
const referencedImageId = annotation.metadata.referencedImageId
|
||||||
console.log(annotation, 'annotation')
|
console.log(annotation, 'annotation')
|
||||||
const params = this.getInstanceInfo(referencedImageId)
|
const params = this.getInstanceInfo(referencedImageId)
|
||||||
console.log(params, 'params')
|
|
||||||
annotation.visitTaskId = series.TaskInfo.VisitTaskId
|
annotation.visitTaskId = series.TaskInfo.VisitTaskId
|
||||||
annotation.studyId = series.StudyId
|
annotation.studyId = series.StudyId
|
||||||
annotation.seriesId = series.Id
|
annotation.seriesId = series.Id
|
||||||
|
|
@ -2725,20 +2723,31 @@ export default {
|
||||||
const i = this.visitTaskList.findIndex(i => i.VisitTaskId === obj.visitTaskId)
|
const i = this.visitTaskList.findIndex(i => i.VisitTaskId === obj.visitTaskId)
|
||||||
if (i === -1) return
|
if (i === -1) return
|
||||||
const studyList = this.visitTaskList[i].StudyList
|
const studyList = this.visitTaskList[i].StudyList
|
||||||
const series = this.getMarkedSeries(studyList, obj.annotation, true)
|
let series = this.getMarkedSeries(studyList, obj.annotation, true)
|
||||||
if (series) {
|
if (series) {
|
||||||
this.activeViewportIndex = this.cells.length - 1
|
this.activeViewportIndex = this.cells.length - 1
|
||||||
if (obj.annotation.from === 'MPR') {
|
if (obj.annotation.from === 'MPR') {
|
||||||
let res = await this.openMPRViewport(series)
|
|
||||||
let viewPlaneNormal = obj.annotation?.metadata?.viewPlaneNormal.map(i => i == 0 ? 0 : i).join(',')
|
let viewPlaneNormal = obj.annotation?.metadata?.viewPlaneNormal.map(i => i == 0 ? 0 : i).join(',')
|
||||||
if (viewPlaneNormal === '0,0,-1') {
|
if (viewPlaneNormal === '0,0,-1') {
|
||||||
this.activeViewportIndex = 0
|
this.activeViewportIndex = 0
|
||||||
|
series = Object.assign({ orientation: 'AXIAL' }, series)
|
||||||
} else if (viewPlaneNormal === '0,-1,0') {
|
} else if (viewPlaneNormal === '0,-1,0') {
|
||||||
this.activeViewportIndex = 1
|
|
||||||
} else if (viewPlaneNormal === '1,0,0') {
|
|
||||||
this.activeViewportIndex = 2
|
this.activeViewportIndex = 2
|
||||||
|
series = Object.assign({ orientation: 'CORONAL' }, series)
|
||||||
|
} else if (viewPlaneNormal === '1,0,0') {
|
||||||
|
this.activeViewportIndex = 1
|
||||||
|
series = Object.assign({ orientation: 'SAGITTAL' }, series)
|
||||||
}
|
}
|
||||||
|
let res = await this.openMPRViewport(series)
|
||||||
if (!res) return false
|
if (!res) return false
|
||||||
|
} else {
|
||||||
|
if (this.isMPR) {
|
||||||
|
this.isMPR = false
|
||||||
|
this.rows = 1
|
||||||
|
this.cols = 1
|
||||||
|
this.activeViewportIndex = 0
|
||||||
|
// return this.activeSeries(series)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.$refs[`${this.viewportKey}-${this.activeViewportIndex}`][0].setSeriesInfo(series, true)
|
this.$refs[`${this.viewportKey}-${this.activeViewportIndex}`][0].setSeriesInfo(series, true)
|
||||||
this.$refs[series.TaskInfo.VisitTaskId][0].setSeriesActive(series.StudyIndex, series.SeriesIndex)
|
this.$refs[series.TaskInfo.VisitTaskId][0].setSeriesActive(series.StudyIndex, series.SeriesIndex)
|
||||||
|
|
@ -2748,17 +2757,41 @@ export default {
|
||||||
const i = this.visitTaskList.findIndex(i => i.VisitTaskId === obj.visitTaskId)
|
const i = this.visitTaskList.findIndex(i => i.VisitTaskId === obj.visitTaskId)
|
||||||
if (i === -1) return
|
if (i === -1) return
|
||||||
const studyList = this.visitTaskList[i].StudyList
|
const studyList = this.visitTaskList[i].StudyList
|
||||||
const series = this.getMarkedSeries(studyList, obj.annotation, true)
|
let series = this.getMarkedSeries(studyList, obj.annotation, true)
|
||||||
if (series) {
|
if (series) {
|
||||||
this.activeViewportIndex = this.cells.length - 1
|
this.activeViewportIndex = this.cells.length - 1
|
||||||
if (obj.annotation.from === 'MPR') {
|
if (obj.annotation.from === 'MPR') {
|
||||||
let viewPlaneNormal = obj.annotation?.metadata?.viewPlaneNormal.map(i => i == 0 ? 0 : i).join(',')
|
let viewPlaneNormal = obj.annotation?.metadata?.viewPlaneNormal.map(i => i == 0 ? 0 : i).join(',')
|
||||||
if (viewPlaneNormal === '0,0,-1') {
|
if (viewPlaneNormal === '0,0,-1') {
|
||||||
this.activeViewportIndex = 0
|
this.activeViewportIndex = 0
|
||||||
|
series = Object.assign({ orientation: 'AXIAL' }, series)
|
||||||
} else if (viewPlaneNormal === '0,-1,0') {
|
} else if (viewPlaneNormal === '0,-1,0') {
|
||||||
this.activeViewportIndex = 1
|
|
||||||
} else if (viewPlaneNormal === '1,0,0') {
|
|
||||||
this.activeViewportIndex = 2
|
this.activeViewportIndex = 2
|
||||||
|
series = Object.assign({ orientation: 'CORONAL' }, series)
|
||||||
|
} else if (viewPlaneNormal === '1,0,0') {
|
||||||
|
this.activeViewportIndex = 1
|
||||||
|
series = Object.assign({ orientation: 'SAGITTAL' }, series)
|
||||||
|
}
|
||||||
|
let res = await this.openMPRViewport(series)
|
||||||
|
if (!res) {
|
||||||
|
this.$refs[series.TaskInfo.VisitTaskId][0].setSeriesActive(series.StudyIndex, series.SeriesIndex)
|
||||||
|
setTimeout(async () => {
|
||||||
|
const divForDownloadViewport = document.querySelector(
|
||||||
|
`div[data-viewport-uid="${this.viewportKey}-${this.activeViewportIndex}"]`
|
||||||
|
)
|
||||||
|
const canvas = await html2canvas(divForDownloadViewport)
|
||||||
|
const base64Str = canvas.toDataURL('image/png', 1)
|
||||||
|
callback(base64Str)
|
||||||
|
}, 200)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (this.isMPR) {
|
||||||
|
this.isMPR = false
|
||||||
|
this.rows = 1
|
||||||
|
this.cols = 1
|
||||||
|
this.activeViewportIndex = 0
|
||||||
|
// return this.activeSeries(series)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.$refs[`${this.viewportKey}-${this.activeViewportIndex}`][0].setSeriesInfo(series, true)
|
this.$refs[`${this.viewportKey}-${this.activeViewportIndex}`][0].setSeriesInfo(series, true)
|
||||||
|
|
@ -2770,7 +2803,7 @@ export default {
|
||||||
const canvas = await html2canvas(divForDownloadViewport)
|
const canvas = await html2canvas(divForDownloadViewport)
|
||||||
const base64Str = canvas.toDataURL('image/png', 1)
|
const base64Str = canvas.toDataURL('image/png', 1)
|
||||||
callback(base64Str)
|
callback(base64Str)
|
||||||
}, 500)
|
}, 200)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async getScreenshots(measureData, callback) {
|
async getScreenshots(measureData, callback) {
|
||||||
|
|
@ -3124,24 +3157,27 @@ export default {
|
||||||
},
|
},
|
||||||
async openMPRViewport(data = null) {
|
async openMPRViewport(data = null) {
|
||||||
return new Promise(async (resolve, reject) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
if (this.isMPR) return resolve(true)
|
if (this.isMPR) {
|
||||||
|
if (!data) return resolve(false)
|
||||||
|
let viewportSeries = this.$refs[`viewport-volume-0`][0].series
|
||||||
|
if (data && viewportSeries.SeriesInstanceUid === data.SeriesInstanceUid) return resolve(true)
|
||||||
|
}
|
||||||
|
|
||||||
this.isMPR = true
|
this.isMPR = true
|
||||||
this.rows = 3
|
this.rows = 3
|
||||||
this.cols = 1
|
this.cols = 1
|
||||||
this.loading = true
|
this.loading = true
|
||||||
this.loadingText = this.$t('trials:lugano:message:loadVolumes')
|
this.loadingText = this.$t('trials:lugano:message:loadVolumes')
|
||||||
const series = data ? data : this.$refs[`viewport-${this.activeViewportIndex}`][0].series
|
const series = data ? data : this.$refs[`viewport-${this.activeViewportIndex}`][0].series
|
||||||
this.activeViewportIndex = 0
|
if (!data) this.activeViewportIndex = 0
|
||||||
// this.$refs[`viewport-0`][0].setSeriesInfo(series)
|
const visitTaskId = this.visitTaskList[this.activeTaskIndex].VisitTaskId
|
||||||
// this.$refs[`viewport-1`][0].setSeriesInfo(series)
|
this.$refs[visitTaskId][0].setSeriesActive(series.StudyIndex, series.SeriesIndex)
|
||||||
// this.$refs[`viewport-2`][0].setSeriesInfo(series)
|
|
||||||
// this.$refs[`viewport-3`][0].setSeriesInfo(series)
|
|
||||||
await this.getVolume(series)
|
await this.getVolume(series)
|
||||||
this.loading = false
|
this.loading = false
|
||||||
this.loadingText = null
|
this.loadingText = null
|
||||||
this.$refs[`viewport-volume-0`][0].setSeriesInfo(Object.assign({ orientation: 'AXIAL' }, series))
|
this.$refs[`viewport-volume-0`][0].setSeriesInfo(Object.assign({ orientation: 'AXIAL', isLocation: data && this.activeViewportIndex === 0 }, series))
|
||||||
this.$refs[`viewport-volume-1`][0].setSeriesInfo(Object.assign({ orientation: 'CORONAL' }, series))
|
this.$refs[`viewport-volume-1`][0].setSeriesInfo(Object.assign({ orientation: 'SAGITTAL', isLocation: data && this.activeViewportIndex === 1 }, series))
|
||||||
this.$refs[`viewport-volume-2`][0].setSeriesInfo(Object.assign({ orientation: 'SAGITTAL' }, series))
|
this.$refs[`viewport-volume-2`][0].setSeriesInfo(Object.assign({ orientation: 'CORONAL', isLocation: data && this.activeViewportIndex === 2 }, series))
|
||||||
resolve(false)
|
resolve(false)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,10 +40,10 @@
|
||||||
<div v-if="series" class="right-bottom-text">
|
<div v-if="series" class="right-bottom-text">
|
||||||
<div v-show="imageInfo.location">Location: {{
|
<div v-show="imageInfo.location">Location: {{
|
||||||
`${Number(imageInfo.location).toFixed(digitPlaces)} mm`
|
`${Number(imageInfo.location).toFixed(digitPlaces)} mm`
|
||||||
}}</div>
|
}}</div>
|
||||||
<div v-show="imageInfo.sliceThickness">Slice Thickness: {{
|
<div v-show="imageInfo.sliceThickness">Slice Thickness: {{
|
||||||
`${Number(imageInfo.sliceThickness).toFixed(digitPlaces)} mm`
|
`${Number(imageInfo.sliceThickness).toFixed(digitPlaces)} mm`
|
||||||
}}</div>
|
}}</div>
|
||||||
<div v-show="imageInfo.wwwc">WW/WL: {{ imageInfo.wwwc }}</div>
|
<div v-show="imageInfo.wwwc">WW/WL: {{ imageInfo.wwwc }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="orientation-top">
|
<div class="orientation-top">
|
||||||
|
|
@ -402,7 +402,7 @@ export default {
|
||||||
async setSeriesInfo(obj, isLocate = false) {
|
async setSeriesInfo(obj, isLocate = false) {
|
||||||
try {
|
try {
|
||||||
let data = obj
|
let data = obj
|
||||||
if (this.series && data.Id === this.series.Id && data.Description === this.series.Description && !isLocate) {
|
if (this.series && data.Id === this.series.Id && data.Description === this.series.Description && !isLocate && !data.isLocation) {
|
||||||
data.SliceIndex = this.series.SliceIndex
|
data.SliceIndex = this.series.SliceIndex
|
||||||
}
|
}
|
||||||
const renderingEngine = getRenderingEngine(this.renderingEngineId)
|
const renderingEngine = getRenderingEngine(this.renderingEngineId)
|
||||||
|
|
@ -421,7 +421,11 @@ export default {
|
||||||
}
|
}
|
||||||
console.log("渲染成功")
|
console.log("渲染成功")
|
||||||
}
|
}
|
||||||
}])
|
}]).then(res => {
|
||||||
|
if (data.isLocation) {
|
||||||
|
setTimeout(() => { csUtils.jumpToSlice(viewport.element, { imageIndex: data.SliceIndex }); })
|
||||||
|
}
|
||||||
|
})
|
||||||
viewport.render()
|
viewport.render()
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue