多帧下载及进度条维护
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
fbb41e3fd9
commit
1eae9eda28
|
@ -41,6 +41,7 @@ const getters = {
|
||||||
lastCanvasTaskId: state => state.reading.lastCanvasTaskId,
|
lastCanvasTaskId: state => state.reading.lastCanvasTaskId,
|
||||||
imageQuality: state => state.reading.imageQuality,
|
imageQuality: state => state.reading.imageQuality,
|
||||||
imageQualityIssues: state => state.reading.imageQualityIssues,
|
imageQualityIssues: state => state.reading.imageQualityIssues,
|
||||||
|
currentLoadIns: state => state.reading.currentLoadIns,
|
||||||
language: state => state.lang.language,
|
language: state => state.lang.language,
|
||||||
TotalNeedSignSystemDocCount: state => state.user.TotalNeedSignSystemDocCount,
|
TotalNeedSignSystemDocCount: state => state.user.TotalNeedSignSystemDocCount,
|
||||||
TotalNeedSignTrialDocCount: state => state.user.TotalNeedSignTrialDocCount,
|
TotalNeedSignTrialDocCount: state => state.user.TotalNeedSignTrialDocCount,
|
||||||
|
|
|
@ -30,7 +30,8 @@ const getDefaultState = () => {
|
||||||
activeSeries: {},
|
activeSeries: {},
|
||||||
lastCanvasTaskId: '',
|
lastCanvasTaskId: '',
|
||||||
imageQuality: null,
|
imageQuality: null,
|
||||||
imageQualityIssues: null
|
imageQualityIssues: null,
|
||||||
|
currentLoadIns: []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function getQuestions(questions) {
|
function getQuestions(questions) {
|
||||||
|
@ -139,6 +140,22 @@ function getQuestionAnswer(questions, questionMark, answers) {
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// function getKeySeriesInfo(keyInstance, series) {
|
||||||
|
// const obj = {}
|
||||||
|
// const set = new Set()
|
||||||
|
// var instances = series.instanceList.concat(keyInstance).filter((item) => {
|
||||||
|
// if (set.has(item)) {
|
||||||
|
// return true
|
||||||
|
// } else {
|
||||||
|
// set.add(item)
|
||||||
|
// return false
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// instances.map(item => {
|
||||||
|
// obj[item] = { seriesId: series.seriesId, studyIndex: series.studyIndex, seriesIndex: series.seriesIndex }
|
||||||
|
// })
|
||||||
|
// return obj
|
||||||
|
// }
|
||||||
|
|
||||||
const state = getDefaultState
|
const state = getDefaultState
|
||||||
|
|
||||||
|
@ -759,7 +776,17 @@ const actions = {
|
||||||
resolve()
|
resolve()
|
||||||
} else {
|
} else {
|
||||||
var studyList = []
|
var studyList = []
|
||||||
|
var keyImages = []
|
||||||
getReadingVisitStudyList(obj.trialId, obj.subjectVisitId, obj.visitTaskId).then(res => {
|
getReadingVisitStudyList(obj.trialId, obj.subjectVisitId, obj.visitTaskId).then(res => {
|
||||||
|
const i = res.Result.findIndex(i => i.IsCriticalSequence)
|
||||||
|
if (i > -1) {
|
||||||
|
const seriesList = res.Result[i].SeriesList && res.Result[i].SeriesList
|
||||||
|
seriesList.map(i => {
|
||||||
|
i.InstanceInfoList.map(k => {
|
||||||
|
keyImages.push({ instanceId: k.Id })
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
res.Result.forEach((study, studyIndex) => {
|
res.Result.forEach((study, studyIndex) => {
|
||||||
const data = {}
|
const data = {}
|
||||||
data.StudyId = study.StudyId
|
data.StudyId = study.StudyId
|
||||||
|
@ -785,16 +812,22 @@ const actions = {
|
||||||
series.InstanceInfoList.forEach(instance => {
|
series.InstanceInfoList.forEach(instance => {
|
||||||
if (instance.NumberOfFrames && instance.NumberOfFrames > 1) {
|
if (instance.NumberOfFrames && instance.NumberOfFrames > 1) {
|
||||||
for (let i = 0; i < instance.NumberOfFrames; i++) {
|
for (let i = 0; i < instance.NumberOfFrames; i++) {
|
||||||
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}|${index}`
|
||||||
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=${studyIndex}|${seriesIndex}|${index}`
|
||||||
} 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}|${index}`
|
||||||
imageIds.push(imageId)
|
imageIds.push(imageId)
|
||||||
instance.ImageId = imageId
|
instance.ImageId = imageId
|
||||||
}
|
}
|
||||||
|
if (!study.IsCriticalSequence && series.IsBeMark) {
|
||||||
|
const i = keyImages.findIndex(i => i.instanceId === instance.Id)
|
||||||
|
if (i > -1) {
|
||||||
|
keyImages[i].studyIndex = studyIndex
|
||||||
|
keyImages[i].seriesIndex = seriesIndex
|
||||||
|
}
|
||||||
|
}
|
||||||
instanceList.push(instance.Id)
|
instanceList.push(instance.Id)
|
||||||
})
|
})
|
||||||
seriesList.push({
|
seriesList.push({
|
||||||
|
@ -837,6 +870,7 @@ const actions = {
|
||||||
})
|
})
|
||||||
state.visitTaskList[index].StudyList = studyList
|
state.visitTaskList[index].StudyList = studyList
|
||||||
state.visitTaskList[index].studyListInit = true
|
state.visitTaskList[index].studyListInit = true
|
||||||
|
state.visitTaskList[index].KeyImages = keyImages
|
||||||
// sessionStorage.setItem('visitTaskList', state.visitTaskList.length > 0 ? JSON.stringify(state.visitTaskList) : '')
|
// sessionStorage.setItem('visitTaskList', state.visitTaskList.length > 0 ? JSON.stringify(state.visitTaskList) : '')
|
||||||
resolve()
|
resolve()
|
||||||
}).catch(() => { resolve() })
|
}).catch(() => { resolve() })
|
||||||
|
@ -895,11 +929,114 @@ const actions = {
|
||||||
resolve()
|
resolve()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
setImageLoadedProgress({ state }, obj) {
|
||||||
|
const studyIndex = parseInt(obj.idx.split('|')[0])
|
||||||
|
const seriesIndex = parseInt(obj.idx.split('|')[1])
|
||||||
|
const visitTaskIndex = parseInt(obj.idx.split('|')[2])
|
||||||
|
let pStudyIndex = null
|
||||||
|
let pSeriesIndex = null
|
||||||
|
let pSeries = null
|
||||||
|
try {
|
||||||
|
const study = state.visitTaskList[visitTaskIndex].StudyList[studyIndex]
|
||||||
|
const series = state.visitTaskList[visitTaskIndex].StudyList[studyIndex].SeriesList[seriesIndex]
|
||||||
|
const keyImages = state.visitTaskList[visitTaskIndex].KeyImages
|
||||||
|
if (study.IsCriticalSequence) {
|
||||||
|
const i = keyImages.findIndex(i => i.instanceId === obj.instanceId)
|
||||||
|
if (i > -1) {
|
||||||
|
pStudyIndex = keyImages[i].studyIndex
|
||||||
|
pSeriesIndex = keyImages[i].seriesIndex
|
||||||
|
}
|
||||||
|
} else if (series.isBeMark) {
|
||||||
|
if (keyImages.length > 0) {
|
||||||
|
pStudyIndex = 0
|
||||||
|
pSeriesIndex = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (pStudyIndex !== null && pSeriesIndex !== null) {
|
||||||
|
pSeries = state.visitTaskList[visitTaskIndex].StudyList[pStudyIndex].SeriesList[pSeriesIndex]
|
||||||
|
}
|
||||||
|
|
||||||
|
var prefetchInstanceCount = series.prefetchInstanceCount
|
||||||
|
var instanceCount = series.instanceCount
|
||||||
|
var prefetchInstanceCount2 = pSeries ? pSeries.prefetchInstanceCount : null
|
||||||
|
var instanceCount2 = pSeries ? pSeries.instanceCount : null
|
||||||
|
if (series.imageloadedArr.indexOf(obj.instanceId) < 0) {
|
||||||
|
const i = state.currentLoadIns.findIndex(i => i.instanceId === obj.instanceId)
|
||||||
|
if (i > -1) {
|
||||||
|
prefetchInstanceCount = prefetchInstanceCount + obj.percentComplete - state.currentLoadIns[i].percentComplete
|
||||||
|
prefetchInstanceCount2 = prefetchInstanceCount2 !== null ? prefetchInstanceCount2 + obj.percentComplete - state.currentLoadIns[i].percentComplete : null
|
||||||
|
state.currentLoadIns[i].percentComplete = obj.percentComplete
|
||||||
|
if (obj.percentComplete >= 100) {
|
||||||
|
state.currentLoadIns.splice(i, 1)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (obj.percentComplete !== 100) {
|
||||||
|
state.currentLoadIns.push({ instanceId: obj.instanceId, percentComplete: obj.percentComplete })
|
||||||
|
}
|
||||||
|
prefetchInstanceCount = prefetchInstanceCount + obj.percentComplete
|
||||||
|
prefetchInstanceCount2 = prefetchInstanceCount2 !== null ? prefetchInstanceCount2 + obj.percentComplete : null
|
||||||
|
}
|
||||||
|
series.prefetchInstanceCount = prefetchInstanceCount
|
||||||
|
if (pSeries) {
|
||||||
|
pSeries.prefetchInstanceCount = prefetchInstanceCount2
|
||||||
|
}
|
||||||
|
if (obj.percentComplete >= 100) {
|
||||||
|
series.imageloadedArr.push(obj.instanceId)
|
||||||
|
if (pSeries) {
|
||||||
|
pSeries.imageloadedArr.push(obj.instanceId)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (prefetchInstanceCount >= instanceCount * 100) {
|
||||||
|
series.prefetchInstanceCount = instanceCount * 100
|
||||||
|
// 设置当前序列状态为已下载完成
|
||||||
|
series.loadStatus = true
|
||||||
|
}
|
||||||
|
if (prefetchInstanceCount2 !== null && instanceCount2 !== null && prefetchInstanceCount2 >= instanceCount2 * 100) {
|
||||||
|
pSeries.prefetchInstanceCount = instanceCount2 * 100
|
||||||
|
// 设置当前序列状态为已下载完成
|
||||||
|
pSeries.loadStatus = true
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log('error')
|
||||||
|
}
|
||||||
|
},
|
||||||
setImageloadedInfo({ state }, obj) {
|
setImageloadedInfo({ state }, obj) {
|
||||||
var index = state.visitTaskList.findIndex(i => i.VisitTaskId === obj.visitTaskId)
|
console.log('setImageloadedInfo', obj)
|
||||||
const prefetchInstanceCount = state.visitTaskList[index].StudyList[obj.studyIndex].SeriesList[obj.seriesIndex].prefetchInstanceCount
|
// if(obj.instance === '20dd8fc9-51b0-ec63-942b-cb3006c72650')
|
||||||
state.visitTaskList[index].StudyList[obj.studyIndex].SeriesList[obj.seriesIndex].prefetchInstanceCount = prefetchInstanceCount + 100
|
// var index = state.visitTaskList.findIndex(i => i.VisitTaskId === obj.visitTaskId)
|
||||||
state.visitTaskList[index].StudyList[obj.studyIndex].SeriesList[obj.seriesIndex].imageloadedArr.push(obj.imageId)
|
// // const prefetchInstanceCount = state.visitTaskList[index].StudyList[obj.studyIndex].SeriesList[obj.seriesIndex].prefetchInstanceCount
|
||||||
|
// const instanceList = state.visitTaskList[index].StudyList[obj.studyIndex].SeriesList[obj.seriesIndex].instanceList
|
||||||
|
// const idx = state.visitTaskList[index].StudyList.findIndex(i => i.IsCriticalSequence)
|
||||||
|
|
||||||
|
// if (!state.visitTaskList[index].StudyList[obj.studyIndex].IsCriticalSequence) {
|
||||||
|
// // 当前下载的非关键序列
|
||||||
|
// console.log('当前下载的非关键序列')
|
||||||
|
// if (idx > -1) {
|
||||||
|
// const keyInstance = state.visitTaskList[index].StudyList[idx].SeriesList[0].instanceList
|
||||||
|
// obj.markedImages = getKeySeriesInfo(keyInstance, state.visitTaskList[index].StudyList[obj.studyIndex].SeriesList[obj.seriesIndex])
|
||||||
|
// instanceList.map(i => {
|
||||||
|
// if (obj.markedImages.hasOwnProperty(i) && state.visitTaskList[index].StudyList[idx].SeriesList[0].imageloadedArr.indexOf(i) < 0) {
|
||||||
|
// state.visitTaskList[index].StudyList[idx].SeriesList[0].imageloadedArr.push(i)
|
||||||
|
// state.visitTaskList[index].StudyList[idx].SeriesList[0].prefetchInstanceCount = state.visitTaskList[index].StudyList[idx].SeriesList[0].prefetchInstanceCount + 100
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// if (state.visitTaskList[index].StudyList[idx].SeriesList[0].imageloadedArr >= state.visitTaskList[index].StudyList[idx].SeriesList[0].instanceCount) {
|
||||||
|
// state.visitTaskList[index].StudyList[idx].SeriesList[0].loadStatus = true
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// state.visitTaskList[index].StudyList[obj.studyIndex].SeriesList[obj.seriesIndex].prefetchInstanceCount = state.visitTaskList[index].StudyList[obj.studyIndex].SeriesList[obj.seriesIndex].instanceCount * 100
|
||||||
|
// state.visitTaskList[index].StudyList[obj.studyIndex].SeriesList[obj.seriesIndex].imageloadedArr = instanceList
|
||||||
|
// state.visitTaskList[index].StudyList[obj.studyIndex].SeriesList[obj.seriesIndex].loadStatus = true
|
||||||
|
// const imageloadedArr = state.visitTaskList[index].StudyList[obj.studyIndex].SeriesList[obj.seriesIndex].imageloadedArr
|
||||||
|
// if (imageloadedArr.indexOf())
|
||||||
|
|
||||||
|
// if (state.visitTaskList[index].StudyList[0].IsCriticalSequence){
|
||||||
|
// state.visitTaskList[index].StudyList[0].SeriesList[0].prefetchInstanceCount = prefetchInstanceCount + 100
|
||||||
|
// state.visitTaskList[index].StudyList[obj.studyIndex].SeriesList[obj.seriesIndex].imageloadedArr.push(obj.imageId)
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
setStatus({ state }, obj) {
|
setStatus({ state }, obj) {
|
||||||
var index = state.visitTaskList.findIndex(i => i.VisitTaskId === obj.visitTaskId)
|
var index = state.visitTaskList.findIndex(i => i.VisitTaskId === obj.visitTaskId)
|
||||||
|
|
|
@ -222,7 +222,8 @@ export default {
|
||||||
taskBlindName: '',
|
taskBlindName: '',
|
||||||
frame: null,
|
frame: null,
|
||||||
imageRendered: false,
|
imageRendered: false,
|
||||||
isExistsClinicalData:false
|
isExistsClinicalData: false,
|
||||||
|
isExistMutiFrames: false
|
||||||
// preventCache: true
|
// preventCache: true
|
||||||
},
|
},
|
||||||
dicomInfo: {
|
dicomInfo: {
|
||||||
|
@ -758,7 +759,7 @@ export default {
|
||||||
const imageInfo = this.getInstanceInfo(imageId)
|
const imageInfo = this.getInstanceInfo(imageId)
|
||||||
var instanceId = imageInfo.instanceId
|
var instanceId = imageInfo.instanceId
|
||||||
var frame = imageInfo.frame
|
var frame = imageInfo.frame
|
||||||
this.stack.frame = !isNaN(parseInt(frame)) ? parseInt(frame) : 0
|
this.stack.frame = this.stack.isExistMutiFrames ? parseInt(frame) : null
|
||||||
const ToolStateManager = cornerstoneTools.globalImageIdSpecificToolStateManager
|
const ToolStateManager = cornerstoneTools.globalImageIdSpecificToolStateManager
|
||||||
for (var m = 0; m < this.measuredTools.length; m++) {
|
for (var m = 0; m < this.measuredTools.length; m++) {
|
||||||
var toolType = this.measuredTools[m]
|
var toolType = this.measuredTools[m]
|
||||||
|
@ -880,7 +881,6 @@ export default {
|
||||||
return seriesList[seriesIdx].loadStatus ? 1 : 0
|
return seriesList[seriesIdx].loadStatus ? 1 : 0
|
||||||
},
|
},
|
||||||
renderMeasuredData(e) {
|
renderMeasuredData(e) {
|
||||||
this.stack.frame = !isNaN(parseInt(this.stack.frame)) ? parseInt(this.stack.frame) : 0
|
|
||||||
var idx = this.visitTaskList.findIndex(i => i.VisitTaskId === this.stack.visitTaskId)
|
var idx = this.visitTaskList.findIndex(i => i.VisitTaskId === this.stack.visitTaskId)
|
||||||
if (idx === -1) return
|
if (idx === -1) return
|
||||||
this.measureData = this.visitTaskList[idx].MeasureData
|
this.measureData = this.visitTaskList[idx].MeasureData
|
||||||
|
@ -899,9 +899,7 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
cornerstoneTools.setToolEnabledForElement(element, data.MeasureData.type, { mouseButtonMask: 1 })
|
cornerstoneTools.setToolEnabledForElement(element, data.MeasureData.type, { mouseButtonMask: 1 })
|
||||||
}
|
}
|
||||||
// console.log('renderMeasuredData', this.stack.frame)
|
if (this.stack.instanceId.includes(data.InstanceId) && ((this.stack.isExistMutiFrames && data.MeasureData.frame === this.stack.frame && data.MeasureData) || (!this.stack.isExistMutiFrames && data.MeasureData))) {
|
||||||
|
|
||||||
if (this.stack.instanceId.includes(data.InstanceId) && ((data.NumberOfFrames === this.stack.frame) || !data.NumberOfFrames) && data.MeasureData) {
|
|
||||||
const toolState = ToolStateManager.getImageIdToolState(e.detail.image.imageId, data.MeasureData.type)
|
const toolState = ToolStateManager.getImageIdToolState(e.detail.image.imageId, data.MeasureData.type)
|
||||||
if (toolState && toolState.data.length > 0) {
|
if (toolState && toolState.data.length > 0) {
|
||||||
var idx = toolState.data.findIndex(item => item.uuid === data.MeasureData.data.uuid)
|
var idx = toolState.data.findIndex(item => item.uuid === data.MeasureData.data.uuid)
|
||||||
|
@ -988,7 +986,7 @@ export default {
|
||||||
const imageInfo = this.getInstanceInfo(imageId)
|
const imageInfo = this.getInstanceInfo(imageId)
|
||||||
var instanceId = imageInfo.instanceId
|
var instanceId = imageInfo.instanceId
|
||||||
var frame = imageInfo.frame
|
var frame = imageInfo.frame
|
||||||
this.stack.frame = !isNaN(parseInt(frame)) ? parseInt(frame) : 0
|
this.stack.frame = this.stack.isExistMutiFrames ? parseInt(frame) : null
|
||||||
const ToolStateManager = cornerstoneTools.globalImageIdSpecificToolStateManager
|
const ToolStateManager = cornerstoneTools.globalImageIdSpecificToolStateManager
|
||||||
for (let t = 0; t < this.measuredTools.length; t++) {
|
for (let t = 0; t < this.measuredTools.length; t++) {
|
||||||
var toolType = this.measuredTools[t]
|
var toolType = this.measuredTools[t]
|
||||||
|
@ -1056,7 +1054,7 @@ export default {
|
||||||
this.stack.studyId = dicomSeries.studyId
|
this.stack.studyId = dicomSeries.studyId
|
||||||
this.stack.seriesNumber = dicomSeries.seriesNumber
|
this.stack.seriesNumber = dicomSeries.seriesNumber
|
||||||
this.stack.imageIds = dicomSeries.imageIds
|
this.stack.imageIds = dicomSeries.imageIds
|
||||||
this.stack.currentImageIdIndex = dicomSeries.imageIdIndex ? dicomSeries.imageIdIndex : 0
|
this.stack.currentImageIdIndex = dicomSeries.imageIdIndex && dicomSeries.imageIdIndex < dicomSeries.imageIds.length - 1 ? dicomSeries.imageIdIndex : 0
|
||||||
this.stack.imageIdIndex = dicomSeries.imageIdIndex
|
this.stack.imageIdIndex = dicomSeries.imageIdIndex
|
||||||
this.stack.firstImageLoading = true
|
this.stack.firstImageLoading = true
|
||||||
this.stack.visitTaskId = dicomSeries.visitTaskId
|
this.stack.visitTaskId = dicomSeries.visitTaskId
|
||||||
|
@ -1067,6 +1065,7 @@ export default {
|
||||||
this.stack.sliceThickness = dicomSeries.sliceThickness
|
this.stack.sliceThickness = dicomSeries.sliceThickness
|
||||||
this.stack.instanceCount = dicomSeries.instanceCount
|
this.stack.instanceCount = dicomSeries.instanceCount
|
||||||
this.stack.isExistsClinicalData = dicomSeries.isExistsClinicalData
|
this.stack.isExistsClinicalData = dicomSeries.isExistsClinicalData
|
||||||
|
this.stack.isExistMutiFrames = dicomSeries.isExistMutiFrames
|
||||||
// this.measuredData = dicomSeries.measuredData
|
// this.measuredData = dicomSeries.measuredData
|
||||||
var idx = this.visitTaskList.findIndex(i => i.VisitTaskId === dicomSeries.visitTaskId)
|
var idx = this.visitTaskList.findIndex(i => i.VisitTaskId === dicomSeries.visitTaskId)
|
||||||
this.stack.visitTaskNum = this.visitTaskList[idx].VisitTaskNum
|
this.stack.visitTaskNum = this.visitTaskList[idx].VisitTaskNum
|
||||||
|
@ -1087,7 +1086,7 @@ export default {
|
||||||
const imageInfo = this.getInstanceInfo(imageId)
|
const imageInfo = this.getInstanceInfo(imageId)
|
||||||
var instanceId = imageInfo.instanceId
|
var instanceId = imageInfo.instanceId
|
||||||
var frame = imageInfo.frame
|
var frame = imageInfo.frame
|
||||||
this.stack.frame = !isNaN(parseInt(frame)) ? parseInt(frame) : 0
|
this.stack.frame = this.stack.isExistMutiFrames ? parseInt(frame) : null
|
||||||
this.stack.instanceId = instanceId
|
this.stack.instanceId = instanceId
|
||||||
const ToolStateManager = cornerstoneTools.globalImageIdSpecificToolStateManager
|
const ToolStateManager = cornerstoneTools.globalImageIdSpecificToolStateManager
|
||||||
ToolStateManager.clearImageIdToolState(dicomSeries.imageIds)
|
ToolStateManager.clearImageIdToolState(dicomSeries.imageIds)
|
||||||
|
@ -1201,7 +1200,7 @@ export default {
|
||||||
const imageInfo = this.getInstanceInfo(image.imageId)
|
const imageInfo = this.getInstanceInfo(image.imageId)
|
||||||
var instanceId = imageInfo.instanceId
|
var instanceId = imageInfo.instanceId
|
||||||
var frame = imageInfo.frame
|
var frame = imageInfo.frame
|
||||||
this.stack.frame = !isNaN(parseInt(frame)) ? parseInt(frame) : 0
|
this.stack.frame = this.stack.isExistMutiFrames ? parseInt(frame) : null
|
||||||
this.stack.instanceId = instanceId
|
this.stack.instanceId = instanceId
|
||||||
this.height = (this.stack.currentImageIdIndex) * 100 / (this.stack.imageIds.length - 1)
|
this.height = (this.stack.currentImageIdIndex) * 100 / (this.stack.imageIds.length - 1)
|
||||||
this.resetWwwc()
|
this.resetWwwc()
|
||||||
|
@ -1276,7 +1275,7 @@ export default {
|
||||||
const imageInfo = this.getInstanceInfo(imageId)
|
const imageInfo = this.getInstanceInfo(imageId)
|
||||||
var instanceId = imageInfo.instanceId
|
var instanceId = imageInfo.instanceId
|
||||||
var frame = imageInfo.frame
|
var frame = imageInfo.frame
|
||||||
this.stack.frame = !isNaN(parseInt(frame)) ? parseInt(frame) : 0
|
this.stack.frame = this.stack.isExistMutiFrames ? parseInt(frame) : null
|
||||||
if (this.imageId !== instanceId) {
|
if (this.imageId !== instanceId) {
|
||||||
this.getOrientationMarker(e.detail.element)
|
this.getOrientationMarker(e.detail.element)
|
||||||
// 初次加载时,如果该影像存在标记,则以标记的窗宽窗位为初始化默认值,否则以序列的窗宽窗位为初始化默认值
|
// 初次加载时,如果该影像存在标记,则以标记的窗宽窗位为初始化默认值,否则以序列的窗宽窗位为初始化默认值
|
||||||
|
@ -1335,13 +1334,13 @@ export default {
|
||||||
const imageInfo = this.getInstanceInfo(imageId)
|
const imageInfo = this.getInstanceInfo(imageId)
|
||||||
var instanceId = imageInfo.instanceId
|
var instanceId = imageInfo.instanceId
|
||||||
var frame = imageInfo.frame
|
var frame = imageInfo.frame
|
||||||
this.stack.frame = !isNaN(parseInt(frame)) ? parseInt(frame) : 0
|
this.stack.frame = this.stack.isExistMutiFrames ? parseInt(frame) : null
|
||||||
if (e.detail.toolName === 'Length' || e.detail.toolName === 'ArrowAnnotate' || e.detail.toolName === 'RectangleRoi') {
|
if (e.detail.toolName === 'Length' || e.detail.toolName === 'ArrowAnnotate' || e.detail.toolName === 'RectangleRoi') {
|
||||||
const measureData = {}
|
const measureData = {}
|
||||||
measureData.studyId = this.stack.studyId
|
measureData.studyId = this.stack.studyId
|
||||||
measureData.seriesId = this.stack.seriesId
|
measureData.seriesId = this.stack.seriesId
|
||||||
measureData.instanceId = instanceId
|
measureData.instanceId = instanceId
|
||||||
measureData.frame = this.stack.frame ? this.stack.frame : 0
|
measureData.frame = this.stack.frame
|
||||||
measureData.data = e.detail.measurementData
|
measureData.data = e.detail.measurementData
|
||||||
measureData.type = e.detail.toolName
|
measureData.type = e.detail.toolName
|
||||||
measureData.thick = this.dicomInfo.thick
|
measureData.thick = this.dicomInfo.thick
|
||||||
|
@ -1455,7 +1454,7 @@ export default {
|
||||||
const imageInfo = this.getInstanceInfo(imageId)
|
const imageInfo = this.getInstanceInfo(imageId)
|
||||||
var instanceId = imageInfo.instanceId
|
var instanceId = imageInfo.instanceId
|
||||||
var frame = imageInfo.frame
|
var frame = imageInfo.frame
|
||||||
this.stack.frame = !isNaN(parseInt(frame)) ? parseInt(frame) : 0
|
this.stack.frame = this.stack.isExistMutiFrames ? parseInt(frame) : null
|
||||||
|
|
||||||
var uuid = measurementData.uuid
|
var uuid = measurementData.uuid
|
||||||
var idx = this.measureData.findIndex(item => item.MeasureData && item.MeasureData.data && item.MeasureData.data.uuid === uuid)
|
var idx = this.measureData.findIndex(item => item.MeasureData && item.MeasureData.data && item.MeasureData.data.uuid === uuid)
|
||||||
|
|
|
@ -878,7 +878,7 @@ export default {
|
||||||
activeSeries: {
|
activeSeries: {
|
||||||
immediate: true,
|
immediate: true,
|
||||||
handler(v) {
|
handler(v) {
|
||||||
console.log('activeSeries', 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
|
||||||
|
@ -1021,6 +1021,10 @@ export default {
|
||||||
if (!this.petctWindow) return
|
if (!this.petctWindow) return
|
||||||
this.petctWindow.postMessage({ type: 'readingPageUpdate', data: data }, window.location)
|
this.petctWindow.postMessage({ type: 'readingPageUpdate', data: data }, window.location)
|
||||||
})
|
})
|
||||||
|
DicomEvent.$on('resetPage', () => {
|
||||||
|
if (!this.petctWindow) return
|
||||||
|
this.petctWindow.postMessage({ type: 'resetPage' }, window.location)
|
||||||
|
})
|
||||||
DicomEvent.$on('setReadingState', (data) => {
|
DicomEvent.$on('setReadingState', (data) => {
|
||||||
if (!this.petctWindow) return
|
if (!this.petctWindow) return
|
||||||
this.petctWindow.postMessage({ type: 'setReadingState', data: data }, window.location)
|
this.petctWindow.postMessage({ type: 'setReadingState', data: data }, window.location)
|
||||||
|
@ -1058,28 +1062,30 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getWwcTpl() {
|
async getWwcTpl() {
|
||||||
const loading = this.$loading({ fullscreen: true })
|
// const loading = this.$loading({ fullscreen: true })
|
||||||
getUserWLTemplateList().then(res => {
|
try {
|
||||||
|
const res = await getUserWLTemplateList()
|
||||||
this.customWwcTpl = []
|
this.customWwcTpl = []
|
||||||
res.Result.map(i => {
|
res.Result.map(i => {
|
||||||
this.customWwcTpl.push({ label: i.TemplateName, wc: i.WL, ww: i.WW })
|
this.customWwcTpl.push({ label: i.TemplateName, wc: i.WL, ww: i.WW })
|
||||||
})
|
})
|
||||||
this.wwwcArr = [...this.defaultWwwc, ...this.customWwcTpl]
|
this.wwwcArr = [...this.defaultWwwc, ...this.customWwcTpl]
|
||||||
loading.close()
|
} catch (e) {
|
||||||
}).catch(() => { loading.close() })
|
console.log(e)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
getHotKeys() {
|
async getHotKeys() {
|
||||||
const loading = this.$loading({ fullscreen: true })
|
// const loading = this.$loading({ fullscreen: true })
|
||||||
getDoctorShortcutKey({ imageToolType: 0 }).then(res => {
|
try {
|
||||||
|
const res = await getDoctorShortcutKey({ imageToolType: 0 })
|
||||||
res.Result.map(item => {
|
res.Result.map(item => {
|
||||||
this.hotKeyList.push({ id: item.Id, altKey: item.AltKey, ctrlKey: item.CtrlKey, shiftKey: item.ShiftKey, metaKey: item.MetaKey, key: item.Keyboardkey, code: item.Code, text: item.Text, shortcutKeyEnum: item.ShortcutKeyEnum })
|
this.hotKeyList.push({ id: item.Id, altKey: item.AltKey, ctrlKey: item.CtrlKey, shiftKey: item.ShiftKey, metaKey: item.MetaKey, key: item.Keyboardkey, code: item.Code, text: item.Text, shortcutKeyEnum: item.ShortcutKeyEnum })
|
||||||
})
|
})
|
||||||
this.bindHotKey()
|
this.bindHotKey()
|
||||||
loading.close()
|
} catch (e) {
|
||||||
}).catch(() => {
|
console.log(e)
|
||||||
loading.close()
|
}
|
||||||
})
|
|
||||||
},
|
},
|
||||||
resetHotkeyList(arr) {
|
resetHotkeyList(arr) {
|
||||||
this.hotKeyList = []
|
this.hotKeyList = []
|
||||||
|
@ -1102,7 +1108,7 @@ export default {
|
||||||
var container = this.$refs['container']
|
var container = this.$refs['container']
|
||||||
// window.addEventListener
|
// window.addEventListener
|
||||||
container.addEventListener('keydown', event => {
|
container.addEventListener('keydown', event => {
|
||||||
console.log(event)
|
// console.log(event)
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
|
|
||||||
var idx = this.hotKeyList.findIndex(i => i.code === event.code && i.ctrlKey === event.ctrlKey && i.shiftKey === event.shiftKey && i.altKey === event.altKey)
|
var idx = this.hotKeyList.findIndex(i => i.code === event.code && i.ctrlKey === event.ctrlKey && i.shiftKey === event.shiftKey && i.altKey === event.altKey)
|
||||||
|
@ -1582,7 +1588,9 @@ export default {
|
||||||
var seriesIdx = studyList[studyIdx].SeriesList.findIndex(s => s.seriesId === seriesId)
|
var seriesIdx = studyList[studyIdx].SeriesList.findIndex(s => s.seriesId === seriesId)
|
||||||
if (seriesIdx > -1) {
|
if (seriesIdx > -1) {
|
||||||
var series = studyList[studyIdx].SeriesList[seriesIdx]
|
var series = studyList[studyIdx].SeriesList[seriesIdx]
|
||||||
var instanceIdx = series.instanceList.findIndex(imageId => !!~imageId.indexOf(instanceId))
|
const frame = this.visitTaskList[index].MeasureData[idx].MeasureData.frame
|
||||||
|
const filterStr = series.isExistMutiFrames ? `frame=${frame}&instanceId=${instanceId}` : `instanceId=${instanceId}`
|
||||||
|
var instanceIdx = series.imageIds.findIndex(imageId => imageId.includes(filterStr))
|
||||||
if (instanceIdx > -1) {
|
if (instanceIdx > -1) {
|
||||||
series.imageIdIndex = instanceIdx
|
series.imageIdIndex = instanceIdx
|
||||||
seriesInfo = series
|
seriesInfo = series
|
||||||
|
|
|
@ -72,6 +72,13 @@ import DicomEvent from './DicomEvent'
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import { getToken } from '@/utils/auth'
|
import { getToken } from '@/utils/auth'
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
|
import * as dicomParser from 'dicom-parser'
|
||||||
|
import * as cornerstone from 'cornerstone-core'
|
||||||
|
import * as cornerstoneWADOImageLoader from 'cornerstone-wado-image-loader'
|
||||||
|
cornerstoneWADOImageLoader.external.dicomParser = dicomParser
|
||||||
|
cornerstoneWADOImageLoader.external.cornerstone = cornerstone
|
||||||
|
const maximumSizeInBytes = 1024 * 1024 * 1024 * 6
|
||||||
|
cornerstone.imageCache.setMaximumSizeBytes(maximumSizeInBytes)
|
||||||
export default {
|
export default {
|
||||||
name: 'ReadPage',
|
name: 'ReadPage',
|
||||||
components: {
|
components: {
|
||||||
|
@ -210,14 +217,20 @@ export default {
|
||||||
this.$refs[this.activeTaskVisitId][0].selectSeries(data)
|
this.$refs[this.activeTaskVisitId][0].selectSeries(data)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
cornerstone.events.addEventListener('cornerstoneimageloadprogress', this.cornerstoneimageloadprogress)
|
||||||
|
window.addEventListener('beforeunload', e => {
|
||||||
|
cornerstone.imageCache.purgeCache()
|
||||||
|
})
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
|
cornerstone.imageCache.purgeCache()
|
||||||
DicomEvent.$off('getNextVisitInfo')
|
DicomEvent.$off('getNextVisitInfo')
|
||||||
DicomEvent.$off('toggleSeries')
|
DicomEvent.$off('toggleSeries')
|
||||||
DicomEvent.$off('isCanActiveNoneDicomTool')
|
DicomEvent.$off('isCanActiveNoneDicomTool')
|
||||||
DicomEvent.$off('removeNoneDicomMeasureData')
|
DicomEvent.$off('removeNoneDicomMeasureData')
|
||||||
DicomEvent.$off('addNoneDicomMeasureData')
|
DicomEvent.$off('addNoneDicomMeasureData')
|
||||||
DicomEvent.$off('selectSeries')
|
DicomEvent.$off('selectSeries')
|
||||||
|
window.removeEventListener('beforeunload', e => { cornerstone.imageCache.purgeCache() })
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async getVisitInfo() {
|
async getVisitInfo() {
|
||||||
|
@ -400,7 +413,7 @@ export default {
|
||||||
idx > -1 ? obj = seriesList[idx] : ''
|
idx > -1 ? obj = seriesList[idx] : ''
|
||||||
}
|
}
|
||||||
if (obj) {
|
if (obj) {
|
||||||
const index = Math.floor(obj.imageIds.length * ((baseSeries.imageIdIndex + 1) / baseSeries.instanceCount))
|
const index = Math.floor(obj.imageIds.length * ((baseSeries.imageIdIndex + 1) / baseSeries.imageIds))
|
||||||
obj.imageIdIndex = index > 0 ? index - 1 : 0
|
obj.imageIdIndex = index > 0 ? index - 1 : 0
|
||||||
}
|
}
|
||||||
return obj
|
return obj
|
||||||
|
@ -464,7 +477,10 @@ export default {
|
||||||
var seriesIdx = studyList[studyIdx].SeriesList.findIndex(s => s.seriesId === seriesId)
|
var seriesIdx = studyList[studyIdx].SeriesList.findIndex(s => s.seriesId === seriesId)
|
||||||
if (seriesIdx > -1) {
|
if (seriesIdx > -1) {
|
||||||
var series = studyList[studyIdx].SeriesList[seriesIdx]
|
var series = studyList[studyIdx].SeriesList[seriesIdx]
|
||||||
var instanceIdx = series.instanceList.findIndex(imageId => !!~imageId.indexOf(instanceId))
|
// var instanceIdx = series.instanceList.findIndex(imageId => !!~imageId.indexOf(instanceId))
|
||||||
|
const frame = this.visitTaskList[index].MeasureData[idx].MeasureData.frame
|
||||||
|
const filterStr = series.isExistMutiFrames ? `frame=${frame}&instanceId=${instanceId}` : `instanceId=${instanceId}`
|
||||||
|
var instanceIdx = series.imageIds.findIndex(imageId => imageId.includes(filterStr))
|
||||||
if (instanceIdx > -1) {
|
if (instanceIdx > -1) {
|
||||||
series.imageIdIndex = instanceIdx
|
series.imageIdIndex = instanceIdx
|
||||||
// series.studyIndex = studyIdx
|
// series.studyIndex = studyIdx
|
||||||
|
@ -485,6 +501,16 @@ export default {
|
||||||
seriesInfo = this.getLinkedSeries(baseSeries, visitTaskId, visitTaskIdx)
|
seriesInfo = this.getLinkedSeries(baseSeries, visitTaskId, visitTaskIdx)
|
||||||
}
|
}
|
||||||
return seriesInfo
|
return seriesInfo
|
||||||
|
},
|
||||||
|
cornerstoneimageloadprogress(e) {
|
||||||
|
const imageId = e.detail.imageId
|
||||||
|
const params = {}
|
||||||
|
const searchParams = new URLSearchParams(imageId.split('?')[1])
|
||||||
|
for (const [key, value] of searchParams.entries()) {
|
||||||
|
params[key] = value
|
||||||
|
}
|
||||||
|
params.percentComplete = e.detail.percentComplete
|
||||||
|
store.dispatch('reading/setImageLoadedProgress', params)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -158,18 +158,13 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import * as dicomParser from 'dicom-parser'
|
// import * as cornerstone from 'cornerstone-core'
|
||||||
import * as cornerstone from 'cornerstone-core'
|
|
||||||
import * as cornerstoneWADOImageLoader from 'cornerstone-wado-image-loader'
|
|
||||||
import requestPoolManager from '@/utils/request-pool'
|
import requestPoolManager from '@/utils/request-pool'
|
||||||
import DicomEvent from './DicomEvent'
|
import DicomEvent from './DicomEvent'
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import SrList from './SrList'
|
import SrList from './SrList'
|
||||||
cornerstoneWADOImageLoader.external.dicomParser = dicomParser
|
|
||||||
cornerstoneWADOImageLoader.external.cornerstone = cornerstone
|
|
||||||
const maximumSizeInBytes = 1024 * 1024 * 1024 * 6
|
|
||||||
cornerstone.imageCache.setMaximumSizeBytes(maximumSizeInBytes)
|
|
||||||
export default {
|
export default {
|
||||||
name: 'StudyList',
|
name: 'StudyList',
|
||||||
components: { SrList },
|
components: { SrList },
|
||||||
|
@ -218,9 +213,7 @@ export default {
|
||||||
srDialogVisible: false,
|
srDialogVisible: false,
|
||||||
srInfo: {},
|
srInfo: {},
|
||||||
digitPlaces: 2,
|
digitPlaces: 2,
|
||||||
visitTaskIdx: -1,
|
visitTaskIdx: -1
|
||||||
currentLoadIns: [],
|
|
||||||
keySeriesLoad: []
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -270,18 +263,18 @@ export default {
|
||||||
// }
|
// }
|
||||||
// })
|
// })
|
||||||
// const debouncedInputHandler = this.debounce(this.cornerstoneimageloadprogress, 100)
|
// 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)
|
||||||
// cornerstone.events.addEventListener('cornerstoneimagecachechanged', this.cornerstoneimagecachechanged)
|
// cornerstone.events.addEventListener('cornerstoneimagecachechanged', this.cornerstoneimagecachechanged)
|
||||||
window.addEventListener('beforeunload', e => {
|
// window.addEventListener('beforeunload', e => {
|
||||||
cornerstone.imageCache.purgeCache()
|
// cornerstone.imageCache.purgeCache()
|
||||||
})
|
// })
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
cornerstone.imageCache.purgeCache()
|
// cornerstone.imageCache.purgeCache()
|
||||||
DicomEvent.$off('refreshStudyListMeasureData')
|
DicomEvent.$off('refreshStudyListMeasureData')
|
||||||
window.removeEventListener('beforeunload', e => { cornerstone.imageCache.purgeCache() })
|
// window.removeEventListener('beforeunload', e => { cornerstone.imageCache.purgeCache() })
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
debounce(fn, delay) {
|
debounce(fn, delay) {
|
||||||
|
@ -360,8 +353,27 @@ export default {
|
||||||
this.studyIndex = sIdx
|
this.studyIndex = sIdx
|
||||||
this.seriesIndex = 0
|
this.seriesIndex = 0
|
||||||
this.activeNames = [`${this.studyList[sIdx].StudyId}`]
|
this.activeNames = [`${this.studyList[sIdx].StudyId}`]
|
||||||
|
// 下载关键序列
|
||||||
this.loadImages(this.visitTaskList[idx])
|
const i = this.studyList.findIndex(i => i.IsCriticalSequence)
|
||||||
|
if (i > -1 && this.studyList[i].SeriesList[0].length > 0) {
|
||||||
|
const series = this.studyList[i].SeriesList[0]
|
||||||
|
if (!series.loadStatus) {
|
||||||
|
let priority = parseInt(new Date().getTime())
|
||||||
|
if (series.isExistMutiFrames) {
|
||||||
|
series.instanceInfoList.map(image => {
|
||||||
|
priority = priority - 1
|
||||||
|
this.imageList.push({ imageId: image.ImageId, seriesId: series.seriesId, studyIndex: i, seriesIndex: 0, visitTaskId: series.visitTaskId, priority })
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
series.imageIds.map(imageId => {
|
||||||
|
priority = priority - 1
|
||||||
|
this.imageList.push({ imageId: imageId, seriesId: series.seriesId, studyIndex: i, seriesIndex: 0, visitTaskId: series.visitTaskId, priority })
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.loopLoad()
|
||||||
|
// this.loadImages(this.visitTaskList[idx])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.isRender = true
|
this.isRender = true
|
||||||
|
@ -369,7 +381,6 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
async getInitSeries() {
|
async getInitSeries() {
|
||||||
console.log('getInitSeries')
|
|
||||||
var seriesList = []
|
var seriesList = []
|
||||||
var isReadingTaskViewInOrder = parseInt(this.$router.currentRoute.query.isReadingTaskViewInOrder)
|
var isReadingTaskViewInOrder = parseInt(this.$router.currentRoute.query.isReadingTaskViewInOrder)
|
||||||
var idx = this.visitTaskList.findIndex(i => i.VisitTaskId === this.visitTaskId)
|
var idx = this.visitTaskList.findIndex(i => i.VisitTaskId === this.visitTaskId)
|
||||||
|
@ -444,9 +455,10 @@ export default {
|
||||||
const sdIndx = studyList.findIndex(sd => sd.StudyId === measureDatas[i].StudyId)
|
const sdIndx = studyList.findIndex(sd => sd.StudyId === measureDatas[i].StudyId)
|
||||||
const seriesList = studyList[sdIndx].SeriesList
|
const seriesList = studyList[sdIndx].SeriesList
|
||||||
const srIdx = seriesList.findIndex(sr => sr.seriesId === measureDatas[i].SeriesId)
|
const srIdx = seriesList.findIndex(sr => sr.seriesId === measureDatas[i].SeriesId)
|
||||||
// const instanceList = seriesList[srIdx].imageIds
|
// const instanceList = seriesList[srIdx].instanceList
|
||||||
const instanceList = seriesList[srIdx].instanceList
|
const imageIds = seriesList[srIdx].imageIds
|
||||||
const isIdx = instanceList.findIndex(is => is.includes(measureDatas[i].InstanceId))
|
const filterStr = seriesList[srIdx].isExistMutiFrames ? `frame=${measureDatas[i].MeasureData.frame}&instanceId=${measureDatas[i].InstanceId}` : `instanceId=${measureDatas[i].InstanceId}`
|
||||||
|
const isIdx = imageIds.findIndex(is => is.includes(filterStr))
|
||||||
const series = seriesList[srIdx]
|
const series = seriesList[srIdx]
|
||||||
series.imageIdIndex = isIdx
|
series.imageIdIndex = isIdx
|
||||||
|
|
||||||
|
@ -517,8 +529,9 @@ export default {
|
||||||
const seriesList = studyList[sdIndx].SeriesList
|
const seriesList = studyList[sdIndx].SeriesList
|
||||||
const srIdx = seriesList.findIndex(sr => sr.seriesId === measureDatas[mIdx].SeriesId)
|
const srIdx = seriesList.findIndex(sr => sr.seriesId === measureDatas[mIdx].SeriesId)
|
||||||
// const instanceList = seriesList[srIdx].imageIds
|
// const instanceList = seriesList[srIdx].imageIds
|
||||||
const instanceList = seriesList[srIdx].instanceList
|
const imageIds = seriesList[srIdx].imageIds
|
||||||
const isIdx = instanceList.findIndex(is => is.includes(measureDatas[mIdx].InstanceId))
|
const filterStr = seriesList[srIdx].isExistMutiFrames ? `frame=${measureDatas[mIdx].MeasureData.frame}&instanceId=${measureDatas[mIdx].InstanceId}` : `instanceId=${measureDatas[mIdx].InstanceId}`
|
||||||
|
const isIdx = imageIds.findIndex(is => is.includes(filterStr))
|
||||||
const series = seriesList[srIdx]
|
const series = seriesList[srIdx]
|
||||||
series.imageIdIndex = isIdx
|
series.imageIdIndex = isIdx
|
||||||
|
|
||||||
|
@ -617,6 +630,7 @@ export default {
|
||||||
this.seriesIndex = seriesIndex
|
this.seriesIndex = seriesIndex
|
||||||
this.studyList[studyIndex].SeriesList[seriesIndex].measureData = this.measureData
|
this.studyList[studyIndex].SeriesList[seriesIndex].measureData = this.measureData
|
||||||
var dicomStatck = this.studyList[studyIndex].SeriesList[seriesIndex]
|
var dicomStatck = this.studyList[studyIndex].SeriesList[seriesIndex]
|
||||||
|
dicomStatck.imageIdIndex = 0
|
||||||
this.$emit('loadImageStack', dicomStatck)
|
this.$emit('loadImageStack', dicomStatck)
|
||||||
if (!series.loadStatus && series.modality !== 'SR') {
|
if (!series.loadStatus && series.modality !== 'SR') {
|
||||||
this.loopLoadStatus = -1
|
this.loopLoadStatus = -1
|
||||||
|
@ -658,13 +672,14 @@ export default {
|
||||||
},
|
},
|
||||||
showMultiFrames(studyIndex, series, seriesIndex, instanceInfo) {
|
showMultiFrames(studyIndex, series, seriesIndex, instanceInfo) {
|
||||||
this.currentSeriesIndex = seriesIndex
|
this.currentSeriesIndex = seriesIndex
|
||||||
|
var idx = this.visitTaskList.findIndex(i => i.VisitTaskId === this.visitTaskId)
|
||||||
const imageIds = []
|
const imageIds = []
|
||||||
if (instanceInfo.NumberOfFrames && instanceInfo.NumberOfFrames > 1) {
|
if (instanceInfo.NumberOfFrames && instanceInfo.NumberOfFrames > 1) {
|
||||||
for (let j = 0; j < instanceInfo.NumberOfFrames; j++) {
|
for (let j = 0; j < instanceInfo.NumberOfFrames; j++) {
|
||||||
imageIds.push(`wadouri:${localStorage.getItem('location') !== 'USA' ? this.OSSclientConfig.basePath : this.OSSclientConfig.basePath}${instanceInfo.Path}?frame=${j}&instanceId=${instanceInfo.Id}&visitTaskId=${this.visitTaskId}&idx=${studyIndex}|${seriesIndex}`)
|
imageIds.push(`wadouri:${localStorage.getItem('location') !== 'USA' ? this.OSSclientConfig.basePath : this.OSSclientConfig.basePath}${instanceInfo.Path}?frame=${j}&instanceId=${instanceInfo.Id}&visitTaskId=${this.visitTaskId}&idx=${studyIndex}|${seriesIndex}|${idx}`)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
imageIds.push(`wadouri:${localStorage.getItem('location') !== 'USA' ? this.OSSclientConfig.basePath : this.OSSclientConfig.basePath}${instanceInfo.Path}?instanceId=${instanceInfo.Id}&visitTaskId=${this.visitTaskId}&idx=${studyIndex}|${seriesIndex}`)
|
imageIds.push(`wadouri:${localStorage.getItem('location') !== 'USA' ? this.OSSclientConfig.basePath : this.OSSclientConfig.basePath}${instanceInfo.Path}?instanceId=${instanceInfo.Id}&visitTaskId=${this.visitTaskId}&idx=${studyIndex}|${seriesIndex}|${idx}`)
|
||||||
}
|
}
|
||||||
this.studyIndex = studyIndex
|
this.studyIndex = studyIndex
|
||||||
this.seriesIndex = seriesIndex
|
this.seriesIndex = seriesIndex
|
||||||
|
@ -712,7 +727,8 @@ export default {
|
||||||
var activeNames = `${this.studyList[obj.studyIndex].StudyId}`
|
var activeNames = `${this.studyList[obj.studyIndex].StudyId}`
|
||||||
if (this.activeNames.includes(activeNames)) return
|
if (this.activeNames.includes(activeNames)) return
|
||||||
this.activeNames.push(activeNames)
|
this.activeNames.push(activeNames)
|
||||||
this.loadImages(this.visitTaskList[idx])
|
// console.log('setSeriesActive', obj)
|
||||||
|
this.loadImages(obj)
|
||||||
},
|
},
|
||||||
selectSeries(obj) {
|
selectSeries(obj) {
|
||||||
var seriseList = this.studyList.map(s => s.SeriesList).flat()
|
var seriseList = this.studyList.map(s => s.SeriesList).flat()
|
||||||
|
@ -737,10 +753,27 @@ export default {
|
||||||
var activeNames = `${this.studyList[series.studyIndex].StudyId}`
|
var activeNames = `${this.studyList[series.studyIndex].StudyId}`
|
||||||
if (this.activeNames.includes(activeNames)) return
|
if (this.activeNames.includes(activeNames)) return
|
||||||
this.activeNames.push(activeNames)
|
this.activeNames.push(activeNames)
|
||||||
this.loadImages(this.visitTaskList[idx])
|
this.loadImages(series)
|
||||||
store.dispatch('reading/setActiveSeries', series)
|
store.dispatch('reading/setActiveSeries', series)
|
||||||
},
|
},
|
||||||
loadImages(taskInfo) {
|
loadImages(series) {
|
||||||
|
var priority = parseInt(new Date().getTime())
|
||||||
|
if (!series.loadStatus && series.isDicom && series.modality !== 'SR') {
|
||||||
|
if (series.isExistMutiFrames) {
|
||||||
|
series.instanceInfoList.map(image => {
|
||||||
|
priority = priority - 1
|
||||||
|
this.imageList.push({ imageId: image.ImageId, seriesId: series.seriesId, studyIndex: series.studyIndex, seriesIndex: series.seriesIndex, visitTaskId: series.visitTaskId, priority })
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
series.imageIds.map(imageId => {
|
||||||
|
priority = priority - 1
|
||||||
|
this.imageList.push({ imageId: imageId, seriesId: series.seriesId, studyIndex: series.studyIndex, seriesIndex: series.seriesIndex, visitTaskId: series.visitTaskId, priority })
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.loopLoad()
|
||||||
|
},
|
||||||
|
loadImages1(taskInfo) {
|
||||||
// const isBaseLineTask = taskInfo.IsBaseLineTask
|
// const isBaseLineTask = taskInfo.IsBaseLineTask
|
||||||
const isCurrentTask = taskInfo.IsCurrentTask
|
const isCurrentTask = taskInfo.IsCurrentTask
|
||||||
// var priority = isCurrentTask ? parseInt(new Date().getTime()) : 999
|
// var priority = isCurrentTask ? parseInt(new Date().getTime()) : 999
|
||||||
|
@ -832,141 +865,6 @@ export default {
|
||||||
console.log('stopLoadSeries')
|
console.log('stopLoadSeries')
|
||||||
requestPoolManager.removeTask(series.seriesId)
|
requestPoolManager.removeTask(series.seriesId)
|
||||||
this.$set(this.studyList[studyIndex].SeriesList[seriesIndex], 'isLoading', false)
|
this.$set(this.studyList[studyIndex].SeriesList[seriesIndex], 'isLoading', false)
|
||||||
},
|
|
||||||
async imageLoaded(image, seriesUid) {
|
|
||||||
// await store.dispatch('reading/updateStudyList', { visitTaskId: image.visitTaskId, imageId: image.imageId, seriesUid })
|
|
||||||
// console.log(this.studyList[image.studyIndex].SeriesList[image.seriesIndex])
|
|
||||||
if (image.studyIndex > -1 && image.seriesIndex > -1) {
|
|
||||||
var prefetchInstanceCount = this.studyList[image.studyIndex].SeriesList[image.seriesIndex].prefetchInstanceCount
|
|
||||||
var instanceCount = this.studyList[image.studyIndex].SeriesList[image.seriesIndex].instanceCount
|
|
||||||
if (this.studyList[image.studyIndex].SeriesList[image.seriesIndex].imageloadedArr.indexOf(image.imageId) < 0) {
|
|
||||||
this.studyList[image.studyIndex].SeriesList[image.seriesIndex].imageloadedArr.push(image.imageId)
|
|
||||||
prefetchInstanceCount = prefetchInstanceCount + 1
|
|
||||||
this.studyList[image.studyIndex].SeriesList[image.seriesIndex].prefetchInstanceCount = prefetchInstanceCount
|
|
||||||
}
|
|
||||||
if (prefetchInstanceCount >= instanceCount) {
|
|
||||||
this.studyList[image.studyIndex].SeriesList[image.seriesIndex].prefetchInstanceCount = this.studyList[image.studyIndex].SeriesList[image.seriesIndex].instanceCount
|
|
||||||
// 设置当前序列状态为已下载完成
|
|
||||||
this.studyList[image.studyIndex].SeriesList[image.seriesIndex].loadStatus = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// store.dispatch('reading/updateSeriesList', { visitTaskindex: this.visitTaskIdx, studyIndex: image.studyIndex, seriesIndex: image.seriesIndex, imageId: image.imageId })
|
|
||||||
},
|
|
||||||
// instance下载成功回调
|
|
||||||
async cornerstoneImageLoaded(e) {
|
|
||||||
// var idx = this.visitTaskList.findIndex(i => i.VisitTaskId === this.visitTaskId)
|
|
||||||
// if (idx === -1) return
|
|
||||||
// this.studyList = this.visitTaskList[idx].StudyList
|
|
||||||
// if (!this.studyList || this.studyList.length === 0) {
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
// if (!this.visitTaskList[idx].IsInit) {
|
|
||||||
// const loading = this.$loading({ fullscreen: true })
|
|
||||||
// await store.dispatch('reading/getMeasuredData', this.visitTaskList[idx].VisitTaskId)
|
|
||||||
// await store.dispatch('reading/getStudyInfo', { trialId: this.trialId, subjectVisitId: this.visitTaskList[idx].VisitId, visitTaskId: this.visitTaskList[idx].VisitTaskId, taskBlindName: this.visitTaskList[idx].TaskBlindName })
|
|
||||||
// await store.dispatch('reading/getReadingQuestionAndAnswer', { trialId: this.trialId, visitTaskId: this.visitTaskList[idx].VisitTaskId })
|
|
||||||
// await store.dispatch('reading/getDicomReadingQuestionAnswer', { trialId: this.trialId, visitTaskId: this.visitTaskList[idx].VisitTaskId })
|
|
||||||
// await store.dispatch('reading/setStatus', { visitTaskId: this.visitTaskList[idx].VisitTaskId })
|
|
||||||
// loading.close()
|
|
||||||
// }
|
|
||||||
// await store.dispatch('reading/updateStudyList', { visitTaskId: this.visitTaskId, imageId: e.detail.image.imageId, seriesUid: e.detail.image.data.string('x0020000e') })
|
|
||||||
// const uri = e.detail.image.sharedCacheKey
|
|
||||||
// const index = this.cachedImages.findIndex(item => item.uri === uri)
|
|
||||||
// if (index === -1) {
|
|
||||||
// this.cachedImages.push({ uri: uri, timestamp: new Date().getTime() })
|
|
||||||
// } else {
|
|
||||||
// this.cachedImages[index].timestamp = new Date().getTime()
|
|
||||||
// }
|
|
||||||
// var imageId = e.detail.image.imageId
|
|
||||||
// var seriesUid = e.detail.image.data.string('x0020000e')
|
|
||||||
// var studyIndex = -1
|
|
||||||
// var seriesIndex = -1
|
|
||||||
// for (let i = 0; i < this.studyList.length; ++i) {
|
|
||||||
// for (let j = 0; j < this.studyList[i].SeriesList.length; ++j) {
|
|
||||||
// if (this.studyList[i].SeriesList[j].seriesUid === seriesUid) {
|
|
||||||
// studyIndex = i
|
|
||||||
// seriesIndex = j
|
|
||||||
// break
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// if (studyIndex > 0) break
|
|
||||||
// }
|
|
||||||
// if (seriesIndex < 0) return
|
|
||||||
|
|
||||||
// const imageIdIndex = this.studyList[studyIndex].SeriesList[seriesIndex].imageIds.indexOf(imageId)
|
|
||||||
// if (imageIdIndex < 0) return
|
|
||||||
// if (this.studyList[studyIndex].SeriesList[seriesIndex].imageloadedArr.indexOf(imageId) < 0) {
|
|
||||||
// if (this.studyList[studyIndex].SeriesList[seriesIndex].prefetchInstanceCount >= this.studyList[studyIndex].SeriesList[seriesIndex].instanceCount) {
|
|
||||||
// // 设置当前序列状态为已下载完成
|
|
||||||
// this.studyList[studyIndex].SeriesList[seriesIndex].loadStatus = true
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
},
|
|
||||||
cornerstoneimageloadprogress(e) {
|
|
||||||
const imageId = e.detail.imageId
|
|
||||||
const params = {}
|
|
||||||
const searchParams = new URLSearchParams(imageId.split('?')[1])
|
|
||||||
for (const [key, value] of searchParams.entries()) {
|
|
||||||
params[key] = value
|
|
||||||
}
|
|
||||||
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])
|
|
||||||
// 关键序列处理
|
|
||||||
const seriesId = this.studyList[studyIndex].SeriesList[seriesIndex].seriesId
|
|
||||||
const i = this.keySeriesLoad.findIndex(i => i.seriesId === seriesId)
|
|
||||||
if (this.studyList[studyIndex].IsCriticalSequence && percentComplete >= 100) {
|
|
||||||
// 关键序列处理
|
|
||||||
if (i === -1) {
|
|
||||||
this.keySeriesLoad.push({ seriesId: seriesId, loadCount: 1, imageIds: [imageId] })
|
|
||||||
} else {
|
|
||||||
++this.keySeriesLoad[i].loadCount
|
|
||||||
this.keySeriesLoad[i].imageIds.push(imageId)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!this.studyList[studyIndex].IsCriticalSequence && i > -1) {
|
|
||||||
this.studyList[studyIndex].SeriesList[seriesIndex].prefetchInstanceCount = this.studyList[studyIndex].SeriesList[seriesIndex].prefetchInstanceCount + 100 * this.keySeriesLoad[i].loadCount
|
|
||||||
this.studyList[studyIndex].SeriesList[seriesIndex].imageloadedArr = [this.studyList[studyIndex].SeriesList[seriesIndex].imageloadedArr, this.keySeriesLoad[i].imageIds]
|
|
||||||
this.keySeriesLoad.splice(i, 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.currentLoadIns.splice(i, 1)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (percentComplete !== 100) {
|
|
||||||
this.currentLoadIns.push({ imageId, percentComplete })
|
|
||||||
}
|
|
||||||
prefetchInstanceCount = prefetchInstanceCount + percentComplete
|
|
||||||
}
|
|
||||||
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()
|
|
||||||
console.log(cacheInfo)
|
|
||||||
},
|
|
||||||
cornerstoneimagecachefull(e) {
|
|
||||||
console.log('超过内存了')
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -222,7 +222,8 @@ export default {
|
||||||
taskBlindName: '',
|
taskBlindName: '',
|
||||||
frame: null,
|
frame: null,
|
||||||
imageRendered: false,
|
imageRendered: false,
|
||||||
isExistsClinicalData: false
|
isExistsClinicalData: false,
|
||||||
|
isExistMutiFrames: false
|
||||||
// preventCache: true
|
// preventCache: true
|
||||||
},
|
},
|
||||||
dicomInfo: {
|
dicomInfo: {
|
||||||
|
@ -746,7 +747,7 @@ export default {
|
||||||
const imageInfo = this.getInstanceInfo(imageId)
|
const imageInfo = this.getInstanceInfo(imageId)
|
||||||
var instanceId = imageInfo.instanceId
|
var instanceId = imageInfo.instanceId
|
||||||
var frame = imageInfo.frame
|
var frame = imageInfo.frame
|
||||||
this.stack.frame = !isNaN(parseInt(frame)) ? parseInt(frame) : 0
|
this.stack.frame = this.stack.isExistMutiFrames ? parseInt(frame) : null
|
||||||
const ToolStateManager = cornerstoneTools.globalImageIdSpecificToolStateManager
|
const ToolStateManager = cornerstoneTools.globalImageIdSpecificToolStateManager
|
||||||
for (var m = 0; m < this.measuredTools.length; m++) {
|
for (var m = 0; m < this.measuredTools.length; m++) {
|
||||||
var toolType = this.measuredTools[m]
|
var toolType = this.measuredTools[m]
|
||||||
|
@ -868,7 +869,6 @@ export default {
|
||||||
return seriesList[seriesIdx].loadStatus ? 1 : 0
|
return seriesList[seriesIdx].loadStatus ? 1 : 0
|
||||||
},
|
},
|
||||||
renderMeasuredData(e) {
|
renderMeasuredData(e) {
|
||||||
this.stack.frame = !isNaN(parseInt(this.stack.frame)) ? parseInt(this.stack.frame) : 0
|
|
||||||
var idx = this.visitTaskList.findIndex(i => i.VisitTaskId === this.stack.visitTaskId)
|
var idx = this.visitTaskList.findIndex(i => i.VisitTaskId === this.stack.visitTaskId)
|
||||||
if (idx === -1) return
|
if (idx === -1) return
|
||||||
this.measureData = this.visitTaskList[idx].MeasureData
|
this.measureData = this.visitTaskList[idx].MeasureData
|
||||||
|
@ -889,9 +889,9 @@ export default {
|
||||||
cornerstoneTools.setToolPassiveForElement(element, data.MeasureData.type, { mouseButtonMask: 1 })
|
cornerstoneTools.setToolPassiveForElement(element, data.MeasureData.type, { mouseButtonMask: 1 })
|
||||||
|
|
||||||
}
|
}
|
||||||
// console.log('renderMeasuredData', this.stack.frame)
|
|
||||||
|
|
||||||
if (this.stack.instanceId.includes(data.InstanceId) && ((data.NumberOfFrames === this.stack.frame) || !data.NumberOfFrames) && data.MeasureData) {
|
if (this.stack.instanceId.includes(data.InstanceId) && ((this.stack.isExistMutiFrames && data.MeasureData.frame === this.stack.frame && data.MeasureData) || (!this.stack.isExistMutiFrames && data.MeasureData))) {
|
||||||
|
// console.log('renderMeasuredData', this.stack.frame,data.MeasureData.frame,this.stack.isExistMutiFrames)
|
||||||
const toolState = ToolStateManager.getImageIdToolState(e.detail.image.imageId, data.MeasureData.type)
|
const toolState = ToolStateManager.getImageIdToolState(e.detail.image.imageId, data.MeasureData.type)
|
||||||
if (toolState && toolState.data.length > 0) {
|
if (toolState && toolState.data.length > 0) {
|
||||||
var idx = toolState.data.findIndex(item => item.uuid === data.MeasureData.data.uuid)
|
var idx = toolState.data.findIndex(item => item.uuid === data.MeasureData.data.uuid)
|
||||||
|
@ -978,7 +978,7 @@ export default {
|
||||||
const imageInfo = this.getInstanceInfo(imageId)
|
const imageInfo = this.getInstanceInfo(imageId)
|
||||||
var instanceId = imageInfo.instanceId
|
var instanceId = imageInfo.instanceId
|
||||||
var frame = imageInfo.frame
|
var frame = imageInfo.frame
|
||||||
this.stack.frame = !isNaN(parseInt(frame)) ? parseInt(frame) : 0
|
this.stack.frame = this.stack.isExistMutiFrames ? parseInt(frame) : null
|
||||||
const ToolStateManager = cornerstoneTools.globalImageIdSpecificToolStateManager
|
const ToolStateManager = cornerstoneTools.globalImageIdSpecificToolStateManager
|
||||||
for (let t = 0; t < this.measuredTools.length; t++) {
|
for (let t = 0; t < this.measuredTools.length; t++) {
|
||||||
var toolType = this.measuredTools[t]
|
var toolType = this.measuredTools[t]
|
||||||
|
@ -1039,7 +1039,7 @@ export default {
|
||||||
this.stack.studyId = dicomSeries.studyId
|
this.stack.studyId = dicomSeries.studyId
|
||||||
this.stack.seriesNumber = dicomSeries.seriesNumber
|
this.stack.seriesNumber = dicomSeries.seriesNumber
|
||||||
this.stack.imageIds = dicomSeries.imageIds
|
this.stack.imageIds = dicomSeries.imageIds
|
||||||
this.stack.currentImageIdIndex = dicomSeries.imageIdIndex ? dicomSeries.imageIdIndex : 0
|
this.stack.currentImageIdIndex = dicomSeries.imageIdIndex && dicomSeries.imageIdIndex < dicomSeries.imageIds.length - 1 ? dicomSeries.imageIdIndex : 0
|
||||||
this.stack.imageIdIndex = dicomSeries.imageIdIndex
|
this.stack.imageIdIndex = dicomSeries.imageIdIndex
|
||||||
this.stack.firstImageLoading = true
|
this.stack.firstImageLoading = true
|
||||||
this.stack.visitTaskId = dicomSeries.visitTaskId
|
this.stack.visitTaskId = dicomSeries.visitTaskId
|
||||||
|
@ -1063,7 +1063,7 @@ export default {
|
||||||
const imageInfo = this.getInstanceInfo(imageId)
|
const imageInfo = this.getInstanceInfo(imageId)
|
||||||
var instanceId = imageInfo.instanceId
|
var instanceId = imageInfo.instanceId
|
||||||
var frame = imageInfo.frame
|
var frame = imageInfo.frame
|
||||||
this.stack.frame = !isNaN(parseInt(frame)) ? parseInt(frame) : 0
|
this.stack.frame = this.stack.isExistMutiFrames ? parseInt(frame) : null
|
||||||
this.stack.instanceId = instanceId
|
this.stack.instanceId = instanceId
|
||||||
const ToolStateManager = cornerstoneTools.globalImageIdSpecificToolStateManager
|
const ToolStateManager = cornerstoneTools.globalImageIdSpecificToolStateManager
|
||||||
ToolStateManager.clearImageIdToolState(dicomSeries.imageIds)
|
ToolStateManager.clearImageIdToolState(dicomSeries.imageIds)
|
||||||
|
@ -1178,7 +1178,7 @@ export default {
|
||||||
const imageInfo = this.getInstanceInfo(image.imageId)
|
const imageInfo = this.getInstanceInfo(image.imageId)
|
||||||
var instanceId = imageInfo.instanceId
|
var instanceId = imageInfo.instanceId
|
||||||
var frame = imageInfo.frame
|
var frame = imageInfo.frame
|
||||||
this.stack.frame = !isNaN(parseInt(frame)) ? parseInt(frame) : 0
|
this.stack.frame = this.stack.isExistMutiFrames ? parseInt(frame) : null
|
||||||
this.stack.instanceId = instanceId
|
this.stack.instanceId = instanceId
|
||||||
this.height = (this.stack.currentImageIdIndex) * 100 / (this.stack.imageIds.length - 1)
|
this.height = (this.stack.currentImageIdIndex) * 100 / (this.stack.imageIds.length - 1)
|
||||||
this.resetWwwc()
|
this.resetWwwc()
|
||||||
|
@ -1253,7 +1253,7 @@ export default {
|
||||||
const imageInfo = this.getInstanceInfo(imageId)
|
const imageInfo = this.getInstanceInfo(imageId)
|
||||||
var instanceId = imageInfo.instanceId
|
var instanceId = imageInfo.instanceId
|
||||||
var frame = imageInfo.frame
|
var frame = imageInfo.frame
|
||||||
this.stack.frame = !isNaN(parseInt(frame)) ? parseInt(frame) : 0
|
this.stack.frame = this.stack.isExistMutiFrames ? parseInt(frame) : null
|
||||||
if (this.imageId !== instanceId) {
|
if (this.imageId !== instanceId) {
|
||||||
this.getOrientationMarker(e.detail.element)
|
this.getOrientationMarker(e.detail.element)
|
||||||
// 初次加载时,如果该影像存在标记,则以标记的窗宽窗位为初始化默认值,否则以序列的窗宽窗位为初始化默认值
|
// 初次加载时,如果该影像存在标记,则以标记的窗宽窗位为初始化默认值,否则以序列的窗宽窗位为初始化默认值
|
||||||
|
@ -1434,7 +1434,7 @@ export default {
|
||||||
const imageInfo = this.getInstanceInfo(imageId)
|
const imageInfo = this.getInstanceInfo(imageId)
|
||||||
var instanceId = imageInfo.instanceId
|
var instanceId = imageInfo.instanceId
|
||||||
var frame = imageInfo.frame
|
var frame = imageInfo.frame
|
||||||
this.stack.frame = !isNaN(parseInt(frame)) ? parseInt(frame) : 0
|
this.stack.frame = this.stack.isExistMutiFrames ? parseInt(frame) : null
|
||||||
|
|
||||||
var uuid = measurementData.uuid
|
var uuid = measurementData.uuid
|
||||||
var idx = this.measureData.findIndex(item => item.MeasureData && item.MeasureData.data && item.MeasureData.data.uuid === uuid)
|
var idx = this.measureData.findIndex(item => item.MeasureData && item.MeasureData.data && item.MeasureData.data.uuid === uuid)
|
||||||
|
|
|
@ -914,7 +914,7 @@ export default {
|
||||||
this.getWwcTpl()
|
this.getWwcTpl()
|
||||||
// cornerstone.imageCache.setMaximumSizeBytes(0)
|
// cornerstone.imageCache.setMaximumSizeBytes(0)
|
||||||
|
|
||||||
// const maximumSizeInBytes = 1024 * 1024 * 1024 * 6
|
// const maximumSizeInBytes = 1024 * 1024 * 1024 * 3 // 1 GB
|
||||||
// const maximumSizeInBytes = 1024 * 1024 * 500
|
// const maximumSizeInBytes = 1024 * 1024 * 500
|
||||||
// cornerstone.imageCache.setMaximumSizeBytes(maximumSizeInBytes)
|
// cornerstone.imageCache.setMaximumSizeBytes(maximumSizeInBytes)
|
||||||
this.customWwc = {
|
this.customWwc = {
|
||||||
|
@ -993,6 +993,7 @@ export default {
|
||||||
}
|
}
|
||||||
console.log('getMeasureData')
|
console.log('getMeasureData')
|
||||||
})
|
})
|
||||||
|
|
||||||
DicomEvent.$on('getScreenshots', (callback) => {
|
DicomEvent.$on('getScreenshots', (callback) => {
|
||||||
var base64Str =
|
var base64Str =
|
||||||
this.$refs[
|
this.$refs[
|
||||||
|
@ -1051,10 +1052,10 @@ export default {
|
||||||
this.uploadStatus = status
|
this.uploadStatus = status
|
||||||
this.uploadImageVisible = true
|
this.uploadImageVisible = true
|
||||||
},
|
},
|
||||||
getWwcTpl() {
|
async getWwcTpl() {
|
||||||
const loading = this.$loading({ fullscreen: true })
|
// const loading = this.$loading({ fullscreen: true })
|
||||||
getUserWLTemplateList()
|
try {
|
||||||
.then((res) => {
|
let res = await getUserWLTemplateList()
|
||||||
this.customWwcTpl = []
|
this.customWwcTpl = []
|
||||||
res.Result.map((i) => {
|
res.Result.map((i) => {
|
||||||
this.customWwcTpl.push({
|
this.customWwcTpl.push({
|
||||||
|
@ -1064,16 +1065,15 @@ export default {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
this.wwwcArr = [...this.defaultWwwc, ...this.customWwcTpl]
|
this.wwwcArr = [...this.defaultWwwc, ...this.customWwcTpl]
|
||||||
loading.close()
|
} catch(e) {
|
||||||
})
|
console.log(e)
|
||||||
.catch(() => {
|
}
|
||||||
loading.close()
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
getHotKeys() {
|
async getHotKeys() {
|
||||||
const loading = this.$loading({ fullscreen: true })
|
// const loading = this.$loading({ fullscreen: true })
|
||||||
getDoctorShortcutKey({ imageToolType: 0 })
|
try {
|
||||||
.then((res) => {
|
let res = await getDoctorShortcutKey({ imageToolType: 0 })
|
||||||
res.Result.map((item) => {
|
res.Result.map((item) => {
|
||||||
this.hotKeyList.push({
|
this.hotKeyList.push({
|
||||||
id: item.Id,
|
id: item.Id,
|
||||||
|
@ -1088,11 +1088,9 @@ export default {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
this.bindHotKey()
|
this.bindHotKey()
|
||||||
loading.close()
|
} catch(e) {
|
||||||
})
|
console.log(e)
|
||||||
.catch(() => {
|
}
|
||||||
loading.close()
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
resetHotkeyList(arr) {
|
resetHotkeyList(arr) {
|
||||||
this.hotKeyList = []
|
this.hotKeyList = []
|
||||||
|
@ -1702,10 +1700,13 @@ export default {
|
||||||
(s) => s.seriesId === seriesId
|
(s) => s.seriesId === seriesId
|
||||||
)
|
)
|
||||||
if (seriesIdx > -1) {
|
if (seriesIdx > -1) {
|
||||||
var series = studyList[studyIdx].SeriesList[seriesIdx]
|
var series = studyList[studyIdx].SeriesList[seriesIdx];
|
||||||
var instanceIdx = series.instanceList.findIndex(
|
let frame = this.visitTaskList[index].MeasureData[idx].MeasureData.frame
|
||||||
(imageId) => !!~imageId.indexOf(instanceId)
|
let filterStr = series.isExistMutiFrames ? `frame=${frame}&instanceId=${instanceId}` : `instanceId=${instanceId}`
|
||||||
)
|
var instanceIdx = series.imageIds.findIndex(imageId => imageId.includes(filterStr))
|
||||||
|
// var instanceIdx = series.instanceList.findIndex(
|
||||||
|
// (imageId) => !!~imageId.indexOf(instanceId)
|
||||||
|
// );
|
||||||
if (instanceIdx > -1) {
|
if (instanceIdx > -1) {
|
||||||
series.imageIdIndex = instanceIdx
|
series.imageIdIndex = instanceIdx
|
||||||
seriesInfo = series
|
seriesInfo = series
|
||||||
|
|
|
@ -74,6 +74,13 @@ import DicomEvent from "./../components/DicomEvent";
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
import { getToken } from "@/utils/auth";
|
import { getToken } from "@/utils/auth";
|
||||||
import { mapGetters } from "vuex";
|
import { mapGetters } from "vuex";
|
||||||
|
import * as dicomParser from 'dicom-parser'
|
||||||
|
import * as cornerstone from 'cornerstone-core'
|
||||||
|
import * as cornerstoneWADOImageLoader from 'cornerstone-wado-image-loader'
|
||||||
|
cornerstoneWADOImageLoader.external.dicomParser = dicomParser
|
||||||
|
cornerstoneWADOImageLoader.external.cornerstone = cornerstone
|
||||||
|
const maximumSizeInBytes = 1024 * 1024 * 1024 * 6
|
||||||
|
cornerstone.imageCache.setMaximumSizeBytes(maximumSizeInBytes)
|
||||||
export default {
|
export default {
|
||||||
name: "CustomizeReadPage",
|
name: "CustomizeReadPage",
|
||||||
components: {
|
components: {
|
||||||
|
@ -229,6 +236,10 @@ export default {
|
||||||
this.$refs[this.activeTaskVisitId][0].selectSeries(data);
|
this.$refs[this.activeTaskVisitId][0].selectSeries(data);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
cornerstone.events.addEventListener('cornerstoneimageloadprogress', this.cornerstoneimageloadprogress)
|
||||||
|
window.addEventListener('beforeunload', e => {
|
||||||
|
cornerstone.imageCache.purgeCache()
|
||||||
|
})
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
DicomEvent.$off("getNextVisitInfo");
|
DicomEvent.$off("getNextVisitInfo");
|
||||||
|
@ -237,6 +248,7 @@ export default {
|
||||||
DicomEvent.$off("removeNoneDicomMeasureData");
|
DicomEvent.$off("removeNoneDicomMeasureData");
|
||||||
DicomEvent.$off("addNoneDicomMeasureData");
|
DicomEvent.$off("addNoneDicomMeasureData");
|
||||||
DicomEvent.$off("selectSeries");
|
DicomEvent.$off("selectSeries");
|
||||||
|
window.removeEventListener('beforeunload', e => { cornerstone.imageCache.purgeCache() })
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async getVisitInfo() {
|
async getVisitInfo() {
|
||||||
|
@ -523,7 +535,7 @@ export default {
|
||||||
if (obj) {
|
if (obj) {
|
||||||
let index = Math.floor(
|
let index = Math.floor(
|
||||||
obj.imageIds.length *
|
obj.imageIds.length *
|
||||||
((baseSeries.imageIdIndex + 1) / baseSeries.instanceCount)
|
((baseSeries.imageIdIndex + 1) / baseSeries.imageIds)
|
||||||
);
|
);
|
||||||
obj.imageIdIndex = index > 0 ? index - 1 : 0;
|
obj.imageIdIndex = index > 0 ? index - 1 : 0;
|
||||||
}
|
}
|
||||||
|
@ -607,9 +619,12 @@ export default {
|
||||||
);
|
);
|
||||||
if (seriesIdx > -1) {
|
if (seriesIdx > -1) {
|
||||||
var series = studyList[studyIdx].SeriesList[seriesIdx];
|
var series = studyList[studyIdx].SeriesList[seriesIdx];
|
||||||
var instanceIdx = series.instanceList.findIndex(
|
// var instanceIdx = series.instanceList.findIndex(
|
||||||
(imageId) => !!~imageId.indexOf(instanceId)
|
// (imageId) => !!~imageId.indexOf(instanceId)
|
||||||
);
|
// );
|
||||||
|
let frame = this.visitTaskList[index].MeasureData[idx].MeasureData.frame
|
||||||
|
let filterStr = series.isExistMutiFrames ? `frame=${frame}&instanceId=${instanceId}` : `instanceId=${instanceId}`
|
||||||
|
var instanceIdx = series.imageIds.findIndex(imageId => imageId.includes(filterStr))
|
||||||
if (instanceIdx > -1) {
|
if (instanceIdx > -1) {
|
||||||
series.imageIdIndex = instanceIdx;
|
series.imageIdIndex = instanceIdx;
|
||||||
// series.studyIndex = studyIdx
|
// series.studyIndex = studyIdx
|
||||||
|
@ -643,6 +658,16 @@ export default {
|
||||||
}
|
}
|
||||||
return seriesInfo;
|
return seriesInfo;
|
||||||
},
|
},
|
||||||
|
cornerstoneimageloadprogress(e) {
|
||||||
|
const imageId = e.detail.imageId
|
||||||
|
const params = {}
|
||||||
|
const searchParams = new URLSearchParams(imageId.split('?')[1])
|
||||||
|
for (const [key, value] of searchParams.entries()) {
|
||||||
|
params[key] = value
|
||||||
|
}
|
||||||
|
params.percentComplete = e.detail.percentComplete
|
||||||
|
store.dispatch('reading/setImageLoadedProgress', params)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -157,18 +157,11 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import * as dicomParser from 'dicom-parser'
|
|
||||||
import * as cornerstone from 'cornerstone-core'
|
|
||||||
import * as cornerstoneWADOImageLoader from 'cornerstone-wado-image-loader'
|
|
||||||
import requestPoolManager from '@/utils/request-pool'
|
import requestPoolManager from '@/utils/request-pool'
|
||||||
import DicomEvent from './../components/DicomEvent'
|
import DicomEvent from './../components/DicomEvent'
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import SrList from './../components/SrList'
|
import SrList from './../components/SrList'
|
||||||
cornerstoneWADOImageLoader.external.dicomParser = dicomParser
|
|
||||||
cornerstoneWADOImageLoader.external.cornerstone = cornerstone
|
|
||||||
const maximumSizeInBytes = 1024 * 1024 * 1024 * 6
|
|
||||||
cornerstone.imageCache.setMaximumSizeBytes(maximumSizeInBytes)
|
|
||||||
export default {
|
export default {
|
||||||
name: 'StudyList',
|
name: 'StudyList',
|
||||||
components: { SrList },
|
components: { SrList },
|
||||||
|
@ -217,9 +210,7 @@ export default {
|
||||||
srDialogVisible: false,
|
srDialogVisible: false,
|
||||||
srInfo: {},
|
srInfo: {},
|
||||||
digitPlaces: 2,
|
digitPlaces: 2,
|
||||||
visitTaskIdx: -1,
|
visitTaskIdx: -1
|
||||||
currentLoadIns: [],
|
|
||||||
keySeriesLoad: []
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -257,24 +248,19 @@ export default {
|
||||||
this.subjectCode = localStorage.getItem('subjectCode')
|
this.subjectCode = localStorage.getItem('subjectCode')
|
||||||
var digitPlaces = Number(localStorage.getItem('digitPlaces'))
|
var digitPlaces = Number(localStorage.getItem('digitPlaces'))
|
||||||
this.digitPlaces = digitPlaces === -1 ? this.digitPlaces : digitPlaces
|
this.digitPlaces = digitPlaces === -1 ? this.digitPlaces : digitPlaces
|
||||||
|
DicomEvent.$on('refreshStudyListMeasureData', () => {
|
||||||
|
var idx = this.visitTaskList.findIndex(i => i.VisitTaskId === this.visitTaskId)
|
||||||
|
this.measureData = this.visitTaskList[idx].MeasureData
|
||||||
|
})
|
||||||
// DicomEvent.$on('setReadingState', readingTaskState => {
|
// DicomEvent.$on('setReadingState', readingTaskState => {
|
||||||
// var idx = this.visitTaskList.findIndex(i => i.VisitTaskId === this.visitTaskId)
|
// var idx = this.visitTaskList.findIndex(i => i.VisitTaskId === this.visitTaskId)
|
||||||
// if (idx > -1) {
|
// if (idx > -1) {
|
||||||
// this.studyList = this.visitTaskList[idx].StudyList
|
// this.studyList = this.visitTaskList[idx].StudyList
|
||||||
// }
|
// }
|
||||||
// })
|
// })
|
||||||
cornerstone.events.addEventListener('cornerstoneimageloadprogress', this.cornerstoneimageloadprogress)
|
|
||||||
cornerstone.events.addEventListener('cornerstoneimageloaded', this.cornerstoneImageLoaded)
|
|
||||||
// cornerstone.events.addEventListener('cornerstoneimagecachefull', this.cornerstoneimagecachefull)
|
|
||||||
// cornerstone.events.addEventListener('cornerstoneimagecachechanged', this.cornerstoneimagecachechanged)
|
|
||||||
window.addEventListener('beforeunload', e => {
|
|
||||||
cornerstone.imageCache.purgeCache()
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
cornerstone.imageCache.purgeCache()
|
|
||||||
window.removeEventListener('beforeunload', e => { cornerstone.imageCache.purgeCache() })
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
initStudyInfo() {
|
initStudyInfo() {
|
||||||
|
@ -326,7 +312,6 @@ export default {
|
||||||
requestPoolManager.loadAndCacheImagePlus(imageId, seriesInfo.seriesId, p * 100)
|
requestPoolManager.loadAndCacheImagePlus(imageId, seriesInfo.seriesId, p * 100)
|
||||||
},
|
},
|
||||||
getStudyList() {
|
getStudyList() {
|
||||||
console.log('getStudyList')
|
|
||||||
if (!this.isRender) {
|
if (!this.isRender) {
|
||||||
var idx = this.visitTaskList.findIndex(i => i.VisitTaskId === this.visitTaskId)
|
var idx = this.visitTaskList.findIndex(i => i.VisitTaskId === this.visitTaskId)
|
||||||
if (idx > -1 && this.visitTaskList[idx].StudyList && this.visitTaskList[idx].StudyList.length > 0) {
|
if (idx > -1 && this.visitTaskList[idx].StudyList && this.visitTaskList[idx].StudyList.length > 0) {
|
||||||
|
@ -337,8 +322,27 @@ export default {
|
||||||
this.studyIndex = sIdx
|
this.studyIndex = sIdx
|
||||||
this.seriesIndex = 0
|
this.seriesIndex = 0
|
||||||
this.activeNames = [`${this.studyList[sIdx].StudyId}`]
|
this.activeNames = [`${this.studyList[sIdx].StudyId}`]
|
||||||
|
// 下载关键序列
|
||||||
this.loadImages(this.visitTaskList[idx])
|
const i = this.studyList.findIndex(i => i.IsCriticalSequence)
|
||||||
|
if (i > -1 && this.studyList[i].SeriesList[0].length > 0) {
|
||||||
|
const series = this.studyList[i].SeriesList[0]
|
||||||
|
if (!series.loadStatus) {
|
||||||
|
let priority = parseInt(new Date().getTime())
|
||||||
|
if (series.isExistMutiFrames) {
|
||||||
|
series.instanceInfoList.map(image => {
|
||||||
|
priority = priority - 1
|
||||||
|
this.imageList.push({ imageId: image.ImageId, seriesId: series.seriesId, studyIndex: i, seriesIndex: 0, visitTaskId: series.visitTaskId, priority })
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
series.imageIds.map(imageId => {
|
||||||
|
priority = priority - 1
|
||||||
|
this.imageList.push({ imageId: imageId, seriesId: series.seriesId, studyIndex: i, seriesIndex: 0, visitTaskId: series.visitTaskId, priority })
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.loopLoad()
|
||||||
|
// this.loadImages(this.visitTaskList[idx])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.isRender = true
|
this.isRender = true
|
||||||
|
@ -420,9 +424,11 @@ export default {
|
||||||
const sdIndx = studyList.findIndex(sd => sd.StudyId === measureDatas[i].StudyId)
|
const sdIndx = studyList.findIndex(sd => sd.StudyId === measureDatas[i].StudyId)
|
||||||
const seriesList = studyList[sdIndx].SeriesList
|
const seriesList = studyList[sdIndx].SeriesList
|
||||||
const srIdx = seriesList.findIndex(sr => sr.seriesId === measureDatas[i].SeriesId)
|
const srIdx = seriesList.findIndex(sr => sr.seriesId === measureDatas[i].SeriesId)
|
||||||
// const instanceList = seriesList[srIdx].imageIds
|
// const instanceList = seriesList[srIdx].instanceList
|
||||||
const instanceList = seriesList[srIdx].instanceList
|
// const isIdx = instanceList.findIndex(is => is.includes(measureDatas[i].InstanceId))
|
||||||
const isIdx = instanceList.findIndex(is => is.includes(measureDatas[i].InstanceId))
|
const imageIds = seriesList[srIdx].imageIds
|
||||||
|
let filterStr = seriesList[srIdx].isExistMutiFrames ? `frame=${measureDatas[i].MeasureData.frame}&instanceId=${measureDatas[i].InstanceId}` : `instanceId=${measureDatas[i].InstanceId}`
|
||||||
|
const isIdx = imageIds.findIndex(is => is.includes(filterStr))
|
||||||
const series = seriesList[srIdx]
|
const series = seriesList[srIdx]
|
||||||
series.imageIdIndex = isIdx
|
series.imageIdIndex = isIdx
|
||||||
|
|
||||||
|
@ -492,9 +498,11 @@ export default {
|
||||||
if (sdIndx > -1) {
|
if (sdIndx > -1) {
|
||||||
const seriesList = studyList[sdIndx].SeriesList
|
const seriesList = studyList[sdIndx].SeriesList
|
||||||
const srIdx = seriesList.findIndex(sr => sr.seriesId === measureDatas[mIdx].SeriesId)
|
const srIdx = seriesList.findIndex(sr => sr.seriesId === measureDatas[mIdx].SeriesId)
|
||||||
// const instanceList = seriesList[srIdx].imageIds
|
// const instanceList = seriesList[srIdx].instanceList
|
||||||
const instanceList = seriesList[srIdx].instanceList
|
// const isIdx = instanceList.findIndex(is => is.includes(measureDatas[mIdx].InstanceId))
|
||||||
const isIdx = instanceList.findIndex(is => is.includes(measureDatas[mIdx].InstanceId))
|
const imageIds = seriesList[srIdx].imageIds
|
||||||
|
let filterStr = seriesList[srIdx].isExistMutiFrames ? `frame=${measureDatas[mIdx].MeasureData.frame}&instanceId=${measureDatas[mIdx].InstanceId}` : `instanceId=${measureDatas[mIdx].InstanceId}`
|
||||||
|
const isIdx = imageIds.findIndex(is => is.includes(filterStr))
|
||||||
const series = seriesList[srIdx]
|
const series = seriesList[srIdx]
|
||||||
series.imageIdIndex = isIdx
|
series.imageIdIndex = isIdx
|
||||||
|
|
||||||
|
@ -688,7 +696,8 @@ export default {
|
||||||
var activeNames = `${this.studyList[obj.studyIndex].StudyId}`
|
var activeNames = `${this.studyList[obj.studyIndex].StudyId}`
|
||||||
if (this.activeNames.includes(activeNames)) return
|
if (this.activeNames.includes(activeNames)) return
|
||||||
this.activeNames.push(activeNames)
|
this.activeNames.push(activeNames)
|
||||||
this.loadImages(this.visitTaskList[idx])
|
// this.loadImages(this.visitTaskList[idx])
|
||||||
|
this.loadImages(obj)
|
||||||
},
|
},
|
||||||
selectSeries(obj) {
|
selectSeries(obj) {
|
||||||
var seriseList = this.studyList.map(s => s.SeriesList).flat()
|
var seriseList = this.studyList.map(s => s.SeriesList).flat()
|
||||||
|
@ -713,45 +722,25 @@ export default {
|
||||||
var activeNames = `${this.studyList[series.studyIndex].StudyId}`
|
var activeNames = `${this.studyList[series.studyIndex].StudyId}`
|
||||||
if (this.activeNames.includes(activeNames)) return
|
if (this.activeNames.includes(activeNames)) return
|
||||||
this.activeNames.push(activeNames)
|
this.activeNames.push(activeNames)
|
||||||
this.loadImages(this.visitTaskList[idx])
|
this.loadImages(series)
|
||||||
|
// this.loadImages(this.visitTaskList[idx])
|
||||||
store.dispatch('reading/setActiveSeries', series)
|
store.dispatch('reading/setActiveSeries', series)
|
||||||
},
|
},
|
||||||
loadImages(taskInfo) {
|
loadImages(series) {
|
||||||
// const isBaseLineTask = taskInfo.IsBaseLineTask
|
|
||||||
const isCurrentTask = taskInfo.IsCurrentTask
|
|
||||||
// var priority = isCurrentTask ? parseInt(new Date().getTime()) : 999
|
|
||||||
var priority = parseInt(new Date().getTime())
|
var priority = parseInt(new Date().getTime())
|
||||||
this.studyList.map((study, studyIndex) => {
|
|
||||||
study.SeriesList.map((series, seriesIndex) => {
|
|
||||||
if (!series.loadStatus && series.isDicom && series.modality !== 'SR') {
|
if (!series.loadStatus && series.isDicom && series.modality !== 'SR') {
|
||||||
// if (isCurrentTask || isBaseLineTask) {
|
|
||||||
// // 当前任务/基线任务下载所有影像
|
|
||||||
// series.imageIds.map(image => {
|
|
||||||
// this.imageList.push({ imageId: image, seriesId: series.seriesId, studyIndex: studyIndex, seriesIndex: seriesIndex, visitTaskId: series.visitTaskId, priority })
|
|
||||||
// })
|
|
||||||
// } else if (!isBaseLineTask && !isCurrentTask && study.IsCriticalSequence) {
|
|
||||||
// // 非当前随访任务下载关键影像
|
|
||||||
// series.imageIds.map(image => {
|
|
||||||
// this.imageList.push({ imageId: image, seriesId: series.seriesId, studyIndex: studyIndex, seriesIndex: seriesIndex, visitTaskId: series.visitTaskId, priority })
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
// 均只下载关键序列
|
|
||||||
if (!isCurrentTask && study.IsCriticalSequence) {
|
|
||||||
if (series.isExistMutiFrames) {
|
if (series.isExistMutiFrames) {
|
||||||
series.instanceInfoList.map(image => {
|
series.instanceInfoList.map(image => {
|
||||||
priority = priority - 1
|
priority = priority - 1
|
||||||
this.imageList.push({ imageId: image.ImageId, seriesId: series.seriesId, studyIndex: studyIndex, seriesIndex: seriesIndex, visitTaskId: series.visitTaskId, priority })
|
this.imageList.push({ imageId: image.ImageId, seriesId: series.seriesId, studyIndex: series.studyIndex, seriesIndex: series.seriesIndex, visitTaskId: series.visitTaskId, priority })
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
series.imageIds.map(imageId => {
|
series.imageIds.map(imageId => {
|
||||||
priority = priority - 1
|
priority = priority - 1
|
||||||
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: series.studyIndex, seriesIndex: series.seriesIndex, visitTaskId: series.visitTaskId, priority })
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
this.loopLoad()
|
this.loopLoad()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -808,139 +797,6 @@ export default {
|
||||||
requestPoolManager.removeTask(series.seriesId)
|
requestPoolManager.removeTask(series.seriesId)
|
||||||
this.$set(this.studyList[studyIndex].SeriesList[seriesIndex], 'isLoading', false)
|
this.$set(this.studyList[studyIndex].SeriesList[seriesIndex], 'isLoading', false)
|
||||||
},
|
},
|
||||||
async imageLoaded(image, seriesUid) {
|
|
||||||
// await store.dispatch('reading/updateStudyList', { visitTaskId: image.visitTaskId, imageId: image.imageId, seriesUid })
|
|
||||||
// console.log(this.studyList[image.studyIndex].SeriesList[image.seriesIndex])
|
|
||||||
if (image.studyIndex > -1 && image.seriesIndex > -1) {
|
|
||||||
var prefetchInstanceCount = this.studyList[image.studyIndex].SeriesList[image.seriesIndex].prefetchInstanceCount
|
|
||||||
var instanceCount = this.studyList[image.studyIndex].SeriesList[image.seriesIndex].instanceCount
|
|
||||||
if (this.studyList[image.studyIndex].SeriesList[image.seriesIndex].imageloadedArr.indexOf(image.imageId) < 0) {
|
|
||||||
this.studyList[image.studyIndex].SeriesList[image.seriesIndex].imageloadedArr.push(image.imageId)
|
|
||||||
prefetchInstanceCount = prefetchInstanceCount + 1
|
|
||||||
this.studyList[image.studyIndex].SeriesList[image.seriesIndex].prefetchInstanceCount = prefetchInstanceCount
|
|
||||||
}
|
|
||||||
if (prefetchInstanceCount >= instanceCount) {
|
|
||||||
this.studyList[image.studyIndex].SeriesList[image.seriesIndex].prefetchInstanceCount = this.studyList[image.studyIndex].SeriesList[image.seriesIndex].instanceCount
|
|
||||||
// 设置当前序列状态为已下载完成
|
|
||||||
this.studyList[image.studyIndex].SeriesList[image.seriesIndex].loadStatus = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// store.dispatch('reading/updateSeriesList', { visitTaskindex: this.visitTaskIdx, studyIndex: image.studyIndex, seriesIndex: image.seriesIndex, imageId: image.imageId })
|
|
||||||
},
|
|
||||||
// instance下载成功回调
|
|
||||||
async cornerstoneImageLoaded(e) {
|
|
||||||
// var idx = this.visitTaskList.findIndex(i => i.VisitTaskId === this.visitTaskId)
|
|
||||||
// if (idx === -1) return
|
|
||||||
// this.studyList = this.visitTaskList[idx].StudyList
|
|
||||||
// if (!this.studyList || this.studyList.length === 0) {
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
// if (!this.visitTaskList[idx].IsInit) {
|
|
||||||
// const loading = this.$loading({ fullscreen: true })
|
|
||||||
// await store.dispatch('reading/getMeasuredData', this.visitTaskList[idx].VisitTaskId)
|
|
||||||
// await store.dispatch('reading/getStudyInfo', { trialId: this.trialId, subjectVisitId: this.visitTaskList[idx].VisitId, visitTaskId: this.visitTaskList[idx].VisitTaskId, taskBlindName: this.visitTaskList[idx].TaskBlindName })
|
|
||||||
// await store.dispatch('reading/getReadingQuestionAndAnswer', { trialId: this.trialId, visitTaskId: this.visitTaskList[idx].VisitTaskId })
|
|
||||||
// await store.dispatch('reading/getDicomReadingQuestionAnswer', { trialId: this.trialId, visitTaskId: this.visitTaskList[idx].VisitTaskId })
|
|
||||||
// await store.dispatch('reading/setStatus', { visitTaskId: this.visitTaskList[idx].VisitTaskId })
|
|
||||||
// loading.close()
|
|
||||||
// }
|
|
||||||
// await store.dispatch('reading/updateStudyList', { visitTaskId: this.visitTaskId, imageId: e.detail.image.imageId, seriesUid: e.detail.image.data.string('x0020000e') })
|
|
||||||
// const uri = e.detail.image.sharedCacheKey
|
|
||||||
// const index = this.cachedImages.findIndex(item => item.uri === uri)
|
|
||||||
// if (index === -1) {
|
|
||||||
// this.cachedImages.push({ uri: uri, timestamp: new Date().getTime() })
|
|
||||||
// } else {
|
|
||||||
// this.cachedImages[index].timestamp = new Date().getTime()
|
|
||||||
// }
|
|
||||||
// var imageId = e.detail.image.imageId
|
|
||||||
// var seriesUid = e.detail.image.data.string('x0020000e')
|
|
||||||
// var studyIndex = -1
|
|
||||||
// var seriesIndex = -1
|
|
||||||
// for (let i = 0; i < this.studyList.length; ++i) {
|
|
||||||
// for (let j = 0; j < this.studyList[i].SeriesList.length; ++j) {
|
|
||||||
// if (this.studyList[i].SeriesList[j].seriesUid === seriesUid) {
|
|
||||||
// studyIndex = i
|
|
||||||
// seriesIndex = j
|
|
||||||
// break
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// if (studyIndex > 0) break
|
|
||||||
// }
|
|
||||||
// if (seriesIndex < 0) return
|
|
||||||
|
|
||||||
// const imageIdIndex = this.studyList[studyIndex].SeriesList[seriesIndex].imageIds.indexOf(imageId)
|
|
||||||
// if (imageIdIndex < 0) return
|
|
||||||
// if (this.studyList[studyIndex].SeriesList[seriesIndex].imageloadedArr.indexOf(imageId) < 0) {
|
|
||||||
// if (this.studyList[studyIndex].SeriesList[seriesIndex].prefetchInstanceCount >= this.studyList[studyIndex].SeriesList[seriesIndex].instanceCount) {
|
|
||||||
// // 设置当前序列状态为已下载完成
|
|
||||||
// this.studyList[studyIndex].SeriesList[seriesIndex].loadStatus = true
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
},
|
|
||||||
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]
|
|
||||||
|
|
||||||
const seriesId = this.studyList[studyIndex].SeriesList[seriesIndex].seriesId
|
|
||||||
const i = this.keySeriesLoad.findIndex(i => i.seriesId === seriesId)
|
|
||||||
if (this.studyList[studyIndex].IsCriticalSequence && percentComplete >= 100) {
|
|
||||||
// 关键序列处理
|
|
||||||
if (i === -1) {
|
|
||||||
this.keySeriesLoad.push({ seriesId: seriesId, loadCount: 1, imageIds: [imageId] })
|
|
||||||
} else {
|
|
||||||
++this.keySeriesLoad[i].loadCount
|
|
||||||
this.keySeriesLoad[i].imageIds.push(imageId)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!this.studyList[studyIndex].IsCriticalSequence && i > -1) {
|
|
||||||
this.studyList[studyIndex].SeriesList[seriesIndex].prefetchInstanceCount = this.studyList[studyIndex].SeriesList[seriesIndex].prefetchInstanceCount + 100 * this.keySeriesLoad[i].loadCount
|
|
||||||
this.studyList[studyIndex].SeriesList[seriesIndex].imageloadedArr = [this.studyList[studyIndex].SeriesList[seriesIndex].imageloadedArr, this.keySeriesLoad[i].imageIds]
|
|
||||||
this.keySeriesLoad.splice(i, 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 (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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
cornerstoneimagecachechanged(e) {
|
|
||||||
const cacheInfo = cornerstone.imageCache.getCacheInfo()
|
|
||||||
console.log(cacheInfo)
|
|
||||||
},
|
|
||||||
cornerstoneimagecachefull(e) {
|
|
||||||
console.log('超过内存了')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue