Compare commits

..

No commits in common. "4bd286ca456b0877e269b0dfe6d0ab01f562db0f" and "ef6135a9e45277c2df98c9f15e9f48ac90dfb2b5" have entirely different histories.

8 changed files with 63 additions and 114 deletions

View File

@ -207,7 +207,7 @@ export default {
var instanceId = imageId.split('/')[imageId.split('/').length - 1] var instanceId = imageId.split('/')[imageId.split('/').length - 1]
instanceId = instanceId.split('.')[0] instanceId = instanceId.split('.')[0]
this.stack.instanceId = instanceId this.stack.instanceId = instanceId
this.toolState.clipPlaying = false if (this.toolState.clipPlaying) this.toggleClipPlay()
const element = this.$refs.canvas const element = this.$refs.canvas
cornerstone.enable(element) cornerstone.enable(element)
this.loading = true this.loading = true
@ -630,7 +630,6 @@ export default {
enabledElement.renderingTools.renderCanvasData = renderCanvasData enabledElement.renderingTools.renderCanvasData = renderCanvasData
}, },
scrollPage(offset) { scrollPage(offset) {
if(this.loading) return
var index = this.stack.currentImageIdIndex + offset var index = this.stack.currentImageIdIndex + offset
if (index < 0) index = 0 if (index < 0) index = 0
else if (index >= this.stack.imageIds.length) { else if (index >= this.stack.imageIds.length) {
@ -642,7 +641,6 @@ export default {
}, },
toggleClipPlay() { toggleClipPlay() {
if(this.loading) return
if (this.toolState.clipPlaying) { if (this.toolState.clipPlaying) {
cornerstoneTools.stopClip(this.canvas) cornerstoneTools.stopClip(this.canvas)
this.toolState.clipPlaying = false this.toolState.clipPlaying = false

View File

@ -400,7 +400,6 @@ export default {
methods: { methods: {
loadImageStack(dicomSeries) { loadImageStack(dicomSeries) {
this.currentDicomCanvas.toolState.clipPlaying = false
this.$nextTick(() => { this.$nextTick(() => {
this.currentDicomCanvas.loadImageStack(dicomSeries) this.currentDicomCanvas.loadImageStack(dicomSeries)
}) })

View File

@ -771,7 +771,7 @@ const actions = {
const imageId = `wadouri:${localStorage.getItem('location') !== 'USA' ? Vue.prototype.OSSclientConfig.basePath : Vue.prototype.OSSclientConfig.basePath}${instance.Path}?frame=${i}&instanceId=${instance.Id}&visitTaskId=${obj.visitTaskId}&idx=${studyIndex}|${seriesIndex}` const imageId = `wadouri:${localStorage.getItem('location') !== 'USA' ? Vue.prototype.OSSclientConfig.basePath : Vue.prototype.OSSclientConfig.basePath}${instance.Path}?frame=${i}&instanceId=${instance.Id}&visitTaskId=${obj.visitTaskId}&idx=${studyIndex}|${seriesIndex}`
imageIds.push(imageId) imageIds.push(imageId)
} }
instance.ImageId = `wadouri:${localStorage.getItem('location') !== 'USA' ? Vue.prototype.OSSclientConfig.basePath : Vue.prototype.OSSclientConfig.basePath}${instance.Path}?frame=${0}&instanceId=${instance.Id}&visitTaskId=${obj.visitTaskId}&idx=${studyIndex}|${seriesIndex}` instance.ImageId = `wadouri:${localStorage.getItem('location') !== 'USA' ? Vue.prototype.OSSclientConfig.basePath : Vue.prototype.OSSclientConfig.basePath}${instance.Path}?frame=${0}?instanceId=${instance.Id}&visitTaskId=${obj.visitTaskId}&idx=0|0`
} else { } else {
const imageId = `wadouri:${localStorage.getItem('location') !== 'USA' ? Vue.prototype.OSSclientConfig.basePath : Vue.prototype.OSSclientConfig.basePath}${instance.Path}?instanceId=${instance.Id}&visitTaskId=${obj.visitTaskId}&idx=${studyIndex}|${seriesIndex}` const imageId = `wadouri:${localStorage.getItem('location') !== 'USA' ? Vue.prototype.OSSclientConfig.basePath : Vue.prototype.OSSclientConfig.basePath}${instance.Path}?instanceId=${instance.Id}&visitTaskId=${obj.visitTaskId}&idx=${studyIndex}|${seriesIndex}`
imageIds.push(imageId) imageIds.push(imageId)

View File

@ -1090,7 +1090,7 @@ export default {
this.stack.instanceId = instanceId this.stack.instanceId = instanceId
const ToolStateManager = cornerstoneTools.globalImageIdSpecificToolStateManager const ToolStateManager = cornerstoneTools.globalImageIdSpecificToolStateManager
ToolStateManager.clearImageIdToolState(dicomSeries.imageIds) ToolStateManager.clearImageIdToolState(dicomSeries.imageIds)
this.toggleClipPlay(false) if (this.toolState.clipPlaying) this.toggleClipPlay()
this.toolState.viewportInvert = false this.toolState.viewportInvert = false
this.toolState.dicomInfoVisible = false this.toolState.dicomInfoVisible = false
@ -1245,7 +1245,7 @@ export default {
if (this.dicomInfo.thick) { if (this.dicomInfo.thick) {
this.dicomInfo.thick = this.dicomInfo.thick.toFixed(2) this.dicomInfo.thick = this.dicomInfo.thick.toFixed(2)
} }
const newImageIdIndex = this.stack.imageIds.findIndex(i => i === imageId) let newImageIdIndex = this.stack.imageIds.findIndex(i=>i===imageId)
if(newImageIdIndex === -1) return if(newImageIdIndex === -1) return
this.stack.currentImageIdIndex = newImageIdIndex this.stack.currentImageIdIndex = newImageIdIndex
this.stack.imageIdIndex = newImageIdIndex this.stack.imageIdIndex = newImageIdIndex
@ -1631,19 +1631,18 @@ export default {
} }
}, },
toggleClipPlay(isPlay) { toggleClipPlay() {
if (isPlay) { if (this.toolState.clipPlaying) {
cornerstoneTools.stopClip(this.canvas)
this.toolState.clipPlaying = false
return
}
this.toolState.clipPlaying = true this.toolState.clipPlaying = true
cornerstoneTools.playClip(this.canvas, this.dicomInfo.fps) cornerstoneTools.playClip(this.canvas, this.dicomInfo.fps)
cornerstoneTools.getToolState( cornerstoneTools.getToolState(
this.canvas, this.canvas,
'playClip' 'playClip'
).data[0].loop = false ).data[0].loop = false
} else {
cornerstoneTools.stopClip(this.canvas)
this.toolState.clipPlaying = false
return
}
}, },
setFps(fps) { setFps(fps) {
this.dicomInfo.fps = fps this.dicomInfo.fps = fps

View File

@ -306,12 +306,9 @@
</div> </div>
</el-tooltip> </el-tooltip>
<!-- 播放/暂停 --> <!-- 播放/暂停 -->
<el-tooltip class="item" effect="dark" :content="clipPlaying?$t('trials:dicom-show:stop'):$t('trials:dicom-show:play')" placement="bottom"> <el-tooltip class="item" effect="dark" :content="clipPlaying?$t('trials:dicom-show:play'):$t('trials:dicom-show:stop')" placement="bottom">
<div v-if="clipPlaying" class="icon" @click.prevent="toggleClipPlay(false)"> <div class="icon" @click.prevent="toggleClipPlay">
<svg-icon icon-class="stop" class="svg-icon" /> <svg-icon :icon-class="clipPlaying?'stop':'play'" class="svg-icon" />
</div>
<div v-else class="icon" @click.prevent="toggleClipPlay(true)">
<svg-icon icon-class="play" class="svg-icon" />
</div> </div>
</el-tooltip> </el-tooltip>
<!-- 下一帧 --> <!-- 下一帧 -->
@ -877,7 +874,6 @@ export default {
activeSeries: { activeSeries: {
immediate: true, immediate: true,
handler(v) { handler(v) {
console.log('activeSeries', v)
if (v && v.isCurrentTask && this.studyList.length === 0) { if (v && v.isCurrentTask && this.studyList.length === 0) {
this.activeTaskInfo.taskName = v.taskBlindName this.activeTaskInfo.taskName = v.taskBlindName
this.activeTaskInfo.visitTaskId = v.visitTaskId this.activeTaskInfo.visitTaskId = v.visitTaskId
@ -1257,7 +1253,6 @@ export default {
}) })
}, },
loadImageStack(dicomSeries) { loadImageStack(dicomSeries) {
this.clipPlaying = false
this.canvasObj[this.currentDicomCanvasIndex] = dicomSeries this.canvasObj[this.currentDicomCanvasIndex] = dicomSeries
this.$nextTick(() => { this.$nextTick(() => {
this.activeSeries = dicomSeries this.activeSeries = dicomSeries
@ -1937,24 +1932,12 @@ export default {
}, },
// //
scrollPage(i) { scrollPage(i) {
//
const isLoaded = this.getSeriesLoadStatus()
if (!isLoaded) return
this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].scrollPage(i) this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].scrollPage(i)
}, },
// / // /
toggleClipPlay(isPlay) { toggleClipPlay() {
// this.clipPlaying = !this.clipPlaying
const isLoaded = this.getSeriesLoadStatus() this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].toggleClipPlay()
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) { setDicomCanvasfps(event) {
this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].setFps(event.target.value) this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].setFps(event.target.value)

View File

@ -267,7 +267,6 @@ export default {
// this.studyList = this.visitTaskList[idx].StudyList // this.studyList = this.visitTaskList[idx].StudyList
// } // }
// }) // })
// const debouncedInputHandler = this.debounce(this.cornerstoneimageloadprogress, 100)
cornerstone.events.addEventListener('cornerstoneimageloadprogress', this.cornerstoneimageloadprogress) cornerstone.events.addEventListener('cornerstoneimageloadprogress', this.cornerstoneimageloadprogress)
cornerstone.events.addEventListener('cornerstoneimageloaded', this.cornerstoneImageLoaded) cornerstone.events.addEventListener('cornerstoneimageloaded', this.cornerstoneImageLoaded)
// cornerstone.events.addEventListener('cornerstoneimagecachefull', this.cornerstoneimagecachefull) // cornerstone.events.addEventListener('cornerstoneimagecachefull', this.cornerstoneimagecachefull)
@ -282,17 +281,6 @@ export default {
window.removeEventListener('beforeunload', e => { cornerstone.imageCache.purgeCache() }) window.removeEventListener('beforeunload', e => { cornerstone.imageCache.purgeCache() })
}, },
methods: { 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() { initStudyInfo() {
const loading = this.$loading({ fullscreen: true }) const loading = this.$loading({ fullscreen: true })
// //
@ -633,6 +621,7 @@ export default {
this.imageList.push({ imageId: imageId, seriesId: series.seriesId, studyIndex: studyIndex, seriesIndex: seriesIndex, visitTaskId: series.visitTaskId, priority }) this.imageList.push({ imageId: imageId, seriesId: series.seriesId, studyIndex: studyIndex, seriesIndex: seriesIndex, visitTaskId: series.visitTaskId, priority })
}) })
} }
if (this.imageList.length > 0) { if (this.imageList.length > 0) {
this.loopLoadStatus = 0 this.loopLoadStatus = 0
this.loopLoad() this.loopLoad()
@ -900,24 +889,23 @@ export default {
}, },
cornerstoneimageloadprogress(e) { cornerstoneimageloadprogress(e) {
const imageId = e.detail.imageId const imageId = e.detail.imageId
const percentComplete = e.detail.percentComplete
const params = {} const params = {}
const searchParams = new URLSearchParams(imageId.split('?')[1]) const searchParams = new URLSearchParams(imageId.split('?')[1])
for (const [key, value] of searchParams.entries()) { for (const [key, value] of searchParams.entries()) {
params[key] = value params[key] = value
} }
if (this.visitTaskId !== params.visitTaskId) return if (this.visitTaskId === params.visitTaskId) {
const percentComplete = e.detail.percentComplete const studyIndex = params.idx.split('|')[0]
const seriesIndex = params.idx.split('|')[1]
const studyIndex = parseInt(params.idx.split('|')[0])
const seriesIndex = parseInt(params.idx.split('|')[1])
var prefetchInstanceCount = this.studyList[studyIndex].SeriesList[seriesIndex].prefetchInstanceCount var prefetchInstanceCount = this.studyList[studyIndex].SeriesList[seriesIndex].prefetchInstanceCount
var instanceCount = this.studyList[studyIndex].SeriesList[seriesIndex].instanceCount var instanceCount = this.studyList[studyIndex].SeriesList[seriesIndex].instanceCount
if (this.studyList[studyIndex].SeriesList[seriesIndex].imageloadedArr.indexOf(imageId) < 0) { if (this.studyList[studyIndex].SeriesList[seriesIndex].imageloadedArr.indexOf(imageId) < 0) {
const i = this.currentLoadIns.findIndex(i => i.imageId === imageId) const i = this.currentLoadIns.findIndex(i => i.imageId === imageId)
if (i > -1) { if (i > -1) {
prefetchInstanceCount = prefetchInstanceCount + percentComplete - this.currentLoadIns[i].percentComplete prefetchInstanceCount = prefetchInstanceCount - this.currentLoadIns[i].percentComplete + percentComplete
this.currentLoadIns[i].percentComplete = percentComplete this.currentLoadIns[i].percentComplete = percentComplete
if (percentComplete >= 100) { if (percentComplete === 100) {
this.currentLoadIns.splice(i, 1) this.currentLoadIns.splice(i, 1)
} }
} else { } else {
@ -931,12 +919,11 @@ export default {
this.studyList[studyIndex].SeriesList[seriesIndex].imageloadedArr.push(imageId) this.studyList[studyIndex].SeriesList[seriesIndex].imageloadedArr.push(imageId)
} }
} }
if (prefetchInstanceCount >= instanceCount * 100) { if (prefetchInstanceCount >= instanceCount * 100) {
this.studyList[studyIndex].SeriesList[seriesIndex].prefetchInstanceCount = instanceCount * 100 this.studyList[studyIndex].SeriesList[seriesIndex].prefetchInstanceCount = instanceCount * 100
// //
this.studyList[studyIndex].SeriesList[seriesIndex].loadStatus = true this.studyList[studyIndex].SeriesList[seriesIndex].loadStatus = true
// this.studyList[studyIndex].SeriesList[seriesIndex].imageloadedArr.push(imageId) }
} }
}, },
cornerstoneimagecachechanged(e) { cornerstoneimagecachechanged(e) {

View File

@ -1065,7 +1065,7 @@ export default {
this.stack.instanceId = instanceId this.stack.instanceId = instanceId
const ToolStateManager = cornerstoneTools.globalImageIdSpecificToolStateManager const ToolStateManager = cornerstoneTools.globalImageIdSpecificToolStateManager
ToolStateManager.clearImageIdToolState(dicomSeries.imageIds) ToolStateManager.clearImageIdToolState(dicomSeries.imageIds)
this.toggleClipPlay(false) if (this.toolState.clipPlaying) this.toggleClipPlay()
this.toolState.viewportInvert = false this.toolState.viewportInvert = false
this.toolState.dicomInfoVisible = false this.toolState.dicomInfoVisible = false
@ -1606,19 +1606,18 @@ export default {
} }
}, },
toggleClipPlay(isPlay) { toggleClipPlay() {
if (isPlay) { if (this.toolState.clipPlaying) {
cornerstoneTools.stopClip(this.canvas)
this.toolState.clipPlaying = false
return
}
this.toolState.clipPlaying = true this.toolState.clipPlaying = true
cornerstoneTools.playClip(this.canvas, this.dicomInfo.fps) cornerstoneTools.playClip(this.canvas, this.dicomInfo.fps)
cornerstoneTools.getToolState( cornerstoneTools.getToolState(
this.canvas, this.canvas,
'playClip' 'playClip'
).data[0].loop = false ).data[0].loop = false
} else {
cornerstoneTools.stopClip(this.canvas)
this.toolState.clipPlaying = false
return
}
}, },
setFps(fps) { setFps(fps) {
this.dicomInfo.fps = fps this.dicomInfo.fps = fps

View File

@ -309,12 +309,9 @@
</div> </div>
</el-tooltip> </el-tooltip>
<!-- 播放/暂停 --> <!-- 播放/暂停 -->
<el-tooltip class="item" effect="dark" :content="clipPlaying?$t('trials:dicom-show:stop'):$t('trials:dicom-show:play')" placement="bottom"> <el-tooltip class="item" effect="dark" :content="clipPlaying?$t('trials:dicom-show:play'):$t('trials:dicom-show:stop')" placement="bottom">
<div v-if="clipPlaying" class="icon" @click.prevent="toggleClipPlay(false)"> <div class="icon" @click.prevent="toggleClipPlay">
<svg-icon icon-class="stop" class="svg-icon" /> <svg-icon :icon-class="clipPlaying?'stop':'play'" class="svg-icon" />
</div>
<div v-else class="icon" @click.prevent="toggleClipPlay(true)">
<svg-icon icon-class="play" class="svg-icon" />
</div> </div>
</el-tooltip> </el-tooltip>
<!-- 下一帧 --> <!-- 下一帧 -->
@ -331,7 +328,7 @@
</el-tooltip> </el-tooltip>
<el-tooltip class="item" effect="dark" :content="$t('trials:dicom-show:speed')" placement="bottom"> <el-tooltip class="item" effect="dark" :content="$t('trials:dicom-show:speed')" placement="bottom">
<select class="select-wrapper" :disabled="clipPlaying" @change="setDicomCanvasfps($event)"> <select class="select-wrapper" @change="setDicomCanvasfps($event)" :disabled="clipPlaying">
<!-- 默认值 --> <!-- 默认值 -->
<option :value="5">{{ $t('trials:dicom-show:default') }}</option> <option :value="5">{{ $t('trials:dicom-show:default') }}</option>
<option :value="5">5</option> <option :value="5">5</option>
@ -913,7 +910,6 @@ export default {
}) })
}, },
loadImageStack(dicomSeries) { loadImageStack(dicomSeries) {
this.clipPlaying = false
this.canvasObj[this.currentDicomCanvasIndex] = dicomSeries this.canvasObj[this.currentDicomCanvasIndex] = dicomSeries
if (this.activeTool) { if (this.activeTool) {
if (dicomSeries.isCurrentTask && dicomSeries.readingTaskState < 2) { if (dicomSeries.isCurrentTask && dicomSeries.readingTaskState < 2) {
@ -1486,24 +1482,12 @@ export default {
}, },
// //
scrollPage(i) { scrollPage(i) {
//
const isLoaded = this.getSeriesLoadStatus()
if (!isLoaded) return
this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].scrollPage(i) this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].scrollPage(i)
}, },
// / // /
toggleClipPlay(isPlay) { toggleClipPlay() {
// this.clipPlaying = !this.clipPlaying
const isLoaded = this.getSeriesLoadStatus() this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].toggleClipPlay()
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) { setDicomCanvasfps(event) {
this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].setFps(event.target.value) this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].setFps(event.target.value)