-
+
+
+
+
+
+
@@ -874,6 +877,7 @@ export default {
activeSeries: {
immediate: true,
handler(v) {
+ console.log('activeSeries', v)
if (v && v.isCurrentTask && this.studyList.length === 0) {
this.activeTaskInfo.taskName = v.taskBlindName
this.activeTaskInfo.visitTaskId = v.visitTaskId
@@ -1253,6 +1257,7 @@ export default {
})
},
loadImageStack(dicomSeries) {
+ this.clipPlaying = false
this.canvasObj[this.currentDicomCanvasIndex] = dicomSeries
this.$nextTick(() => {
this.activeSeries = dicomSeries
@@ -1932,12 +1937,24 @@ export default {
},
// 切换帧
scrollPage(i) {
+ // 获取影像是否下载完成
+ const isLoaded = this.getSeriesLoadStatus()
+ if (!isLoaded) return
this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].scrollPage(i)
},
// 播放/暂停
- toggleClipPlay() {
- this.clipPlaying = !this.clipPlaying
- this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].toggleClipPlay()
+ toggleClipPlay(isPlay) {
+ // 获取影像是否下载完成
+ const isLoaded = this.getSeriesLoadStatus()
+ if (!isLoaded) return
+ this.clipPlaying = isPlay
+ this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].toggleClipPlay(isPlay)
+ },
+ getSeriesLoadStatus() {
+ const index = this.visitTaskList.findIndex(i => i.VisitTaskId === this.activeSeries.visitTaskId)
+ if (index === -1) return false
+ const loadStatus = this.visitTaskList[index].StudyList[this.activeSeries.studyIndex].SeriesList[this.activeSeries.seriesIndex].loadStatus
+ return loadStatus
},
setDicomCanvasfps(event) {
this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].setFps(event.target.value)
diff --git a/src/views/trials/trials-panel/reading/dicoms/components/StudyList.vue b/src/views/trials/trials-panel/reading/dicoms/components/StudyList.vue
index 289ec482..5fc0352c 100644
--- a/src/views/trials/trials-panel/reading/dicoms/components/StudyList.vue
+++ b/src/views/trials/trials-panel/reading/dicoms/components/StudyList.vue
@@ -267,6 +267,7 @@ export default {
// this.studyList = this.visitTaskList[idx].StudyList
// }
// })
+ // const debouncedInputHandler = this.debounce(this.cornerstoneimageloadprogress, 100)
cornerstone.events.addEventListener('cornerstoneimageloadprogress', this.cornerstoneimageloadprogress)
cornerstone.events.addEventListener('cornerstoneimageloaded', this.cornerstoneImageLoaded)
// cornerstone.events.addEventListener('cornerstoneimagecachefull', this.cornerstoneimagecachefull)
@@ -281,6 +282,17 @@ export default {
window.removeEventListener('beforeunload', e => { cornerstone.imageCache.purgeCache() })
},
methods: {
+ debounce(fn, delay) {
+ let timer = null
+ return function() {
+ const context = this
+ const args = arguments
+ clearTimeout(timer)
+ timer = setTimeout(() => {
+ fn.apply(context, args)
+ }, delay)
+ }
+ },
initStudyInfo() {
const loading = this.$loading({ fullscreen: true })
// 初始化待渲染序列
@@ -621,7 +633,6 @@ export default {
this.imageList.push({ imageId: imageId, seriesId: series.seriesId, studyIndex: studyIndex, seriesIndex: seriesIndex, visitTaskId: series.visitTaskId, priority })
})
}
-
if (this.imageList.length > 0) {
this.loopLoadStatus = 0
this.loopLoad()
@@ -889,42 +900,44 @@ export default {
},
cornerstoneimageloadprogress(e) {
const imageId = e.detail.imageId
- const percentComplete = e.detail.percentComplete
const params = {}
const searchParams = new URLSearchParams(imageId.split('?')[1])
for (const [key, value] of searchParams.entries()) {
params[key] = value
}
- if (this.visitTaskId === params.visitTaskId) {
- const studyIndex = params.idx.split('|')[0]
- const seriesIndex = params.idx.split('|')[1]
- var prefetchInstanceCount = this.studyList[studyIndex].SeriesList[seriesIndex].prefetchInstanceCount
- var instanceCount = this.studyList[studyIndex].SeriesList[seriesIndex].instanceCount
- if (this.studyList[studyIndex].SeriesList[seriesIndex].imageloadedArr.indexOf(imageId) < 0) {
- const i = this.currentLoadIns.findIndex(i => i.imageId === imageId)
- if (i > -1) {
- prefetchInstanceCount = prefetchInstanceCount - this.currentLoadIns[i].percentComplete + percentComplete
- this.currentLoadIns[i].percentComplete = percentComplete
- if (percentComplete === 100) {
- this.currentLoadIns.splice(i, 1)
- }
- } else {
- if (percentComplete !== 100) {
- this.currentLoadIns.push({ imageId, percentComplete })
- }
- prefetchInstanceCount = prefetchInstanceCount + percentComplete
- }
- this.studyList[studyIndex].SeriesList[seriesIndex].prefetchInstanceCount = prefetchInstanceCount
+ if (this.visitTaskId !== params.visitTaskId) return
+ const percentComplete = e.detail.percentComplete
+
+ const studyIndex = parseInt(params.idx.split('|')[0])
+ const seriesIndex = parseInt(params.idx.split('|')[1])
+ var prefetchInstanceCount = this.studyList[studyIndex].SeriesList[seriesIndex].prefetchInstanceCount
+ var instanceCount = this.studyList[studyIndex].SeriesList[seriesIndex].instanceCount
+ if (this.studyList[studyIndex].SeriesList[seriesIndex].imageloadedArr.indexOf(imageId) < 0) {
+ const i = this.currentLoadIns.findIndex(i => i.imageId === imageId)
+ if (i > -1) {
+ prefetchInstanceCount = prefetchInstanceCount + percentComplete - this.currentLoadIns[i].percentComplete
+ this.currentLoadIns[i].percentComplete = percentComplete
if (percentComplete >= 100) {
- this.studyList[studyIndex].SeriesList[seriesIndex].imageloadedArr.push(imageId)
+ this.currentLoadIns.splice(i, 1)
}
+ } else {
+ if (percentComplete !== 100) {
+ this.currentLoadIns.push({ imageId, percentComplete })
+ }
+ prefetchInstanceCount = prefetchInstanceCount + percentComplete
}
- if (prefetchInstanceCount >= instanceCount * 100) {
- this.studyList[studyIndex].SeriesList[seriesIndex].prefetchInstanceCount = instanceCount * 100
- // 设置当前序列状态为已下载完成
- this.studyList[studyIndex].SeriesList[seriesIndex].loadStatus = true
+ this.studyList[studyIndex].SeriesList[seriesIndex].prefetchInstanceCount = prefetchInstanceCount
+ if (percentComplete >= 100) {
+ this.studyList[studyIndex].SeriesList[seriesIndex].imageloadedArr.push(imageId)
}
}
+
+ if (prefetchInstanceCount >= instanceCount * 100) {
+ this.studyList[studyIndex].SeriesList[seriesIndex].prefetchInstanceCount = instanceCount * 100
+ // 设置当前序列状态为已下载完成
+ this.studyList[studyIndex].SeriesList[seriesIndex].loadStatus = true
+ // this.studyList[studyIndex].SeriesList[seriesIndex].imageloadedArr.push(imageId)
+ }
},
cornerstoneimagecachechanged(e) {
const cacheInfo = cornerstone.imageCache.getCacheInfo()
diff --git a/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeDicomCanvas.vue b/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeDicomCanvas.vue
index 9c6379fe..61dcaf49 100644
--- a/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeDicomCanvas.vue
+++ b/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeDicomCanvas.vue
@@ -1065,7 +1065,7 @@ export default {
this.stack.instanceId = instanceId
const ToolStateManager = cornerstoneTools.globalImageIdSpecificToolStateManager
ToolStateManager.clearImageIdToolState(dicomSeries.imageIds)
- if (this.toolState.clipPlaying) this.toggleClipPlay()
+ this.toggleClipPlay(false)
this.toolState.viewportInvert = false
this.toolState.dicomInfoVisible = false
@@ -1606,18 +1606,19 @@ export default {
}
},
- toggleClipPlay() {
- if (this.toolState.clipPlaying) {
+ toggleClipPlay(isPlay) {
+ if (isPlay) {
+ this.toolState.clipPlaying = true
+ cornerstoneTools.playClip(this.canvas, this.dicomInfo.fps)
+ cornerstoneTools.getToolState(
+ this.canvas,
+ 'playClip'
+ ).data[0].loop = false
+ } else {
cornerstoneTools.stopClip(this.canvas)
this.toolState.clipPlaying = false
return
}
- this.toolState.clipPlaying = true
- cornerstoneTools.playClip(this.canvas, this.dicomInfo.fps)
- cornerstoneTools.getToolState(
- this.canvas,
- 'playClip'
- ).data[0].loop = false
},
setFps(fps) {
this.dicomInfo.fps = fps
diff --git a/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeDicomViewer.vue b/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeDicomViewer.vue
index 643ebee8..d17e693e 100644
--- a/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeDicomViewer.vue
+++ b/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeDicomViewer.vue
@@ -309,9 +309,12 @@