Compare commits

..

No commits in common. "29dbe52991a29444a9d84ef026ba6aff9bb61a70" and "56b94a97fd2e7b8c1a4f0f33f9238beb8de9598f" have entirely different histories.

6 changed files with 333 additions and 414 deletions

View File

@ -190,7 +190,6 @@ const actions = {
},
getMasterSeries({ state }, obj) {
return new Promise(resolve => {
console.log('getMasterSeries')
var seriesInfo = {}
var i = state.visitTaskList.findIndex(i => i.VisitTaskId === obj.visitTaskId)
getReadingVisitStudyList(obj.trialId, obj.visitId, obj.visitTaskId).then(res => {
@ -217,20 +216,17 @@ const actions = {
series.InstanceInfoList.forEach(instance => {
if (instance.NumberOfFrames && instance.NumberOfFrames > 1) {
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=0|0`
imageIds.push(imageId)
const path = `${instance.Path}?frame=${i}&instanceId=${instance.Id}`
imageIds.push(`wadouri:${localStorage.getItem('location') !== 'USA' ? Vue.prototype.OSSclientConfig.basePath : Vue.prototype.OSSclientConfig.basePath}${path}`)
}
} 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=0|0`
imageIds.push(imageId)
imageIds.push(`wadouri:${localStorage.getItem('location') !== 'USA' ? Vue.prototype.OSSclientConfig.basePath : Vue.prototype.OSSclientConfig.basePath}${instance.Path}?instanceId=${instance.Id}`)
}
instance.ImageId = `wadouri:${localStorage.getItem('location') !== 'USA' ? Vue.prototype.OSSclientConfig.basePath : Vue.prototype.OSSclientConfig.basePath}${instance.Path}?instanceId=${instance.Id}&visitTaskId=${obj.visitTaskId}&idx=0|0`
instanceList.push(instance.Id)
})
seriesList.push({
isDicom: study.IsDicom,
imageIds: imageIds,
instanceInfoList: series.InstanceInfoList,
instanceList: instanceList,
seriesId: series.Id,
imageIdIndex: 0,
@ -735,7 +731,6 @@ const actions = {
})
},
getStudyInfo({ state }, obj) {
console.log('getStudyInfo')
return new Promise(resolve => {
var index = state.visitTaskList.findIndex(i => i.VisitTaskId === obj.visitTaskId)
if (state.visitTaskList[index].studyListInit) {
@ -768,16 +763,12 @@ const actions = {
series.InstanceInfoList.forEach(instance => {
if (instance.NumberOfFrames && instance.NumberOfFrames > 1) {
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}`
imageIds.push(imageId)
const path = `${instance.Path}?frame=${i}&instanceId=${instance.Id}`
imageIds.push(`wadouri:${localStorage.getItem('location') !== 'USA' ? Vue.prototype.OSSclientConfig.basePath : Vue.prototype.OSSclientConfig.basePath}${path}`)
}
instance.ImageId = `wadouri:${localStorage.getItem('location') !== 'USA' ? Vue.prototype.OSSclientConfig.basePath : Vue.prototype.OSSclientConfig.basePath}${instance.Path}?frame=${0}?instanceId=${instance.Id}&visitTaskId=${obj.visitTaskId}&idx=0|0`
} else {
const imageId = `wadouri:${localStorage.getItem('location') !== 'USA' ? Vue.prototype.OSSclientConfig.basePath : Vue.prototype.OSSclientConfig.basePath}${instance.Path}?instanceId=${instance.Id}&visitTaskId=${obj.visitTaskId}&idx=${studyIndex}|${seriesIndex}`
imageIds.push(imageId)
instance.ImageId = imageId
imageIds.push(`wadouri:${localStorage.getItem('location') !== 'USA' ? Vue.prototype.OSSclientConfig.basePath : Vue.prototype.OSSclientConfig.basePath}${instance.Path}?instanceId=${instance.Id}`)
}
instanceList.push(instance.Id)
})
seriesList.push({

View File

@ -84,17 +84,23 @@
</div>
</div>
<div v-if="item.keySeries" style="padding: 1px;color:red">
Key Images
</div>
<div v-else style="padding: 1px;">
#{{ item.seriesNumber }}
</div>
<div v-show="item.instanceCount" style="padding: 1px;">
{{ item.modality }}: {{ item.instanceCount }} image
</div>
<div v-show="!item.keySeries && item.sliceThickness" style="padding: 1px;">
T: {{ parseFloat(item.sliceThickness).toFixed(2) }}
T: {{ item.sliceThickness }}
</div>
<div v-show="!item.keySeries &&item.description" style="width: 120px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;padding: 1x;">
{{ item.description }}
</div>
<div v-if="!item.keySeries" style="padding: 1px;">
{{ item.imageloadedArr.length }}/{{ item.instanceCount }}
{{ item.prefetchInstanceCount }}/{{ item.instanceCount }}
</div>
</div>
@ -118,8 +124,8 @@
/>
</div>
</div>
<div v-if="item.prefetchInstanceCount>0 && item.prefetchInstanceCount<item.instanceCount * 100">
<el-progress :percentage="parseInt((item.prefetchInstanceCount/item.instanceCount).toFixed(2))" />
<div v-if="item.prefetchInstanceCount>0 && item.prefetchInstanceCount<item.instanceCount">
<el-progress :percentage="parseInt(((item.prefetchInstanceCount/item.instanceCount)*100).toFixed(2))" />
</div>
</div>
@ -191,8 +197,7 @@ export default {
showDelete: false,
loading: false,
imageList: [],
showSeriesList: [],
currentLoadIns: []
showSeriesList: []
}
},
created: function() {
@ -216,7 +221,6 @@ export default {
} else if (this.type === 'Share') {
this.loadStudy()
}
cornerstone.events.addEventListener('cornerstoneimageloadprogress', this.cornerstoneimageloadprogress)
},
beforeDestroy() {
requestPoolManager.stopTaskTimer()
@ -241,15 +245,16 @@ export default {
if (data.IsSuccess) {
const { Result } = data
var seriesList = []
Result.forEach((item, index) => {
Result.forEach(function(item) {
const imageIds = []
item.InstanceInfoList.forEach(i => {
if (i.NumberOfFrames && i.NumberOfFrames > 1) {
for (let j = 0; j < i.NumberOfFrames; j++) {
imageIds.push(`wadouri:${localStorage.getItem('location') !== 'USA' ? scope.OSSclientConfig.basePath : scope.OSSclientConfig.basePath}${i.Path}?frame=${j}&instanceId=${i.Id}&seriesIndex=${index}`)
const path = `${i.Path}?frame=${j}&instanceId=${i.Id}`
imageIds.push(`wadouri:${localStorage.getItem('location') !== 'USA' ? scope.OSSclientConfig.basePath : scope.OSSclientConfig.basePath}${path}`)
}
} else {
imageIds.push(`wadouri:${localStorage.getItem('location') !== 'USA' ? scope.OSSclientConfig.basePath : scope.OSSclientConfig.basePath}${i.Path}?instanceId=${i.Id}&seriesIndex=${index}`)
imageIds.push(`wadouri:${localStorage.getItem('location') !== 'USA' ? scope.OSSclientConfig.basePath : scope.OSSclientConfig.basePath}${i.Path}?instanceId=${i.Id}`)
}
})
var subjectVisitId = scope.$router.currentRoute.query.subjectVisitId
@ -313,11 +318,11 @@ export default {
res.Result.forEach(instance => {
if (instance.NumberOfFrames > 1) {
for (let i = 0; i < instance.NumberOfFrames; i++) {
imageIds.push(`wadouri:${localStorage.getItem('location') !== 'USA' ? this.OSSclientConfig.basePath : this.OSSclientConfig.basePath}${instance.Path}?frame=${i}&instanceId=${instance.Id}&seriesIndex=0`)
imageIds.push(`wadouri:${localStorage.getItem('location') !== 'USA' ? this.OSSclientConfig.basePath : this.OSSclientConfig.basePath}${instance.Path}?frame=${i}`)
}
isExistMutiFrames = true
} else {
imageIds.push(`wadouri:${localStorage.getItem('location') !== 'USA' ? this.OSSclientConfig.basePath : this.OSSclientConfig.basePath}${instance.Path}?instanceId=${instance.Id}&seriesIndex=0`)
imageIds.push(`wadouri:${localStorage.getItem('location') !== 'USA' ? this.OSSclientConfig.basePath : this.OSSclientConfig.basePath}${instance.Path}`)
}
instanceInfoList.push({ Id: instance.Id, InstanceNumber: instance.InstanceNumber, NumberOfFrames: instance.NumberOfFrames, Path: instance.Path })
})
@ -371,10 +376,11 @@ export default {
const imageIds = []
if (instanceInfo.NumberOfFrames && instanceInfo.NumberOfFrames > 1) {
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}&seriesIndex=${seriesIndex}`)
const path = `${instanceInfo.Path}?frame=${j}&instanceId=${instanceInfo.Id}`
imageIds.push(`wadouri:${localStorage.getItem('location') !== 'USA' ? this.OSSclientConfig.basePath : this.OSSclientConfig.basePath}${path}`)
}
} else {
imageIds.push(`wadouri:${localStorage.getItem('location') !== 'USA' ? this.OSSclientConfig.basePath : this.OSSclientConfig.basePath}${instanceInfo.Path}?instanceId=${instanceInfo.Id}&seriesIndex=${seriesIndex}`)
imageIds.push(`wadouri:${localStorage.getItem('location') !== 'USA' ? this.OSSclientConfig.basePath : this.OSSclientConfig.basePath}${instanceInfo.Path}?instanceId=${instanceInfo.Id}`)
}
const seriesInfo = {
trialId: series.trialId,
@ -517,44 +523,31 @@ export default {
}).catch(() => {})
},
loadAllImages() {
const seriesIndex = this.seriesList.findIndex(i => i.loadStatus === false)
if (seriesIndex === -1) return
const series = this.seriesList[seriesIndex]
var priority = new Date().getTime()
for (let i = 0; i < series.imageIds.length; i++) {
const imageId = series.imageIds[i]
if (series.isExistMutiFrames) {
const params = this.getInstanceInfo(imageId)
if (params.frame && params.frame > 0) {
continue
}
}
this.seriesList.forEach((series, index) => {
series.imageIds.forEach(imageId => {
var p = null
if (this.firstInstanceId === imageId) {
p = priority * 100
} else {
p = priority - 1
}
this.imageList.push({ imageId: imageId, seriesId: series.seriesId, seriesIndex: seriesIndex, priority: p })
}
// this.load(imageId, series.seriesId, priority)
this.imageList.push({ imageId: imageId, seriesId: series.seriesId, seriesIndex: index, priority: p })
})
})
if (this.imageList.length > 0) {
this.loopLoad()
}
},
getInstanceInfo(imageId) {
const params = {}
const searchParams = new URLSearchParams(imageId.split('?')[1])
for (const [key, value] of searchParams.entries()) {
params[key] = value
}
return params
},
loopLoad() {
if (this.imageList.length > 0) {
requestPoolManager.startTaskTimer()
console.log('loopLoad')
this.imageList.map(image => {
requestPoolManager.loadAndCacheImagePlus(image.imageId, image.seriesId, image.priority)
requestPoolManager.loadAndCacheImagePlus(image.imageId, image.seriesId, image.priority).then(res => {
this.imageLoaded(image, res.data.string('x0020000e'))
})
})
requestPoolManager.sortTaskPool()
this.imageList = []
@ -637,45 +630,6 @@ export default {
return 0
},
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 seriesIndex = params.seriesIndex
var prefetchInstanceCount = this.seriesList[seriesIndex].prefetchInstanceCount
var instanceCount = this.seriesList[seriesIndex].instanceCount
if (this.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.seriesList[seriesIndex].prefetchInstanceCount = prefetchInstanceCount
if (percentComplete >= 100) {
this.seriesList[seriesIndex].imageloadedArr.push(imageId)
}
}
if (prefetchInstanceCount >= instanceCount * 100) {
this.seriesList[seriesIndex].prefetchInstanceCount = instanceCount * 100
//
this.seriesList[seriesIndex].loadStatus = true
this.loadAllImages()
}
}
},
cornerstoneImageLoaded(e) {
if (this.firstInstanceId === e.detail.image.imageId && !this.isStartLoad) {
//

View File

@ -68,7 +68,7 @@
:key="instance.Id"
class="frame_content"
:style="{'margin-bottom':idx<series.instanceInfoList.length-1? '5px':'0px'}"
@click="showMultiFrames(index,series, i, instance)"
@click="showMultiFrames(series, i, instance)"
>
<!-- <div>
<img
@ -104,7 +104,7 @@
</div>
</el-tooltip>
<div style="padding: 1px;">
{{ series.imageloadedArr.length }}/{{ series.instanceCount }}
{{ series.prefetchInstanceCount }}/{{ series.instanceCount }}
</div>
<div />
</div>
@ -131,8 +131,8 @@
<!-- <div style="position: absolute;bottom: -10px;left: 0;width: 100%;">
<el-progress v-if="series.prefetchInstanceCount>0 && series.prefetchInstanceCount<series.instanceCount" :percentage="Number(series.prefetchInstanceCount/series.instanceCount)*100" />
</div> -->
<div v-if="series.prefetchInstanceCount>0 && series.prefetchInstanceCount<series.instanceCount * 100">
<el-progress :percentage="parseInt((series.prefetchInstanceCount/series.instanceCount).toFixed(2))" />
<div v-if="series.prefetchInstanceCount>0 && series.prefetchInstanceCount<series.instanceCount">
<el-progress :percentage="parseInt(((series.prefetchInstanceCount/series.instanceCount)*100).toFixed(2))" />
</div>
</div>
@ -146,7 +146,7 @@
<el-tab-pane :label="$t('trials:dicom-show:relatedVisit')" name="relation-study" class="pane-relation-wrapper">
<div class="viewerSidethumbinner">
<el-collapse v-model="relationActiveName" @change="handelRelationActiveChange">
<el-collapse-item v-for="(study,studyIndex) in relationStudyList" :key="`${study.StudyId}`" :name="`${study.StudyId}`">
<el-collapse-item v-for="(study) in relationStudyList" :key="`${study.StudyId}`" :name="`${study.StudyId}`">
<template slot="title">
<div class="text-desc">
@ -205,7 +205,7 @@
:key="instance.Id"
class="frame_content"
:style="{'margin-bottom':idx<seriesItem.instanceInfoList.length-1? '5px':'0px'}"
@click="showMultiFrames(studyIndex,seriesItem, index, instance)"
@click="showMultiFrames(seriesItem, i, instance)"
>
<!-- <div>
<img
@ -295,8 +295,7 @@ export default {
imageList: [],
activeNames: [],
relationActiveName: [],
showSeriesList: [],
currentLoadIns: []
showSeriesList: []
}
},
mounted() {
@ -313,7 +312,6 @@ export default {
this.showDelete = parseInt(this.$router.currentRoute.query.showDelete)
// cornerstone.events.addEventListener('cornerstoneimageloaded', this.cornerstoneImageLoaded)
this.getStudiesInfo()
cornerstone.events.addEventListener('cornerstoneimageloadprogress', this.cornerstoneimageloadprogress)
},
beforeDestroy() {
requestPoolManager.stopTaskTimer()
@ -323,7 +321,7 @@ export default {
getStudiesInfo() {
this.studyList = []
getVisitStudyList(this.trialId, this.subjectVisitId, this.isReading).then(res => {
res.Result.forEach((study,studyIndex) => {
res.Result.forEach((study) => {
const data = {}
data.StudyId = study.StudyId
data.StudyCode = study.StudyCode
@ -333,15 +331,16 @@ export default {
data.InstanceCount = study.InstanceCount
data.PreviewImageCount = 0
var seriesList = []
study.SeriesList.forEach((series,seriesIndex) => {
study.SeriesList.forEach((series) => {
const imageIds = []
series.InstanceInfoList.forEach(i => {
if (i.NumberOfFrames && i.NumberOfFrames > 1) {
for (let j = 0; j < i.NumberOfFrames; j++) {
imageIds.push(`wadouri:${localStorage.getItem('location') !== 'USA' ? this.OSSclientConfig.basePath : this.OSSclientConfig.basePath}${i.Path}?frame=${j}&instanceId=${i.Id}&idx=${studyIndex}|${seriesIndex}`)
const path = `${i.Path}?frame=${j}&instanceId=${i.Id}`
imageIds.push(`wadouri:${localStorage.getItem('location') !== 'USA' ? this.OSSclientConfig.basePath : this.OSSclientConfig.basePath}${path}`)
}
} else {
imageIds.push(`wadouri:${localStorage.getItem('location') !== 'USA' ? this.OSSclientConfig.basePath : this.OSSclientConfig.basePath}${i.Path}?instanceId=${i.Id}&idx=${studyIndex}|${seriesIndex}`)
imageIds.push(`wadouri:${localStorage.getItem('location') !== 'USA' ? this.OSSclientConfig.basePath : this.OSSclientConfig.basePath}${i.Path}?instanceId=${i.Id}`)
}
})
seriesList.push({
@ -393,15 +392,16 @@ export default {
requestPoolManager.changePriority(series.seriesId)
}
},
showMultiFrames(studyIndex,series, seriesIndex, instanceInfo) {
showMultiFrames(series, seriesIndex, instanceInfo) {
this.currentSeriesIndex = seriesIndex
const imageIds = []
if (instanceInfo.NumberOfFrames && instanceInfo.NumberOfFrames > 1) {
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}&idx=${studyIndex}|${seriesIndex}`)
const path = `${instanceInfo.Path}?frame=${j}&instanceId=${instanceInfo.Id}`
imageIds.push(`wadouri:${localStorage.getItem('location') !== 'USA' ? this.OSSclientConfig.basePath : this.OSSclientConfig.basePath}${path}`)
}
} else {
imageIds.push(`wadouri:${localStorage.getItem('location') !== 'USA' ? this.OSSclientConfig.basePath : this.OSSclientConfig.basePath}${instanceInfo.Path}?instanceId=${instanceInfo.Id}&idx=${studyIndex}|${seriesIndex}`)
imageIds.push(`wadouri:${localStorage.getItem('location') !== 'USA' ? this.OSSclientConfig.basePath : this.OSSclientConfig.basePath}${instanceInfo.Path}?instanceId=${instanceInfo.Id}`)
}
const seriesInfo = {
trialId: series.trialId,
@ -526,15 +526,16 @@ export default {
if (data.Result != null && data.Result.length > 0) {
var seriesList = []
const res = data.Result
res.forEach((item,seriesIndex)=> {
res.forEach(function(item) {
const imageIds = []
item.InstanceInfoList.forEach(i => {
if (i.NumberOfFrames && i.NumberOfFrames > 1) {
for (let j = 0; j < i.NumberOfFrames; j++) {
imageIds.push(`wadouri:${localStorage.getItem('location') !== 'USA' ? scope.OSSclientConfig.basePath : scope.OSSclientConfig.basePath}${i.Path}?frame=${j}&instanceId=${i.Id}&idx=${index}|${seriesIndex}`)
const path = `${i.Path}?frame=${j}&instanceId=${i.Id}`
imageIds.push(`wadouri:${localStorage.getItem('location') !== 'USA' ? scope.OSSclientConfig.basePath : scope.OSSclientConfig.basePath}${path}`)
}
} else {
imageIds.push(`wadouri:${localStorage.getItem('location') !== 'USA' ? scope.OSSclientConfig.basePath : scope.OSSclientConfig.basePath}${i.Path}?instanceId=${i.Id}&idx=${index}|${seriesIndex}`)
imageIds.push(`wadouri:${localStorage.getItem('location') !== 'USA' ? scope.OSSclientConfig.basePath : scope.OSSclientConfig.basePath}${i.Path}?instanceId=${i.Id}`)
}
})
seriesList.push({
@ -582,50 +583,54 @@ export default {
}
},
loadAllImages() {
var seriesList = this.studyList.map(s => s.SeriesList).flat()
const seriesIndex = seriesList.findIndex(i => i.loadStatus === false)
if (seriesIndex === -1) return
const series = seriesList[seriesIndex]
var priority = parseInt(new Date().getTime())
for (let i = 0; i < series.imageIds.length; i++) {
const imageId = series.imageIds[i]
if (series.isExistMutiFrames) {
const params = this.getInstanceInfo(imageId)
if (params.frame && params.frame > 0) {
continue
}
}
this.studyList.map((study, studyIndex) => {
study.SeriesList.map((series, seriesIndex) => {
series.imageIds.map(imageId => {
var p = null
if (this.firstInstanceId === imageId) {
p = priority * 100
} else {
p = priority - 1
}
this.imageList.push({ imageId: imageId, seriesId: series.seriesId, seriesIndex: seriesIndex, priority: p })
}
this.imageList.push({ imageId: imageId, seriesId: series.seriesId, studyIndex, seriesIndex, priority: p })
})
// if (!series.loadStatus && series.seriesId !== this.firstSeriesId) {
// series.imageIds.map(imageId => {
// // imageIds.push({ imageId: image, seriesId: series.seriesId, priority })
// this.imageList.push({ imageId: imageId, seriesId: series.seriesId, studyIndex, seriesIndex, priority })
// })
// }
})
})
if (this.imageList.length > 0) {
this.loopLoad()
}
// requestPoolManager.setPendingList(imageIds)
},
getInstanceInfo(imageId) {
const params = {}
const searchParams = new URLSearchParams(imageId.split('?')[1])
for (const [key, value] of searchParams.entries()) {
params[key] = value
}
return params
},
loopLoad() {
if (this.imageList.length > 0) {
requestPoolManager.startTaskTimer()
this.imageList.map(image => {
requestPoolManager.loadAndCacheImagePlus(image.imageId, image.seriesId, image.priority)
requestPoolManager.loadAndCacheImagePlus(image.imageId, image.seriesId, image.priority).then(res => {
this.imageLoaded(image, res.data.string('x0020000e'))
})
})
requestPoolManager.sortTaskPool()
this.imageList = []
}
},
load(imageId, seriesId, priority = 999) {
return new Promise((resolve, reject) => {
requestPoolManager.loadAndCacheImagePlus(imageId, seriesId, priority).then(res => {
if (!res) return
this.imageLoaded(imageId, res.data.string('x0020000e'))
resolve(res)
}).catch(e => {
reject(e)
})
})
},
// load(imageId, priority = 999) {
// return new Promise((resolve, reject) => {
// const imageTask = this.buildImageRequestTask(imageId, { priority })
@ -668,43 +673,47 @@ export default {
}
}
},
cornerstoneimageloadprogress(e){
const imageId = e.detail.imageId
const percentComplete = e.detail.percentComplete
const params = {}
const searchParams = new URLSearchParams(imageId.split('?')[1])
for (const [key, value] of searchParams.entries()) {
params[key] = value
}
if (this.visitTaskId === params.visitTaskId) {
const studyIndex = params.idx.split('|')[0]
const seriesIndex = params.idx.split('|')[1]
var prefetchInstanceCount = this.studyList[studyIndex].SeriesList[seriesIndex].prefetchInstanceCount
var instanceCount = this.studyList[studyIndex].SeriesList[seriesIndex].instanceCount
if (this.studyList[studyIndex].SeriesList[seriesIndex].imageloadedArr.indexOf(imageId) < 0) {
const i = this.currentLoadIns.findIndex(i => i.imageId === imageId)
if (i > -1) {
prefetchInstanceCount = prefetchInstanceCount - this.currentLoadIns[i].percentComplete + percentComplete
this.currentLoadIns[i].percentComplete = percentComplete
if (percentComplete === 100) {
this.currentLoadIns.splice(i, 1)
// instance
cornerstoneImageLoaded(e) {
if (e.detail.image.imageId.includes(this.firstInstanceId) && !this.isStartLoad) {
//
this.loadAllImages()
this.isStartLoad = true
// requestPoolManager.executeTask()
}
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 {
if (percentComplete !== 100) {
this.currentLoadIns.push({ imageId, percentComplete })
this.cachedImages[index].timestamp = new Date().getTime()
}
prefetchInstanceCount = prefetchInstanceCount + percentComplete
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
}
this.studyList[studyIndex].SeriesList[seriesIndex].prefetchInstanceCount = prefetchInstanceCount
if (percentComplete >= 100) {
}
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) {
++this.studyList[studyIndex].SeriesList[seriesIndex].prefetchInstanceCount
this.studyList[studyIndex].SeriesList[seriesIndex].imageloadedArr.push(imageId)
}
}
if (prefetchInstanceCount >= instanceCount * 100) {
this.studyList[studyIndex].SeriesList[seriesIndex].prefetchInstanceCount = instanceCount * 100
if (this.studyList[studyIndex].SeriesList[seriesIndex].prefetchInstanceCount >= this.studyList[studyIndex].SeriesList[seriesIndex].instanceCount) {
this.studyList[studyIndex].SeriesList[seriesIndex].prefetchInstanceCount = this.studyList[studyIndex].SeriesList[seriesIndex].instanceCount
//
this.studyList[studyIndex].SeriesList[seriesIndex].loadStatus = true
this.loadAllImages()
}
}
}

View File

@ -477,7 +477,7 @@ export default {
},
methods: {
goViewer(e) {
// console.log(this.$refs['sliderBox'].clientHeight)
console.log(this.$refs['sliderBox'].clientHeight)
var height = e.offsetY * 100 / this.$refs['sliderBox'].clientHeight
this.height = height
var index = Math.trunc(this.stack.imageIds.length * this.height / 100)
@ -546,7 +546,7 @@ export default {
},
mouseUp(e) {
// console.log('mouseUp')
console.log('mouseUp')
if (this.readingTaskState >= 2) return
this.image = e.detail.image
this.getToolStateInfo(e)
@ -672,7 +672,7 @@ export default {
this.sliderInfo.isMove = false
},
getMeasureData() {
// console.log('getMeasureData')
console.log('getMeasureData')
var idx = this.visitTaskList.findIndex(i => i.VisitTaskId === this.stack.visitTaskId)
this.measureData = this.visitTaskList[idx].MeasureData
const ToolStateManager = cornerstoneTools.globalImageIdSpecificToolStateManager
@ -814,7 +814,7 @@ export default {
}
},
stackScrollCallback(e) {
// console.log('stackScrollCallback')
console.log('stackScrollCallback')
const { detail } = e
if (this.isScrollSync && this.currentDicomCanvasIndex === this.canvasIndex) {
this.scrollSyncInfo.canvasIndex = this.canvasIndex
@ -998,7 +998,7 @@ export default {
if (i > -1) {
var idx = this.measureData.findIndex(item => item.MeasureData && item.MeasureData.data && item.MeasureData.data.uuid === toolState.data[i].uuid)
if (idx > -1) {
// console.log('mouseClick')
console.log('mouseClick')
DicomEvent.$emit('setCollapseActive', this.measureData[idx])
if (this.readingTaskState < 2) {
const measureData = {}
@ -1127,7 +1127,7 @@ export default {
})
},
onFirstImageLoaded(image) {
// console.log('onFirstImageLoaded')
console.log('onFirstImageLoaded')
return new Promise(async resolve => {
const element = this.$refs.canvas
var viewport = cornerstone.getDefaultViewportForImage(this.canvas, image)
@ -1206,7 +1206,7 @@ export default {
})
},
onNewImage(e) {
// console.log('cornerstonenewimage')
console.log('cornerstonenewimage')
if (this.isCurrentTask && this.readingTaskState < 2) {
this.resetHideMeasureArr()
}
@ -1319,7 +1319,7 @@ export default {
var element = cornerstone.getEnabledElement(this.canvas)
var viewport = element.viewport
//
// console.log('completed')
console.log('completed')
this.activeTool = 1
this.activeToolName = ''
var { imageId } = element.image
@ -1437,7 +1437,7 @@ export default {
},
onMeasurementmodified(e) {
//
// console.log('modified')
console.log('modified')
if (this.readingTaskState >= 2) return
const { measurementData, toolType } = e.detail
var element = cornerstone.getEnabledElement(this.canvas)

View File

@ -103,10 +103,7 @@
<p v-show="series.sliceThickness && !study.IsCriticalSequence">
T: {{ parseFloat(series.sliceThickness).toFixed(digitPlaces) }}
</p>
<p v-show="series.instanceCount && series.imageloadedArr.length < series.instanceCount">
{{ series.modality }}: {{ series.imageloadedArr.length }}/{{ series.instanceCount }} image
</p>
<p v-show="series.instanceCount && series.imageloadedArr.length >= series.instanceCount">
<p v-show="series.instanceCount">
{{ series.modality }}: {{ series.instanceCount }} image
</p>
@ -121,9 +118,9 @@
</div>
</div>
</div>
<div v-if="series.isDicom && series.prefetchInstanceCount>0 && series.prefetchInstanceCount<series.instanceCount * 100" style="width: 100%;">
<div v-if="series.isDicom && series.prefetchInstanceCount>0 && series.prefetchInstanceCount<series.instanceCount" style="width: 100%;">
<el-progress
:percentage="parseInt((series.prefetchInstanceCount / series.instanceCount).toFixed(2))"
:percentage="parseInt(((series.prefetchInstanceCount/series.instanceCount)*100).toFixed(2))"
/>
</div>
@ -218,8 +215,7 @@ export default {
srDialogVisible: false,
srInfo: {},
digitPlaces: 2,
visitTaskIdx: -1,
currentLoadIns: []
visitTaskIdx: -1
}
},
@ -267,7 +263,6 @@ export default {
// 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)
@ -287,10 +282,7 @@ export default {
this.getInitSeries().then((res) => {
requestPoolManager.startTaskTimer()
res.map((item) => {
// this.loadInitialImage(item)
const imageId = item.imageIds[item.imageIdIndex]
const p = parseInt(new Date().getTime())
requestPoolManager.loadAndCacheImagePlus(imageId, item.seriesId, p * 100)
this.loadInitialImage(item)
})
var i = res.findIndex(s => s.isCurrentTask)
if (i > -1) {
@ -299,18 +291,71 @@ export default {
this.measureData = this.visitTaskList[idx].MeasureData
this.studyList = this.visitTaskList[idx].StudyList
var priority = parseInt(new Date().getTime())
if (res[i].isExistMutiFrames) {
res[i].instanceInfoList.map(image => {
priority--
this.imageList.push({ imageId: image.ImageId, seriesId: res[i].seriesId, studyIndex: res[i].studyIndex, seriesIndex: res[i].seriesIndex, visitTaskId: res[i].visitTaskId, priority })
})
} else {
res[i].imageIds.map(image => {
priority--
this.imageList.push({ imageId: image, seriesId: res[i].seriesId, studyIndex: res[i].studyIndex, seriesIndex: res[i].seriesIndex, visitTaskId: res[i].visitTaskId, priority })
})
}
// this.studyList.map((study, studyIndex) => {
// study.SeriesList.map((series, seriesIndex) => {
// if (series.modality !== 'SR') {
// series.imageIds.map(image => {
// var p = priority - seriesIndex
// if (series.seriesId === res[i].seriesId) {
// p = priority
// } else {
// --p
// }
// this.imageList.push({ imageId: image, seriesId: series.seriesId, studyIndex: studyIndex, seriesIndex: seriesIndex, visitTaskId: series.visitTaskId, priority: p })
// })
// }
// })
// })
this.loopLoad()
}
}
DicomEvent.$emit('loadImageStacks', res)
loading.close()
this.isRender = true
}).catch(() => {
loading.close()
})
},
initStudyInfo2() {
console.log('initStudyInfo')
const loading = this.$loading({ fullscreen: true })
//
this.getInitSeries().then((res) => {
requestPoolManager.startTaskTimer()
res.map((item) => {
this.loadInitialImage(item)
})
var i = res.findIndex(s => s.isCurrentTask)
if (i > -1) {
var p = parseInt(new Date().getTime())
// var p = this.visitTaskId === this.currentTaskId ? parseInt(new Date().getTime()) : 999 //
var idx = this.visitTaskList.findIndex(i => i.VisitTaskId === this.visitTaskId)
if (idx > -1) {
this.measureData = this.visitTaskList[idx].MeasureData
this.studyList = this.visitTaskList[idx].StudyList
this.studyList.map((study, studyIndex) => {
study.SeriesList.map((series, seriesIndex) => {
if (series.modality !== 'SR') {
// var sliceThickness = isNaN(parseInt(series.sliceThickness)) ? null : parseInt(series.sliceThickness)
// if (sliceThickness === 5 || series.instanceCount <= 100) {
series.imageIds.map(image => {
let priority = 0
if (series.seriesId === res[i].seriesId) {
priority = parseInt(new Date().getTime()) * 10
} else {
priority = --p
}
this.imageList.push({ imageId: image, seriesId: series.seriesId, studyIndex: studyIndex, seriesIndex: seriesIndex, visitTaskId: series.visitTaskId, priority })
})
}
})
})
this.loopLoad()
}
}
@ -326,9 +371,9 @@ export default {
var p = parseInt(new Date().getTime())
var imageId = seriesInfo.imageIds[seriesInfo.imageIdIndex]
requestPoolManager.loadAndCacheImagePlus(imageId, seriesInfo.seriesId, p * 100).then(res => {
// if (seriesInfo.isCurrentTask) {
// this.imageLoaded({ studyIndex: seriesInfo.studyIndex, seriesIndex: seriesInfo.seriesIndex, imageId: res.imageId }, res.data.string('x0020000e'))
// }
if (seriesInfo.isCurrentTask) {
this.imageLoaded({ studyIndex: seriesInfo.studyIndex, seriesIndex: seriesInfo.seriesIndex, imageId: res.imageId }, res.data.string('x0020000e'))
}
})
},
getStudyList() {
@ -612,16 +657,9 @@ export default {
}
if (!isAddToTakPool) {
var priority = parseInt(new Date().getTime())
if (series.isExistMutiFrames) {
series.instanceInfoList.map(image => {
this.imageList.push({ imageId: image.ImageId, seriesId: series.seriesId, studyIndex: studyIndex, seriesIndex: seriesIndex, visitTaskId: series.visitTaskId, priority })
})
} else {
series.imageIds.map(imageId => {
series.imageIds.map((imageId) => {
this.imageList.push({ imageId: imageId, seriesId: series.seriesId, studyIndex: studyIndex, seriesIndex: seriesIndex, visitTaskId: series.visitTaskId, priority })
})
}
if (this.imageList.length > 0) {
this.loopLoadStatus = 0
this.loopLoad()
@ -645,10 +683,11 @@ export default {
const imageIds = []
if (instanceInfo.NumberOfFrames && instanceInfo.NumberOfFrames > 1) {
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}`)
const path = `${instanceInfo.Path}?frame=${j}&instanceId=${instanceInfo.Id}`
imageIds.push(`wadouri:${localStorage.getItem('location') !== 'USA' ? this.OSSclientConfig.basePath : this.OSSclientConfig.basePath}${path}`)
}
} 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}`)
}
this.studyIndex = studyIndex
this.seriesIndex = seriesIndex
@ -656,6 +695,7 @@ export default {
var dicomStatck = this.studyList[studyIndex].SeriesList[seriesIndex]
dicomStatck.imageIds = imageIds
dicomStatck.imageIdIndex = 0
console.log(dicomStatck)
this.$emit('loadImageStack', dicomStatck)
this.loopLoadStatus = -1
series.isLoading = true
@ -667,16 +707,9 @@ export default {
}
if (!isAddToTakPool) {
var priority = parseInt(new Date().getTime())
if (series.isExistMutiFrames) {
series.instanceInfoList.map(image => {
this.imageList.push({ imageId: image.ImageId, seriesId: series.seriesId, studyIndex: studyIndex, seriesIndex: seriesIndex, visitTaskId: series.visitTaskId, priority })
})
} else {
series.imageIds.map((imageId) => {
this.imageList.push({ imageId: imageId, seriesId: series.seriesId, studyIndex: studyIndex, seriesIndex: seriesIndex, visitTaskId: series.visitTaskId, priority })
})
}
if (this.imageList.length > 0) {
this.loopLoadStatus = 0
this.loopLoad()
@ -745,17 +778,10 @@ export default {
// }
//
if (!isCurrentTask && study.IsCriticalSequence) {
if (series.isExistMutiFrames) {
series.instanceInfoList.map(image => {
series.imageIds.map(image => {
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, seriesId: series.seriesId, studyIndex: studyIndex, seriesIndex: seriesIndex, visitTaskId: series.visitTaskId, priority })
})
} else {
series.imageIds.map(imageId => {
priority = priority - 1
this.imageList.push({ imageId: imageId, seriesId: series.seriesId, studyIndex: studyIndex, seriesIndex: seriesIndex, visitTaskId: series.visitTaskId, priority })
})
}
}
}
})
@ -767,7 +793,11 @@ export default {
if (this.imageList.length > 0) {
// requestPoolManager.startTaskTimer()
this.imageList.map(image => {
requestPoolManager.loadAndCacheImagePlus(image.imageId, image.seriesId, image.priority)
requestPoolManager.loadAndCacheImagePlus(image.imageId, image.seriesId, image.priority).then(res => {
if (res) {
this.imageLoaded(image, res.data.string('x0020000e'))
}
})
})
requestPoolManager.sortTaskPool()
@ -787,22 +817,12 @@ export default {
}
if (!isAddToTakPool) {
const priority = parseInt(new Date().getTime())
if (series.isExistMutiFrames) {
series.instanceInfoList.map(image => {
const index = this.cachedImages.findIndex(item => item.uri === image)
if (index === -1) {
this.imageList.push({ imageId: image.ImageId, seriesId: series.seriesId, studyIndex: studyIndex, seriesIndex: seriesIndex, visitTaskId: series.visitTaskId, priority })
}
})
} else {
series.imageIds.map(image => {
const index = this.cachedImages.findIndex(item => item.uri === image)
if (index === -1) {
this.imageList.push({ imageId: image, seriesId: series.seriesId, studyIndex: studyIndex, seriesIndex: seriesIndex, visitTaskId: series.visitTaskId, priority })
}
})
}
if (this.imageList.length > 0) {
this.loopLoadStatus = 0
this.loopLoad()
@ -887,45 +907,6 @@ export default {
// }
// }
},
cornerstoneimageloadprogress(e) {
const imageId = e.detail.imageId
const percentComplete = e.detail.percentComplete
const params = {}
const searchParams = new URLSearchParams(imageId.split('?')[1])
for (const [key, value] of searchParams.entries()) {
params[key] = value
}
if (this.visitTaskId === params.visitTaskId) {
const studyIndex = params.idx.split('|')[0]
const seriesIndex = params.idx.split('|')[1]
var prefetchInstanceCount = this.studyList[studyIndex].SeriesList[seriesIndex].prefetchInstanceCount
var instanceCount = this.studyList[studyIndex].SeriesList[seriesIndex].instanceCount
if (this.studyList[studyIndex].SeriesList[seriesIndex].imageloadedArr.indexOf(imageId) < 0) {
const i = this.currentLoadIns.findIndex(i => i.imageId === imageId)
if (i > -1) {
prefetchInstanceCount = prefetchInstanceCount - this.currentLoadIns[i].percentComplete + percentComplete
this.currentLoadIns[i].percentComplete = percentComplete
if (percentComplete === 100) {
this.currentLoadIns.splice(i, 1)
}
} else {
if (percentComplete !== 100) {
this.currentLoadIns.push({ imageId, percentComplete })
}
prefetchInstanceCount = prefetchInstanceCount + percentComplete
}
this.studyList[studyIndex].SeriesList[seriesIndex].prefetchInstanceCount = prefetchInstanceCount
if (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)

View File

@ -103,12 +103,10 @@
<p v-show="series.sliceThickness && !study.IsCriticalSequence">
T: {{ parseFloat(series.sliceThickness).toFixed(digitPlaces) }}
</p>
<p v-show="series.instanceCount && series.imageloadedArr.length < series.instanceCount">
{{ series.modality }}: {{ series.imageloadedArr.length }}/{{ series.instanceCount }} image
</p>
<p v-show="series.instanceCount && series.imageloadedArr.length >= series.instanceCount">
<p v-show="series.instanceCount">
{{ series.modality }}: {{ series.instanceCount }} image
</p>
<div class="flex-div">
<div v-if="measureData && measureData.findIndex(v=>v.SeriesId === series.seriesId && v.MeasureData) > -1">
<!-- 有标注 -->
@ -120,9 +118,9 @@
</div>
</div>
</div>
<div v-if="series.isDicom && series.prefetchInstanceCount>0 && series.prefetchInstanceCount<series.instanceCount * 100" style="width: 100%;">
<div v-if="series.isDicom && series.prefetchInstanceCount>0 && series.prefetchInstanceCount<series.instanceCount" style="width: 100%;">
<el-progress
:percentage="parseInt((series.prefetchInstanceCount / series.instanceCount).toFixed(2))"
:percentage="parseInt(((series.prefetchInstanceCount/series.instanceCount)*100).toFixed(2))"
/>
</div>
@ -217,8 +215,7 @@ export default {
srDialogVisible: false,
srInfo: {},
digitPlaces: 2,
visitTaskIdx: -1,
currentLoadIns: []
visitTaskIdx: -1
}
},
@ -262,17 +259,12 @@ export default {
// 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() {
cornerstone.imageCache.purgeCache()
window.removeEventListener('beforeunload', e => { cornerstone.imageCache.purgeCache() })
},
methods: {
initStudyInfo() {
@ -281,9 +273,7 @@ export default {
this.getInitSeries().then((res) => {
requestPoolManager.startTaskTimer()
res.map((item) => {
let imageId = item.imageIds[item.imageIdIndex]
const p = parseInt(new Date().getTime())
requestPoolManager.loadAndCacheImagePlus(imageId, item.seriesId, p * 100)
this.loadInitialImage(item)
})
var i = res.findIndex(s => s.isCurrentTask)
if (i > -1) {
@ -292,17 +282,71 @@ export default {
this.measureData = this.visitTaskList[idx].MeasureData
this.studyList = this.visitTaskList[idx].StudyList
var priority = parseInt(new Date().getTime())
if (res[i].isExistMutiFrames) {
res[i].instanceInfoList.map(image => {
priority--
this.imageList.push({ imageId: image.ImageId, seriesId: res[i].seriesId, studyIndex: res[i].studyIndex, seriesIndex: res[i].seriesIndex, visitTaskId: res[i].visitTaskId, priority })
})
} else {
res[i].imageIds.map(image => {
priority--
this.imageList.push({ imageId: image, seriesId: res[i].seriesId, studyIndex: res[i].studyIndex, seriesIndex: res[i].seriesIndex, visitTaskId: res[i].visitTaskId, priority })
})
// this.studyList.map((study, studyIndex) => {
// study.SeriesList.map((series, seriesIndex) => {
// if (series.modality !== 'SR') {
// series.imageIds.map(image => {
// var p = priority - seriesIndex
// if (series.seriesId === res[i].seriesId) {
// p = priority
// } else {
// --p
// }
// this.imageList.push({ imageId: image, seriesId: series.seriesId, studyIndex: studyIndex, seriesIndex: seriesIndex, visitTaskId: series.visitTaskId, priority: p })
// })
// }
// })
// })
this.loopLoad()
}
}
DicomEvent.$emit('loadImageStacks', res)
loading.close()
this.isRender = true
}).catch(() => {
loading.close()
})
},
initStudyInfo2() {
console.log('initStudyInfo')
const loading = this.$loading({ fullscreen: true })
//
this.getInitSeries().then((res) => {
requestPoolManager.startTaskTimer()
res.map((item) => {
this.loadInitialImage(item)
})
var i = res.findIndex(s => s.isCurrentTask)
if (i > -1) {
var p = parseInt(new Date().getTime())
// var p = this.visitTaskId === this.currentTaskId ? parseInt(new Date().getTime()) : 999 //
var idx = this.visitTaskList.findIndex(i => i.VisitTaskId === this.visitTaskId)
if (idx > -1) {
this.measureData = this.visitTaskList[idx].MeasureData
this.studyList = this.visitTaskList[idx].StudyList
this.studyList.map((study, studyIndex) => {
study.SeriesList.map((series, seriesIndex) => {
if (series.modality !== 'SR') {
// var sliceThickness = isNaN(parseInt(series.sliceThickness)) ? null : parseInt(series.sliceThickness)
// if (sliceThickness === 5 || series.instanceCount <= 100) {
series.imageIds.map(image => {
let priority = 0
if (series.seriesId === res[i].seriesId) {
priority = parseInt(new Date().getTime()) * 10
} else {
priority = --p
}
this.imageList.push({ imageId: image, seriesId: series.seriesId, studyIndex: studyIndex, seriesIndex: seriesIndex, visitTaskId: series.visitTaskId, priority })
})
}
})
})
this.loopLoad()
}
}
@ -317,7 +361,11 @@ export default {
loadInitialImage(seriesInfo) {
var p = parseInt(new Date().getTime())
var imageId = seriesInfo.imageIds[seriesInfo.imageIdIndex]
requestPoolManager.loadAndCacheImagePlus(imageId, seriesInfo.seriesId, p * 100)
requestPoolManager.loadAndCacheImagePlus(imageId, seriesInfo.seriesId, p * 100).then(res => {
if (seriesInfo.isCurrentTask) {
this.imageLoaded({ studyIndex: seriesInfo.studyIndex, seriesIndex: seriesInfo.seriesIndex, imageId: res.imageId }, res.data.string('x0020000e'))
}
})
},
getStudyList() {
console.log('getStudyList')
@ -599,15 +647,9 @@ export default {
}
if (!isAddToTakPool) {
var priority = parseInt(new Date().getTime())
if (series.isExistMutiFrames) {
series.instanceInfoList.map(image => {
this.imageList.push({ imageId: image.ImageId, seriesId: series.seriesId, studyIndex: studyIndex, seriesIndex: seriesIndex, visitTaskId: series.visitTaskId, priority })
})
} else {
series.imageIds.map(imageId => {
series.imageIds.map((imageId) => {
this.imageList.push({ imageId: imageId, seriesId: series.seriesId, studyIndex: studyIndex, seriesIndex: seriesIndex, visitTaskId: series.visitTaskId, priority })
})
}
if (this.imageList.length > 0) {
this.loopLoadStatus = 0
this.loopLoad()
@ -631,10 +673,11 @@ export default {
const imageIds = []
if (instanceInfo.NumberOfFrames && instanceInfo.NumberOfFrames > 1) {
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}`)
const path = `${instanceInfo.Path}?frame=${j}&instanceId=${instanceInfo.Id}`
imageIds.push(`wadouri:${localStorage.getItem('location') !== 'USA' ? this.OSSclientConfig.basePath : this.OSSclientConfig.basePath}${path}`)
}
} 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}`)
}
this.studyIndex = studyIndex
this.seriesIndex = seriesIndex
@ -642,6 +685,7 @@ export default {
var dicomStatck = this.studyList[studyIndex].SeriesList[seriesIndex]
dicomStatck.imageIds = imageIds
dicomStatck.imageIdIndex = 0
console.log(dicomStatck)
this.$emit('loadImageStack', dicomStatck)
this.loopLoadStatus = -1
series.isLoading = true
@ -653,16 +697,9 @@ export default {
}
if (!isAddToTakPool) {
var priority = parseInt(new Date().getTime())
if (series.isExistMutiFrames) {
series.instanceInfoList.map(image => {
this.imageList.push({ imageId: image.ImageId, seriesId: series.seriesId, studyIndex: studyIndex, seriesIndex: seriesIndex, visitTaskId: series.visitTaskId, priority })
})
} else {
series.imageIds.map((imageId) => {
this.imageList.push({ imageId: imageId, seriesId: series.seriesId, studyIndex: studyIndex, seriesIndex: seriesIndex, visitTaskId: series.visitTaskId, priority })
})
}
if (this.imageList.length > 0) {
this.loopLoadStatus = 0
this.loopLoad()
@ -731,17 +768,10 @@ export default {
// }
//
if (!isCurrentTask && study.IsCriticalSequence) {
if (series.isExistMutiFrames) {
series.instanceInfoList.map(image => {
series.imageIds.map(image => {
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, seriesId: series.seriesId, studyIndex: studyIndex, seriesIndex: seriesIndex, visitTaskId: series.visitTaskId, priority })
})
} else {
series.imageIds.map(imageId => {
priority = priority - 1
this.imageList.push({ imageId: imageId, seriesId: series.seriesId, studyIndex: studyIndex, seriesIndex: seriesIndex, visitTaskId: series.visitTaskId, priority })
})
}
}
}
})
@ -753,7 +783,9 @@ export default {
if (this.imageList.length > 0) {
// requestPoolManager.startTaskTimer()
this.imageList.map(image => {
requestPoolManager.loadAndCacheImagePlus(image.imageId, image.seriesId, image.priority)
requestPoolManager.loadAndCacheImagePlus(image.imageId, image.seriesId, image.priority).then(res => {
this.imageLoaded(image, res.data.string('x0020000e'))
})
})
requestPoolManager.sortTaskPool()
@ -773,21 +805,12 @@ export default {
}
if (!isAddToTakPool) {
const priority = parseInt(new Date().getTime())
if (series.isExistMutiFrames) {
series.instanceInfoList.map(image => {
const index = this.cachedImages.findIndex(item => item.uri === image)
if (index === -1) {
this.imageList.push({ imageId: image.ImageId, seriesId: series.seriesId, studyIndex: studyIndex, seriesIndex: seriesIndex, visitTaskId: series.visitTaskId, priority })
}
})
} else {
series.imageIds.map(image => {
const index = this.cachedImages.findIndex(item => item.uri === image)
if (index === -1) {
this.imageList.push({ imageId: image, seriesId: series.seriesId, studyIndex: studyIndex, seriesIndex: seriesIndex, visitTaskId: series.visitTaskId, priority })
}
})
}
if (this.imageList.length > 0) {
this.loopLoadStatus = 0
this.loopLoad()
@ -872,45 +895,6 @@ export default {
// }
// }
},
cornerstoneimageloadprogress(e) {
const imageId = e.detail.imageId
const percentComplete = e.detail.percentComplete
const params = {}
const searchParams = new URLSearchParams(imageId.split('?')[1])
for (const [key, value] of searchParams.entries()) {
params[key] = value
}
if (this.visitTaskId === params.visitTaskId) {
const studyIndex = params.idx.split('|')[0]
const seriesIndex = params.idx.split('|')[1]
var prefetchInstanceCount = this.studyList[studyIndex].SeriesList[seriesIndex].prefetchInstanceCount
var instanceCount = this.studyList[studyIndex].SeriesList[seriesIndex].instanceCount
if (this.studyList[studyIndex].SeriesList[seriesIndex].imageloadedArr.indexOf(imageId) < 0) {
const i = this.currentLoadIns.findIndex(i => i.imageId === imageId)
if (i > -1) {
prefetchInstanceCount = prefetchInstanceCount - this.currentLoadIns[i].percentComplete + percentComplete
this.currentLoadIns[i].percentComplete = percentComplete
if (percentComplete === 100) {
this.currentLoadIns.splice(i, 1)
}
} else {
if (percentComplete !== 100) {
this.currentLoadIns.push({ imageId, percentComplete })
}
prefetchInstanceCount = prefetchInstanceCount + percentComplete
}
this.studyList[studyIndex].SeriesList[seriesIndex].prefetchInstanceCount = prefetchInstanceCount
if (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)