main
parent
dd919f123e
commit
bd980cd867
|
|
@ -203,6 +203,9 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
loadImageStack(dicomSeries) {
|
loadImageStack(dicomSeries) {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
|
if (!dicomSeries || !Array.isArray(dicomSeries.imageIds) || dicomSeries.imageIds.length === 0) {
|
||||||
|
return
|
||||||
|
}
|
||||||
this.series = dicomSeries
|
this.series = dicomSeries
|
||||||
this.stack.seriesId = dicomSeries.seriesId
|
this.stack.seriesId = dicomSeries.seriesId
|
||||||
this.stack.seriesNumber = dicomSeries.seriesNumber
|
this.stack.seriesNumber = dicomSeries.seriesNumber
|
||||||
|
|
@ -379,9 +382,7 @@ export default {
|
||||||
// var instanceId = image.imageId.split('/')[image.imageId.split('/').length - 1]
|
// var instanceId = image.imageId.split('/')[image.imageId.split('/').length - 1]
|
||||||
// instanceId = instanceId.split('.')[0]
|
// instanceId = instanceId.split('.')[0]
|
||||||
// this.stack.instanceId = instanceId
|
// this.stack.instanceId = instanceId
|
||||||
this.height =
|
this.height = this.getStackHeightPercent()
|
||||||
(this.stack.currentImageIdIndex * 100) /
|
|
||||||
(this.stack.imageIds.length - 1)
|
|
||||||
this.resetWwwc()
|
this.resetWwwc()
|
||||||
},
|
},
|
||||||
onNewImage(e) {
|
onNewImage(e) {
|
||||||
|
|
@ -427,10 +428,14 @@ export default {
|
||||||
this.stack.currentImageIdIndex = newImageIdIndex
|
this.stack.currentImageIdIndex = newImageIdIndex
|
||||||
this.stack.imageIdIndex = newImageIdIndex
|
this.stack.imageIdIndex = newImageIdIndex
|
||||||
this.series.imageIdIndex = newImageIdIndex
|
this.series.imageIdIndex = newImageIdIndex
|
||||||
this.height =
|
this.height = this.getStackHeightPercent()
|
||||||
(this.stack.currentImageIdIndex * 100) /
|
},
|
||||||
(this.stack.imageIds.length - 1)
|
getStackHeightPercent() {
|
||||||
this.resetWwwc()
|
const imageCount = Array.isArray(this.stack.imageIds) ? this.stack.imageIds.length : 0
|
||||||
|
if (imageCount <= 1) {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return (this.stack.currentImageIdIndex * 100) / (imageCount - 1)
|
||||||
},
|
},
|
||||||
stackScrollCallback(e) {
|
stackScrollCallback(e) {
|
||||||
const { detail } = e
|
const { detail } = e
|
||||||
|
|
@ -737,6 +742,7 @@ export default {
|
||||||
var viewport = cornerstone.getViewport(this.canvas)
|
var viewport = cornerstone.getViewport(this.canvas)
|
||||||
// viewport.invert = false
|
// viewport.invert = false
|
||||||
var image = cornerstone.getImage(this.canvas)
|
var image = cornerstone.getImage(this.canvas)
|
||||||
|
if (!viewport || !image) return
|
||||||
viewport.voi.windowWidth = image.windowWidth
|
viewport.voi.windowWidth = image.windowWidth
|
||||||
viewport.voi.windowCenter = image.windowCenter
|
viewport.voi.windowCenter = image.windowCenter
|
||||||
cornerstone.setViewport(this.canvas, viewport)
|
cornerstone.setViewport(this.canvas, viewport)
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ async function executeTask() {
|
||||||
task.callback({ success: true, res: result })
|
task.callback({ success: true, res: result })
|
||||||
|
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
task.callback({ success: true, err: error })
|
task.callback({ success: false, err: error })
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
// let starLoadTime = performance.now()
|
// let starLoadTime = performance.now()
|
||||||
|
|
|
||||||
|
|
@ -346,20 +346,18 @@ export default {
|
||||||
this.isFromCRCUpload = !!this.$router.currentRoute.query.isFromCRCUpload
|
this.isFromCRCUpload = !!this.$router.currentRoute.query.isFromCRCUpload
|
||||||
this.visitTaskId = this.$router.currentRoute.query.visitTaskId
|
this.visitTaskId = this.$router.currentRoute.query.visitTaskId
|
||||||
this.page = this.$route.query.page
|
this.page = this.$route.query.page
|
||||||
|
this.beforeUnloadHandler = () => {
|
||||||
|
cornerstone.imageCache.purgeCache()
|
||||||
|
requestPoolManager.resetRequestPool()
|
||||||
|
}
|
||||||
// cornerstone.events.addEventListener('cornerstoneimageloaded', this.cornerstoneImageLoaded)
|
// cornerstone.events.addEventListener('cornerstoneimageloaded', this.cornerstoneImageLoaded)
|
||||||
this.getStudiesInfo()
|
this.getStudiesInfo()
|
||||||
cornerstone.events.addEventListener('cornerstoneimageloadprogress', this.cornerstoneimageloadprogress)
|
cornerstone.events.addEventListener('cornerstoneimageloadprogress', this.cornerstoneimageloadprogress)
|
||||||
window.addEventListener('beforeunload', e => {
|
window.addEventListener('beforeunload', this.beforeUnloadHandler)
|
||||||
cornerstone.imageCache.purgeCache()
|
|
||||||
requestPoolManager.resetRequestPool()
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
requestPoolManager.stopTaskTimer()
|
requestPoolManager.stopTaskTimer()
|
||||||
window.removeEventListener('beforeunload', e => {
|
window.removeEventListener('beforeunload', this.beforeUnloadHandler)
|
||||||
cornerstone.imageCache.purgeCache()
|
|
||||||
requestPoolManager.resetRequestPool()
|
|
||||||
})
|
|
||||||
workSpeedclose(true)
|
workSpeedclose(true)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
@ -489,14 +487,17 @@ export default {
|
||||||
data.SeriesList = seriesList
|
data.SeriesList = seriesList
|
||||||
this.studyList.push(data)
|
this.studyList.push(data)
|
||||||
})
|
})
|
||||||
if (this.studyList.length > 0) {
|
const firstStudy = this.studyList.find(study => Array.isArray(study.SeriesList) && study.SeriesList.length > 0)
|
||||||
this.$refs.dicomViewer.loadImageStack(this.studyList[0].SeriesList[0])
|
if (firstStudy) {
|
||||||
const imageId = this.studyList[0].SeriesList[0].imageIds[0]
|
const firstSeries = firstStudy.SeriesList[0]
|
||||||
|
if (!Array.isArray(firstSeries.imageIds) || firstSeries.imageIds.length === 0) return
|
||||||
|
this.$refs.dicomViewer.loadImageStack(firstSeries)
|
||||||
|
const imageId = firstSeries.imageIds[0]
|
||||||
let instanceId = imageId.split('/')[imageId.split('/').length - 1]
|
let instanceId = imageId.split('/')[imageId.split('/').length - 1]
|
||||||
instanceId = instanceId.split('.')[0]
|
instanceId = instanceId.split('.')[0]
|
||||||
this.firstInstanceId = instanceId
|
this.firstInstanceId = instanceId
|
||||||
this.activeNames = [this.studyList[0].StudyId]
|
this.activeNames = [firstStudy.StudyId]
|
||||||
this.loadImages(this.studyList[0].SeriesList[0], 0)
|
this.loadImages(firstSeries, 0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
@ -599,7 +600,11 @@ export default {
|
||||||
}
|
}
|
||||||
if (!isAddToTakPool) {
|
if (!isAddToTakPool) {
|
||||||
var priority = parseInt(new Date().getTime())
|
var priority = parseInt(new Date().getTime())
|
||||||
if (series.isExistMutiFrames) {
|
if (series.isExistMutiFrames && imageIds.length > 1) {
|
||||||
|
imageIds.map(imageId => {
|
||||||
|
this.imageList.push({ imageId, seriesId: series.seriesId, priority })
|
||||||
|
})
|
||||||
|
} else if (series.isExistMutiFrames) {
|
||||||
series.instanceInfoList.map(image => {
|
series.instanceInfoList.map(image => {
|
||||||
this.imageList.push({ imageId: image.ImageId, seriesId: series.seriesId, priority })
|
this.imageList.push({ imageId: image.ImageId, seriesId: series.seriesId, priority })
|
||||||
})
|
})
|
||||||
|
|
@ -938,7 +943,7 @@ export default {
|
||||||
if (this.imageList.length > 0) {
|
if (this.imageList.length > 0) {
|
||||||
requestPoolManager.startTaskTimer()
|
requestPoolManager.startTaskTimer()
|
||||||
this.imageList.map(image => {
|
this.imageList.map(image => {
|
||||||
requestPoolManager.loadAndCacheImagePlus(image.imageId, image.seriesId, image.priority)
|
requestPoolManager.loadAndCacheImagePlus(image.imageId, image.seriesId, image.priority).catch(() => {})
|
||||||
})
|
})
|
||||||
requestPoolManager.sortTaskPool()
|
requestPoolManager.sortTaskPool()
|
||||||
this.imageList = []
|
this.imageList = []
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue