Compare commits
No commits in common. "b409d6696f8f93903593ca62acbe3aa9c5a495ba" and "97052452f3c03bb267183cf8600675f096cfd7e8" have entirely different histories.
b409d6696f
...
97052452f3
|
@ -17,7 +17,7 @@ async function executeTask() {
|
||||||
if (taskPool.length > 0) {
|
if (taskPool.length > 0) {
|
||||||
// let startSortTime = performance.now()
|
// let startSortTime = performance.now()
|
||||||
if( sortType ){
|
if( sortType ){
|
||||||
maxRequest = 6
|
sortTaskPool()
|
||||||
}
|
}
|
||||||
// let endSortTime = performance.now()
|
// let endSortTime = performance.now()
|
||||||
var requestNum = Math.min(taskPool.length, maxRequest)
|
var requestNum = Math.min(taskPool.length, maxRequest)
|
||||||
|
|
|
@ -156,39 +156,28 @@ export default {
|
||||||
showSeriesList: []
|
showSeriesList: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created: function() {
|
||||||
this.type = this.$router.currentRoute.query.type ? this.$router.currentRoute.query.type : ''
|
|
||||||
|
|
||||||
this.visitNum = this.$router.currentRoute.query.visitNum ? parseInt(this.$router.currentRoute.query.visitNum) : 0
|
|
||||||
// cornerstone.events.addEventListener('cornerstoneimageloaded', this.cornerstoneImageLoaded)
|
|
||||||
// cornerstone.events.addEventListener('datasetscachechanged', this.datasetsCacheChanged)
|
|
||||||
if (this.$router.currentRoute.query.TokenKey) {
|
|
||||||
store.dispatch('user/setToken', this.$router.currentRoute.query.TokenKey)
|
|
||||||
changeURLStatic('TokenKey', '')
|
|
||||||
}
|
|
||||||
this.studyId = this.$router.currentRoute.query.studyId
|
|
||||||
if (this.type === 'Series') {
|
|
||||||
// this.initStudy()
|
|
||||||
this.showDelete = parseInt(this.$router.currentRoute.query.showDelete)
|
|
||||||
this.initSeries()
|
|
||||||
} else if (this.type === 'Study') {
|
|
||||||
this.showDelete = parseInt(this.$router.currentRoute.query.showDelete)
|
|
||||||
this.loadStudy()
|
|
||||||
} else if (this.type === 'Share') {
|
|
||||||
this.loadStudy()
|
|
||||||
try {
|
try {
|
||||||
|
console.log(this.$route.query)
|
||||||
this.type = this.$route.query.type ? this.$route.query.type : ''
|
this.type = this.$route.query.type ? this.$route.query.type : ''
|
||||||
this.visitNum = this.$router.currentRoute.query.visitNum ? parseInt(this.$router.currentRoute.query.visitNum) : 0
|
this.visitNum = this.$router.currentRoute.query.visitNum ? parseInt(this.$router.currentRoute.query.visitNum) : 0
|
||||||
|
console.log(this.type)
|
||||||
|
console.log(111)
|
||||||
cornerstone.events.addEventListener('cornerstoneimageloaded', this.cornerstoneImageLoaded)
|
cornerstone.events.addEventListener('cornerstoneimageloaded', this.cornerstoneImageLoaded)
|
||||||
// cornerstone.events.addEventListener('datasetscachechanged', this.datasetsCacheChanged)
|
// cornerstone.events.addEventListener('datasetscachechanged', this.datasetsCacheChanged)
|
||||||
if (this.$router.currentRoute.query.TokenKey) {
|
if (this.$router.currentRoute.query.TokenKey) {
|
||||||
store.dispatch('user/setToken', this.$router.currentRoute.query.TokenKey)
|
store.dispatch('user/setToken', this.$router.currentRoute.query.TokenKey)
|
||||||
changeURLStatic('TokenKey', '')
|
changeURLStatic('TokenKey', '')
|
||||||
}
|
}
|
||||||
|
console.log(222)
|
||||||
|
console.log(this.type)
|
||||||
this.studyId = this.$router.currentRoute.query.studyId
|
this.studyId = this.$router.currentRoute.query.studyId
|
||||||
if (this.type === 'Series') {
|
if (this.type === 'Series') {
|
||||||
// this.initStudy()
|
// this.initStudy()
|
||||||
|
console.log(333)
|
||||||
|
console.log(this.$router.currentRoute.query.showDelete)
|
||||||
this.showDelete = parseInt(this.$router.currentRoute.query.showDelete)
|
this.showDelete = parseInt(this.$router.currentRoute.query.showDelete)
|
||||||
|
console.log(333)
|
||||||
this.initSeries()
|
this.initSeries()
|
||||||
} else if (this.type === 'Study') {
|
} else if (this.type === 'Study') {
|
||||||
this.showDelete = parseInt(this.$router.currentRoute.query.showDelete)
|
this.showDelete = parseInt(this.$router.currentRoute.query.showDelete)
|
||||||
|
@ -262,7 +251,6 @@ export default {
|
||||||
})
|
})
|
||||||
scope.seriesList = seriesList
|
scope.seriesList = seriesList
|
||||||
if (scope.seriesList.length > 0) {
|
if (scope.seriesList.length > 0) {
|
||||||
this.loadAllImages()
|
|
||||||
scope.$refs.dicomViewer.loadImageStack(scope.seriesList[0], scope.labels[scope.tpCode])
|
scope.$refs.dicomViewer.loadImageStack(scope.seriesList[0], scope.labels[scope.tpCode])
|
||||||
scope.firstInstanceId = scope.seriesList[0].imageIds[0]
|
scope.firstInstanceId = scope.seriesList[0].imageIds[0]
|
||||||
}
|
}
|
||||||
|
@ -472,16 +460,11 @@ export default {
|
||||||
},
|
},
|
||||||
loadAllImages() {
|
loadAllImages() {
|
||||||
var priority = new Date().getTime()
|
var priority = new Date().getTime()
|
||||||
this.seriesList.forEach((series, index) => {
|
this.seriesList.forEach(series => {
|
||||||
series.imageIds.forEach(imageId => {
|
series.imageIds.forEach(imageId => {
|
||||||
var p = null
|
priority--
|
||||||
if (this.firstInstanceId === imageId) {
|
|
||||||
p = priority * 100
|
|
||||||
} else {
|
|
||||||
p = priority - 1
|
|
||||||
}
|
|
||||||
// this.load(imageId, series.seriesId, priority)
|
// this.load(imageId, series.seriesId, priority)
|
||||||
this.imageList.push({ imageId: imageId, seriesId: series.seriesId, seriesIndex: index, priority: p })
|
this.imageList.push({ imageId: imageId, seriesId: series.seriesId, priority })
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
if (this.imageList.length > 0) {
|
if (this.imageList.length > 0) {
|
||||||
|
@ -491,13 +474,12 @@ export default {
|
||||||
loopLoad() {
|
loopLoad() {
|
||||||
if (this.imageList.length > 0) {
|
if (this.imageList.length > 0) {
|
||||||
requestPoolManager.startTaskTimer()
|
requestPoolManager.startTaskTimer()
|
||||||
console.log('loopLoad')
|
|
||||||
this.imageList.map(image => {
|
this.imageList.map(image => {
|
||||||
requestPoolManager.loadAndCacheImagePlus(image.imageId, image.seriesId, image.priority).then(res => {
|
requestPoolManager.loadAndCacheImagePlus(image.imageId, image.seriesId, image.priority).then(res => {
|
||||||
this.imageLoaded(image, res.data.string('x0020000e'))
|
this.imageLoaded(image, res.data.string('x0020000e'))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
requestPoolManager.sortTaskPool()
|
|
||||||
this.imageList = []
|
this.imageList = []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -512,24 +494,7 @@ export default {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
imageLoaded(image, seriesUid) {
|
imageLoaded(imageId, seriesUid) {
|
||||||
var seriesIndex = image.seriesIndex
|
|
||||||
if (seriesIndex < 0) return
|
|
||||||
if (this.seriesList[seriesIndex].imageloadedArr.indexOf(image.imageId) < 0) {
|
|
||||||
++this.seriesList[seriesIndex].prefetchInstanceCount
|
|
||||||
this.seriesList[seriesIndex].imageloadedArr.push(image.imageId)
|
|
||||||
|
|
||||||
if (this.seriesList[seriesIndex].prefetchInstanceCount >= this.seriesList[seriesIndex].instanceCount) {
|
|
||||||
this.seriesList[seriesIndex].prefetchInstanceCount = this.seriesList[seriesIndex].instanceCount
|
|
||||||
// 设置当前序列状态为已下载完成
|
|
||||||
this.seriesList[seriesIndex].loadStatus = true
|
|
||||||
// if (!this.isLoadedAll) {
|
|
||||||
// this.loadAllImages()
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
imageLoaded2(imageId, seriesUid) {
|
|
||||||
var seriesIndex = -1
|
var seriesIndex = -1
|
||||||
for (let i = 0; i < this.seriesList.length; ++i) {
|
for (let i = 0; i < this.seriesList.length; ++i) {
|
||||||
if (this.seriesList[i].seriesUid === seriesUid) {
|
if (this.seriesList[i].seriesUid === seriesUid) {
|
||||||
|
|
|
@ -248,7 +248,7 @@ export default {
|
||||||
this.visitInfo = this.$router.currentRoute.query.visitInfo
|
this.visitInfo = this.$router.currentRoute.query.visitInfo
|
||||||
this.isReading = this.$router.currentRoute.query.isReading ? this.$router.currentRoute.query.isReading * 1 : 0
|
this.isReading = this.$router.currentRoute.query.isReading ? this.$router.currentRoute.query.isReading * 1 : 0
|
||||||
this.showDelete = parseInt(this.$router.currentRoute.query.showDelete)
|
this.showDelete = parseInt(this.$router.currentRoute.query.showDelete)
|
||||||
// cornerstone.events.addEventListener('cornerstoneimageloaded', this.cornerstoneImageLoaded)
|
cornerstone.events.addEventListener('cornerstoneimageloaded', this.cornerstoneImageLoaded)
|
||||||
this.getStudiesInfo()
|
this.getStudiesInfo()
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
|
@ -311,7 +311,6 @@ export default {
|
||||||
instanceId = instanceId.split('.')[0]
|
instanceId = instanceId.split('.')[0]
|
||||||
this.firstInstanceId = instanceId
|
this.firstInstanceId = instanceId
|
||||||
this.activeNames = [this.studyList[0].StudyId]
|
this.activeNames = [this.studyList[0].StudyId]
|
||||||
this.loadAllImages()
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -498,23 +497,14 @@ export default {
|
||||||
},
|
},
|
||||||
loadAllImages() {
|
loadAllImages() {
|
||||||
var priority = parseInt(new Date().getTime())
|
var priority = parseInt(new Date().getTime())
|
||||||
this.studyList.map((study, studyIndex) => {
|
this.studyList.map(study => {
|
||||||
study.SeriesList.map((series, seriesIndex) => {
|
study.SeriesList.map(series => {
|
||||||
|
if (!series.loadStatus && series.seriesId !== this.firstSeriesId) {
|
||||||
series.imageIds.map(imageId => {
|
series.imageIds.map(imageId => {
|
||||||
var p = null
|
// imageIds.push({ imageId: image, seriesId: series.seriesId, priority })
|
||||||
if (this.firstInstanceId === imageId) {
|
this.imageList.push({ imageId: imageId, seriesId: series.seriesId, priority })
|
||||||
p = priority * 100
|
|
||||||
} else {
|
|
||||||
p = priority - 1
|
|
||||||
}
|
|
||||||
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) {
|
if (this.imageList.length > 0) {
|
||||||
|
@ -572,13 +562,26 @@ export default {
|
||||||
// 清理缓存的影像
|
// 清理缓存的影像
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
imageLoaded(image, seriesUid) {
|
imageLoaded(imageId, seriesUid) {
|
||||||
var studyIndex = image.studyIndex
|
var studyIndex = -1
|
||||||
var seriesIndex = image.seriesIndex
|
var seriesIndex = -1
|
||||||
if (seriesIndex < 0 || studyIndex < 0) return
|
for (let i = 0; i < this.studyList.length; ++i) {
|
||||||
if (this.studyList[studyIndex].SeriesList[seriesIndex].imageloadedArr.indexOf(image.imageId) < 0) {
|
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) {
|
||||||
++this.studyList[studyIndex].SeriesList[seriesIndex].prefetchInstanceCount
|
++this.studyList[studyIndex].SeriesList[seriesIndex].prefetchInstanceCount
|
||||||
this.studyList[studyIndex].SeriesList[seriesIndex].imageloadedArr.push(image.imageId)
|
this.studyList[studyIndex].SeriesList[seriesIndex].imageloadedArr.push(imageId)
|
||||||
|
|
||||||
if (this.studyList[studyIndex].SeriesList[seriesIndex].prefetchInstanceCount >= this.studyList[studyIndex].SeriesList[seriesIndex].instanceCount) {
|
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].prefetchInstanceCount = this.studyList[studyIndex].SeriesList[seriesIndex].instanceCount
|
||||||
|
|
|
@ -49,18 +49,18 @@
|
||||||
/>
|
/>
|
||||||
<div class="image-desc">
|
<div class="image-desc">
|
||||||
<div class="flex-div">
|
<div class="flex-div">
|
||||||
<div v-if="!study.IsCriticalSequence">#{{ series.seriesNumber }} </div>
|
<div>#{{ series.seriesNumber }} </div>
|
||||||
<div v-if="series.isDicom && series.prefetchInstanceCount<series.instanceCount && series.modality!== 'SR'">
|
<div v-if="series.isDicom && series.prefetchInstanceCount<series.instanceCount">
|
||||||
<!-- 下载 -->
|
<!-- 下载 -->
|
||||||
<el-tooltip v-if="!series.isLoading" class="item" effect="dark" :content="$t('trials:reading:button:download')" placement="bottom">
|
<el-tooltip v-if="!series.isLoading" class="item" effect="dark" :content="$t('trials:reading:button:download')" placement="bottom">
|
||||||
<i class="el-icon-video-play" style="font-size: 18px;margin-right: 5px;color: #ffeb3b;cursor: pointer;" @click.stop="loadSeries(series,index,i)" />
|
<i class="el-icon-video-play" style="font-size: 18px;margin-right: 5px;color: #ffeb3b;cursor: pointer;" @click.stop="loadSeries(series,index,i)" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<!-- 暂停 -->
|
<!-- 暂停 -->
|
||||||
<!-- <el-tooltip v-else class="item" effect="dark" :content="$t('trials:reading:button:pause')" placement="bottom">
|
<el-tooltip v-else class="item" effect="dark" :content="$t('trials:reading:button:pause')" placement="bottom">
|
||||||
<i class="el-icon-video-pause" style="font-size: 18px;margin-right: 5px;color: #ffeb3b;cursor: pointer;" @click.stop="stopLoadSeries(series,index,i)" />
|
<i class="el-icon-video-pause" style="font-size: 18px;margin-right: 5px;color: #ffeb3b;cursor: pointer;" @click.stop="stopLoadSeries(series,index,i)" />
|
||||||
</el-tooltip> -->
|
</el-tooltip>
|
||||||
</div>
|
</div>
|
||||||
<el-tooltip v-else-if="series.isDicom && series.prefetchInstanceCount === 0 &&series.modality!== 'SR'" class="item" effect="dark" :content="$t('trials:reading:button:download')" placement="bottom">
|
<el-tooltip v-else-if="series.prefetchInstanceCount === 0" class="item" effect="dark" :content="$t('trials:reading:button:download')" placement="bottom">
|
||||||
<i class="el-icon-video-play" style="font-size: 18px;margin-right: 5px;color: #ffeb3b;cursor: pointer;" @click.stop="loadSeries(series,index,i)" />
|
<i class="el-icon-video-play" style="font-size: 18px;margin-right: 5px;color: #ffeb3b;cursor: pointer;" @click.stop="loadSeries(series,index,i)" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</div>
|
</div>
|
||||||
|
@ -70,15 +70,15 @@
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p v-show="series.sliceThickness && !study.IsCriticalSequence">
|
<p v-show="series.sliceThickness">
|
||||||
T: {{ parseFloat(series.sliceThickness).toFixed(digitPlaces) }}
|
T: {{ series.sliceThickness }}
|
||||||
</p>
|
</p>
|
||||||
<p v-show="series.instanceCount">
|
<p v-show="series.instanceCount">
|
||||||
{{ series.modality }}: {{ series.instanceCount }} image
|
{{ series.modality }}: {{ series.instanceCount }} image
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="flex-div">
|
<div class="flex-div">
|
||||||
<div v-if="measureData.findIndex(v=>v.SeriesId === series.seriesId && v.MeasureData) > -1">
|
<div v-if="measureData && measureData.findIndex(v=>v.SeriesId === series.seriesId) > -1">
|
||||||
<!-- 有标注 -->
|
<!-- 有标注 -->
|
||||||
<el-tooltip class="item" effect="dark" :content="$t('trials:reading:button:marked')" placement="right">
|
<el-tooltip class="item" effect="dark" :content="$t('trials:reading:button:marked')" placement="right">
|
||||||
<i class="el-icon-star-on" style="font-size: 16px;color: #ff5722;" />
|
<i class="el-icon-star-on" style="font-size: 16px;color: #ff5722;" />
|
||||||
|
@ -99,47 +99,22 @@
|
||||||
</el-collapse-item>
|
</el-collapse-item>
|
||||||
</el-collapse>
|
</el-collapse>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="sr-wrapper">
|
|
||||||
<el-dialog
|
|
||||||
:visible.sync="srDialogVisible"
|
|
||||||
:custom-class="isSrFullscreen?'sr-full-dialog-container':'sr-dialog-container'"
|
|
||||||
:show-close="false"
|
|
||||||
:close-on-click-modal="false"
|
|
||||||
:fullscreen="isSrFullscreen"
|
|
||||||
>
|
|
||||||
<span slot="title" class="dialog-footer">
|
|
||||||
<div style="position: absolute;right: 20px;top: 10px;">
|
|
||||||
<svg-icon :icon-class="isSrFullscreen?'exit-fullscreen':'fullscreen'" style="cursor: pointer;font-size: 20px;color:#000;" @click="isSrFullscreen=!isSrFullscreen" />
|
|
||||||
<svg-icon icon-class="dClose" style="cursor: pointer;font-size: 25px;margin-left: 10px;" @click="srDialogVisible = false" />
|
|
||||||
</div>
|
|
||||||
</span>
|
|
||||||
<div style="height: 100%;margin:0;">
|
|
||||||
<SrList
|
|
||||||
v-if="srDialogVisible"
|
|
||||||
:sr-info="srInfo"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import * as dicomParser from 'dicom-parser'
|
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 * 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'
|
|
||||||
cornerstoneWADOImageLoader.external.dicomParser = dicomParser
|
cornerstoneWADOImageLoader.external.dicomParser = dicomParser
|
||||||
cornerstoneWADOImageLoader.external.cornerstone = cornerstone
|
cornerstoneWADOImageLoader.external.cornerstone = cornerstone
|
||||||
const maximumSizeInBytes = 1024 * 1024 * 1024 // 1 GB
|
// const maximumSizeInBytes = 1024 * 1024 * 1024 // 1 GB
|
||||||
cornerstone.imageCache.setMaximumSizeBytes(maximumSizeInBytes)
|
|
||||||
export default {
|
export default {
|
||||||
name: 'StudyList',
|
name: 'StudyList',
|
||||||
components: { SrList },
|
|
||||||
props: {
|
props: {
|
||||||
trialId: {
|
trialId: {
|
||||||
type: String,
|
type: String,
|
||||||
|
@ -170,7 +145,6 @@ export default {
|
||||||
return {
|
return {
|
||||||
studyList: [],
|
studyList: [],
|
||||||
cachedImages: [],
|
cachedImages: [],
|
||||||
showSeriesList: [],
|
|
||||||
studyIndex: null,
|
studyIndex: null,
|
||||||
seriesIndex: null,
|
seriesIndex: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
|
@ -180,15 +154,9 @@ export default {
|
||||||
activeNames: [],
|
activeNames: [],
|
||||||
seriesArr: [],
|
seriesArr: [],
|
||||||
imageList: [],
|
imageList: [],
|
||||||
loopLoadStatus: 0, // -1暂停下载 0未下载完成 1下载完成
|
loopLoadStatus: 0 // -1暂停下载 0未下载完成 1下载完成
|
||||||
isSrFullscreen: false,
|
|
||||||
srDialogVisible: false,
|
|
||||||
srInfo: {},
|
|
||||||
digitPlaces: 2,
|
|
||||||
visitTaskIdx: -1
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters(['visitTaskList', 'currentTaskId', 'activeSeries'])
|
...mapGetters(['visitTaskList', 'currentTaskId', 'activeSeries'])
|
||||||
},
|
},
|
||||||
|
@ -200,14 +168,6 @@ export default {
|
||||||
if (idx === -1) return
|
if (idx === -1) return
|
||||||
this.measureData = this.visitTaskList[idx].MeasureData
|
this.measureData = this.visitTaskList[idx].MeasureData
|
||||||
}
|
}
|
||||||
},
|
|
||||||
visitTaskId: {
|
|
||||||
immediate: true,
|
|
||||||
handler(val) {
|
|
||||||
var idx = this.visitTaskList.findIndex(i => i.VisitTaskId === this.visitTaskId)
|
|
||||||
if (idx === -1) return
|
|
||||||
this.visitTaskIdx = idx
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// activeSeries: {
|
// activeSeries: {
|
||||||
// immediate: true,
|
// immediate: true,
|
||||||
|
@ -220,8 +180,10 @@ export default {
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.subjectCode = this.$router.currentRoute.query.subjectCode
|
this.subjectCode = this.$router.currentRoute.query.subjectCode
|
||||||
var digitPlaces = Number(localStorage.getItem('digitPlaces'))
|
// DicomEvent.$on('getMeasureData', () => {
|
||||||
this.digitPlaces = digitPlaces === -1 ? this.digitPlaces : digitPlaces
|
// 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)
|
||||||
|
@ -229,12 +191,12 @@ export default {
|
||||||
// this.studyList = this.visitTaskList[idx].StudyList
|
// this.studyList = this.visitTaskList[idx].StudyList
|
||||||
// }
|
// }
|
||||||
// })
|
// })
|
||||||
|
|
||||||
cornerstone.events.addEventListener('cornerstoneimageloaded', this.cornerstoneImageLoaded)
|
cornerstone.events.addEventListener('cornerstoneimageloaded', this.cornerstoneImageLoaded)
|
||||||
// cornerstone.events.addEventListener('cornerstoneimagecachefull', this.cornerstoneimagecachefull)
|
|
||||||
// cornerstone.events.addEventListener('cornerstoneimagecachechanged', this.cornerstoneimagecachechanged)
|
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
cornerstone.imageCache.purgeCache()
|
cornerstone.imageCache.purgeCache()
|
||||||
|
// DicomEvent.$off('getMeasureData')
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
initStudyInfo() {
|
initStudyInfo() {
|
||||||
|
@ -247,54 +209,7 @@ export default {
|
||||||
})
|
})
|
||||||
var i = res.findIndex(s => s.isCurrentTask)
|
var i = res.findIndex(s => s.isCurrentTask)
|
||||||
if (i > -1) {
|
if (i > -1) {
|
||||||
var idx = this.visitTaskList.findIndex(i => i.VisitTaskId === this.visitTaskId)
|
var p = this.visitTaskId === this.currentTaskId ? parseInt(new Date().getTime()) : 999 // 非当前任务,符合自动下载的权重次之
|
||||||
if (idx > -1) {
|
|
||||||
this.measureData = this.visitTaskList[idx].MeasureData
|
|
||||||
this.studyList = this.visitTaskList[idx].StudyList
|
|
||||||
var priority = parseInt(new Date().getTime())
|
|
||||||
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)
|
var idx = this.visitTaskList.findIndex(i => i.VisitTaskId === this.visitTaskId)
|
||||||
if (idx > -1) {
|
if (idx > -1) {
|
||||||
this.measureData = this.visitTaskList[idx].MeasureData
|
this.measureData = this.visitTaskList[idx].MeasureData
|
||||||
|
@ -302,8 +217,7 @@ export default {
|
||||||
|
|
||||||
this.studyList.map((study, studyIndex) => {
|
this.studyList.map((study, studyIndex) => {
|
||||||
study.SeriesList.map((series, seriesIndex) => {
|
study.SeriesList.map((series, seriesIndex) => {
|
||||||
if (series.modality !== 'SR') {
|
var sliceThickness = isNaN(parseInt(series.sliceThickness)) ? null : parseInt(series.sliceThickness)
|
||||||
// var sliceThickness = isNaN(parseInt(series.sliceThickness)) ? null : parseInt(series.sliceThickness)
|
|
||||||
// if (sliceThickness === 5 || series.instanceCount <= 100) {
|
// if (sliceThickness === 5 || series.instanceCount <= 100) {
|
||||||
series.imageIds.map(image => {
|
series.imageIds.map(image => {
|
||||||
let priority = 0
|
let priority = 0
|
||||||
|
@ -314,31 +228,26 @@ export default {
|
||||||
}
|
}
|
||||||
this.imageList.push({ imageId: image, 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 })
|
||||||
})
|
})
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
this.loopLoad()
|
this.loopLoad()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DicomEvent.$emit('loadImageStacks', res)
|
DicomEvent.$emit('loadImageStacks', res)
|
||||||
loading.close()
|
|
||||||
this.isRender = true
|
|
||||||
}).catch(() => {
|
|
||||||
loading.close()
|
|
||||||
})
|
})
|
||||||
|
this.isRender = true
|
||||||
|
loading.close()
|
||||||
},
|
},
|
||||||
// 获取初始化序列信息
|
// 获取初始化序列信息
|
||||||
loadInitialImage(seriesInfo) {
|
loadInitialImage(seriesInfo) {
|
||||||
var p = parseInt(new Date().getTime())
|
var p = parseInt(new Date().getTime())
|
||||||
var imageId = seriesInfo.imageIds[seriesInfo.imageIdIndex]
|
var imageId = seriesInfo.imageIds[seriesInfo.imageIdIndex]
|
||||||
requestPoolManager.loadAndCacheImagePlus(imageId, seriesInfo.seriesId, p * 100).then(res => {
|
requestPoolManager.loadAndCacheImagePlus(imageId, seriesInfo.seriesId, p * 100).then(res => {
|
||||||
if (seriesInfo.isCurrentTask) {
|
this.imageLoaded(seriesInfo, res.data.string('x0020000e'))
|
||||||
this.imageLoaded({ studyIndex: seriesInfo.studyIndex, seriesIndex: seriesInfo.seriesIndex, imageId: res.imageId }, res.data.string('x0020000e'))
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
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) {
|
||||||
|
@ -410,8 +319,7 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
const sIdx = this.studyList.findIndex(s => s.IsDicom)
|
const sIdx = this.studyList.findIndex(s => s.IsDicom)
|
||||||
const series = this.studyList[sIdx].SeriesList[0]
|
const series = this.studyList[sIdx].SeriesList[0]
|
||||||
const imageIdIndex = Math.floor(series.imageIds.length / 2)
|
series.imageIdIndex = Math.floor(series.imageIds.length / 2) - 1
|
||||||
series.imageIdIndex = imageIdIndex > 0 ? imageIdIndex - 1 : 0
|
|
||||||
seriesList.push(series)
|
seriesList.push(series)
|
||||||
this.studyIndex = sIdx
|
this.studyIndex = sIdx
|
||||||
this.seriesIndex = 0
|
this.seriesIndex = 0
|
||||||
|
@ -476,7 +384,7 @@ export default {
|
||||||
idx > -1 ? seriesInfo = seriesList[idx] : seriesInfo = seriesList[0]
|
idx > -1 ? seriesInfo = seriesList[idx] : seriesInfo = seriesList[0]
|
||||||
}
|
}
|
||||||
if (seriesInfo) {
|
if (seriesInfo) {
|
||||||
const index = Math.floor(seriesInfo.imageIds.length * ((baseObj.series.imageIdIndex + 1) / baseObj.series.instanceCount))
|
let index = Math.floor(seriesInfo.imageIds.length * ((baseObj.series.imageIdIndex+ 1) / baseObj.series.instanceCount))
|
||||||
seriesInfo.imageIdIndex = index > 0 ? index - 1 : 0
|
seriesInfo.imageIdIndex = index > 0 ? index - 1 : 0
|
||||||
obj.studyIndex = seriesInfo.studyIndex
|
obj.studyIndex = seriesInfo.studyIndex
|
||||||
obj.seriesIndex = seriesInfo.seriesIndex
|
obj.seriesIndex = seriesInfo.seriesIndex
|
||||||
|
@ -529,9 +437,7 @@ export default {
|
||||||
if (seriesObj) {
|
if (seriesObj) {
|
||||||
obj.studyIndex = seriesObj.studyIndex
|
obj.studyIndex = seriesObj.studyIndex
|
||||||
obj.seriesIndex = seriesObj.seriesIdx
|
obj.seriesIndex = seriesObj.seriesIdx
|
||||||
const imageIdIndex = Math.floor(seriesObj.series.imageIds.length / 2)
|
seriesObj.series.imageIdIndex = Math.floor(seriesObj.series.imageIds.length / 2) - 1
|
||||||
|
|
||||||
seriesObj.series.imageIdIndex = imageIdIndex > 0 ? imageIdIndex - 1 : 0
|
|
||||||
obj.series = seriesObj.series
|
obj.series = seriesObj.series
|
||||||
obj.seriesId = seriesObj.series.seriesId
|
obj.seriesId = seriesObj.series.seriesId
|
||||||
obj.isMarked = false
|
obj.isMarked = false
|
||||||
|
@ -540,11 +446,11 @@ export default {
|
||||||
if (sIdx > -1) {
|
if (sIdx > -1) {
|
||||||
// 判断是否存在层厚为5的序列,否则显示第一个检查的第一个序列
|
// 判断是否存在层厚为5的序列,否则显示第一个检查的第一个序列
|
||||||
const series = studyList[sIdx].SeriesList[0]
|
const series = studyList[sIdx].SeriesList[0]
|
||||||
var imageIdIndex = series.imageIds.length > 1 ? Math.floor(series.imageIds.length / 2) - 1 : 0
|
var imageIdIndex = Math.floor(series.imageIds.length / 2) - 1
|
||||||
obj.studyIndex = sIdx
|
obj.studyIndex = sIdx
|
||||||
obj.seriesIndex = 0
|
obj.seriesIndex = 0
|
||||||
obj.series = series
|
obj.series = series
|
||||||
obj.series.imageIdIndex = imageIdIndex >= 0 ? imageIdIndex : 0
|
obj.series.imageIdIndex = imageIdIndex
|
||||||
obj.seriesId = series.seriesId
|
obj.seriesId = series.seriesId
|
||||||
obj.isMarked = false
|
obj.isMarked = false
|
||||||
}
|
}
|
||||||
|
@ -590,47 +496,31 @@ export default {
|
||||||
},
|
},
|
||||||
showSeriesImage(studyIndex, seriesIndex, series) {
|
showSeriesImage(studyIndex, seriesIndex, series) {
|
||||||
if (series.isDicom) {
|
if (series.isDicom) {
|
||||||
if (series.modality === 'SR') {
|
|
||||||
this.studyIndex = studyIndex
|
|
||||||
this.seriesIndex = seriesIndex
|
|
||||||
this.studyList[studyIndex].SeriesList[seriesIndex].measureData = this.measureData
|
|
||||||
this.srDialogVisible = true
|
|
||||||
this.srInfo = {
|
|
||||||
SubjectCode: series.studyCode,
|
|
||||||
TaskBlindName: series.taskBlindName,
|
|
||||||
SrList: series.instanceHtmlPathList
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.studyIndex = studyIndex
|
this.studyIndex = studyIndex
|
||||||
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]
|
||||||
this.$emit('loadImageStack', dicomStatck)
|
this.$emit('loadImageStack', dicomStatck)
|
||||||
if (!series.loadStatus && series.modality !== 'SR') {
|
if (!series.loadStatus) {
|
||||||
this.loopLoadStatus = -1
|
this.loopLoadStatus = -1
|
||||||
series.isLoading = true
|
series.isLoading = true
|
||||||
var isAddToTakPool = false
|
var p = parseInt(new Date().getTime())
|
||||||
if (this.showSeriesList.includes(`${studyIndex}_${seriesIndex}`)) {
|
series.imageIds.map((imageId, i) => {
|
||||||
isAddToTakPool = true
|
var priority = ''
|
||||||
|
if (i === 0) {
|
||||||
|
priority = parseInt(new Date().getTime()) * 10
|
||||||
} else {
|
} else {
|
||||||
this.showSeriesList.push(`${studyIndex}_${seriesIndex}`)
|
priority = --p
|
||||||
}
|
}
|
||||||
if (!isAddToTakPool) {
|
|
||||||
var priority = parseInt(new Date().getTime())
|
|
||||||
series.imageIds.map((imageId) => {
|
|
||||||
this.imageList.push({ imageId: imageId, seriesId: series.seriesId, studyIndex: studyIndex, seriesIndex: seriesIndex, visitTaskId: series.visitTaskId, priority })
|
this.imageList.push({ imageId: imageId, seriesId: series.seriesId, studyIndex: studyIndex, seriesIndex: seriesIndex, visitTaskId: series.visitTaskId, priority })
|
||||||
})
|
})
|
||||||
if (this.imageList.length > 0) {
|
if (this.imageList.length > 0) {
|
||||||
this.loopLoadStatus = 0
|
this.loopLoadStatus = 0
|
||||||
this.loopLoad()
|
this.loopLoad()
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
requestPoolManager.changePriority(series.seriesId)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DicomEvent.$emit('loadMeasurementList', { visitTaskId: this.visitTaskId, taskBlindName: this.taskBlindName })
|
DicomEvent.$emit('loadMeasurementList', { visitTaskId: this.visitTaskId, taskBlindName: this.taskBlindName })
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
// 非Dicom预览
|
// 非Dicom预览
|
||||||
this.$emit('previewNoneDicoms', { visitTaskId: this.visitTaskId })
|
this.$emit('previewNoneDicoms', { visitTaskId: this.visitTaskId })
|
||||||
|
@ -675,27 +565,14 @@ export default {
|
||||||
this.loadImages(this.visitTaskList[idx])
|
this.loadImages(this.visitTaskList[idx])
|
||||||
store.dispatch('reading/setActiveSeries', series)
|
store.dispatch('reading/setActiveSeries', series)
|
||||||
},
|
},
|
||||||
loadImages(taskInfo) {
|
loadImages1(taskInfo) {
|
||||||
// const isBaseLineTask = taskInfo.IsBaseLineTask
|
var priority = taskInfo.IsCurrentTask ? parseInt(new Date().getTime()) : 999
|
||||||
const isCurrentTask = taskInfo.IsCurrentTask
|
|
||||||
// var priority = isCurrentTask ? parseInt(new Date().getTime()) : 999
|
|
||||||
var priority = parseInt(new Date().getTime())
|
|
||||||
this.studyList.map((study, studyIndex) => {
|
this.studyList.map((study, studyIndex) => {
|
||||||
study.SeriesList.map((series, seriesIndex) => {
|
study.SeriesList.map((series, seriesIndex) => {
|
||||||
if (!series.loadStatus && series.isDicom && series.modality !== 'SR') {
|
if (!series.loadStatus) {
|
||||||
// if (isCurrentTask || isBaseLineTask) {
|
var sliceThickness = isNaN(parseInt(series.sliceThickness)) ? null : parseInt(series.sliceThickness)
|
||||||
// // 当前任务/基线任务下载所有影像
|
if (series.isBeMark || sliceThickness === 5 || series.instanceCount <= 100) {
|
||||||
// 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) {
|
|
||||||
series.imageIds.map(image => {
|
series.imageIds.map(image => {
|
||||||
priority = priority - 1
|
priority = priority - 1
|
||||||
this.imageList.push({ imageId: image, 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 })
|
||||||
|
@ -706,16 +583,73 @@ export default {
|
||||||
})
|
})
|
||||||
this.loopLoad()
|
this.loopLoad()
|
||||||
},
|
},
|
||||||
|
loadImages(taskInfo) {
|
||||||
|
const isBaseLineTask = taskInfo.IsBaseLineTask
|
||||||
|
const isCurrentTask = taskInfo.IsCurrentTask
|
||||||
|
// var priority = isCurrentTask ? parseInt(new Date().getTime()) : 999
|
||||||
|
var priority = parseInt(new Date().getTime())
|
||||||
|
this.studyList.map((study, studyIndex) => {
|
||||||
|
study.SeriesList.map((series, seriesIndex) => {
|
||||||
|
if (!series.loadStatus && series.isDicom) {
|
||||||
|
if (isCurrentTask || isBaseLineTask) {
|
||||||
|
// 当前任务/基线任务下载所有影像
|
||||||
|
series.imageIds.map(image => {
|
||||||
|
priority = priority - 1
|
||||||
|
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 => {
|
||||||
|
priority = priority - 1
|
||||||
|
this.imageList.push({ imageId: image, seriesId: series.seriesId, studyIndex: studyIndex, seriesIndex: seriesIndex, visitTaskId: series.visitTaskId, priority })
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
this.loopLoad()
|
||||||
|
},
|
||||||
|
loadImages2(taskInfo) {
|
||||||
|
var priority = parseInt(new Date().getTime())
|
||||||
|
// 当前任务只自动下载层厚为5mm 或者影像数量小于 100张
|
||||||
|
if (taskInfo.IsCurrentTask) {
|
||||||
|
this.studyList.map((study, studyIndex) => {
|
||||||
|
study.SeriesList.map((series, seriesIndex) => {
|
||||||
|
var sliceThickness = isNaN(parseInt(series.sliceThickness)) ? null : parseInt(series.sliceThickness)
|
||||||
|
if (sliceThickness === 5 || series.instanceCount <= 100) {
|
||||||
|
series.imageIds.map(image => {
|
||||||
|
priority = priority - 1
|
||||||
|
this.imageList.push({ imageId: image, seriesId: series.seriesId, studyIndex: studyIndex, seriesIndex: seriesIndex, visitTaskId: series.visitTaskId, priority })
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
this.loopLoad()
|
||||||
|
} else {
|
||||||
|
// 非当前任务只自动下载关键序列
|
||||||
|
var idx = this.studyList.findIndex(study => study.IsCriticalSequence)
|
||||||
|
if (idx === -1) return
|
||||||
|
|
||||||
|
this.studyList[idx].SeriesList.forEach((series, seriesIndex) => {
|
||||||
|
if (!series.loadStatus) {
|
||||||
|
series.imageIds.map(image => {
|
||||||
|
priority--
|
||||||
|
this.imageList.push({ imageId: image, seriesId: series.seriesId, studyIndex: idx, seriesIndex: seriesIndex, visitTaskId: series.visitTaskId, priority })
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.loopLoad()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
loopLoad() {
|
loopLoad() {
|
||||||
if (this.imageList.length > 0) {
|
if (this.imageList.length > 0) {
|
||||||
// requestPoolManager.startTaskTimer()
|
requestPoolManager.startTaskTimer()
|
||||||
this.imageList.map(image => {
|
this.imageList.map(image => {
|
||||||
requestPoolManager.loadAndCacheImagePlus(image.imageId, image.seriesId, image.priority).then(res => {
|
requestPoolManager.loadAndCacheImagePlus(image.imageId, image.seriesId, image.priority).then(res => {
|
||||||
this.imageLoaded(image, res.data.string('x0020000e'))
|
this.imageLoaded(image, res.data.string('x0020000e'))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
requestPoolManager.sortTaskPool()
|
|
||||||
|
|
||||||
this.imageList = []
|
this.imageList = []
|
||||||
}
|
}
|
||||||
|
@ -725,17 +659,9 @@ export default {
|
||||||
console.log('loadSeries')
|
console.log('loadSeries')
|
||||||
this.loopLoadStatus = -1
|
this.loopLoadStatus = -1
|
||||||
this.$set(this.studyList[studyIndex].SeriesList[seriesIndex], 'isLoading', true)
|
this.$set(this.studyList[studyIndex].SeriesList[seriesIndex], 'isLoading', true)
|
||||||
var isAddToTakPool = false
|
|
||||||
if (this.showSeriesList.includes(`${studyIndex}_${seriesIndex}`)) {
|
|
||||||
isAddToTakPool = true
|
|
||||||
} else {
|
|
||||||
this.showSeriesList.push(`${studyIndex}_${seriesIndex}`)
|
|
||||||
}
|
|
||||||
if (!isAddToTakPool) {
|
|
||||||
const priority = parseInt(new Date().getTime())
|
const priority = parseInt(new Date().getTime())
|
||||||
series.imageIds.map(image => {
|
series.imageIds.map(image => {
|
||||||
const index = this.cachedImages.findIndex(item => item.uri === image)
|
if (series.imageloadedArr.indexOf(image) === -1) {
|
||||||
if (index === -1) {
|
|
||||||
this.imageList.push({ imageId: image, 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 })
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -743,9 +669,6 @@ export default {
|
||||||
this.loopLoadStatus = 0
|
this.loopLoadStatus = 0
|
||||||
this.loopLoad()
|
this.loopLoad()
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
requestPoolManager.changePriority(series.seriesId)
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
// 暂停下载
|
// 暂停下载
|
||||||
stopLoadSeries(series, studyIndex, seriesIndex) {
|
stopLoadSeries(series, studyIndex, seriesIndex) {
|
||||||
|
@ -754,81 +677,47 @@ export default {
|
||||||
this.$set(this.studyList[studyIndex].SeriesList[seriesIndex], 'isLoading', false)
|
this.$set(this.studyList[studyIndex].SeriesList[seriesIndex], 'isLoading', false)
|
||||||
},
|
},
|
||||||
async imageLoaded(image, seriesUid) {
|
async imageLoaded(image, seriesUid) {
|
||||||
// await store.dispatch('reading/updateStudyList', { visitTaskId: image.visitTaskId, imageId: image.imageId, 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下载成功回调
|
// instance下载成功回调
|
||||||
async cornerstoneImageLoaded(e) {
|
async cornerstoneImageLoaded(e) {
|
||||||
// var idx = this.visitTaskList.findIndex(i => i.VisitTaskId === this.visitTaskId)
|
await store.dispatch('reading/updateStudyList', { visitTaskId: this.visitTaskId, imageId: e.detail.image.imageId, seriesUid: e.detail.image.data.string('x0020000e') })
|
||||||
// if (idx === -1) return
|
var idx = this.visitTaskList.findIndex(i => i.VisitTaskId === this.visitTaskId)
|
||||||
// this.studyList = this.visitTaskList[idx].StudyList
|
this.studyList = this.visitTaskList[idx].StudyList
|
||||||
// if (!this.studyList || this.studyList.length === 0) {
|
if (!this.studyList || this.studyList.length === 0) {
|
||||||
// return
|
return
|
||||||
// }
|
}
|
||||||
// if (!this.visitTaskList[idx].IsInit) {
|
const uri = e.detail.image.sharedCacheKey
|
||||||
// const loading = this.$loading({ fullscreen: true })
|
const index = this.cachedImages.findIndex(item => item.uri === uri)
|
||||||
// await store.dispatch('reading/getMeasuredData', this.visitTaskList[idx].VisitTaskId)
|
if (index === -1) {
|
||||||
// await store.dispatch('reading/getStudyInfo', { trialId: this.trialId, subjectVisitId: this.visitTaskList[idx].VisitId, visitTaskId: this.visitTaskList[idx].VisitTaskId, taskBlindName: this.visitTaskList[idx].TaskBlindName })
|
this.cachedImages.push({ uri: uri, timestamp: new Date().getTime() })
|
||||||
// await store.dispatch('reading/getReadingQuestionAndAnswer', { trialId: this.trialId, visitTaskId: this.visitTaskList[idx].VisitTaskId })
|
} else {
|
||||||
// await store.dispatch('reading/getDicomReadingQuestionAnswer', { trialId: this.trialId, visitTaskId: this.visitTaskList[idx].VisitTaskId })
|
this.cachedImages[index].timestamp = new Date().getTime()
|
||||||
// await store.dispatch('reading/setStatus', { visitTaskId: this.visitTaskList[idx].VisitTaskId })
|
}
|
||||||
// loading.close()
|
var imageId = e.detail.image.imageId
|
||||||
// }
|
var seriesUid = e.detail.image.data.string('x0020000e')
|
||||||
// await store.dispatch('reading/updateStudyList', { visitTaskId: this.visitTaskId, imageId: e.detail.image.imageId, seriesUid: e.detail.image.data.string('x0020000e') })
|
var studyIndex = -1
|
||||||
// const uri = e.detail.image.sharedCacheKey
|
var seriesIndex = -1
|
||||||
// const index = this.cachedImages.findIndex(item => item.uri === uri)
|
for (let i = 0; i < this.studyList.length; ++i) {
|
||||||
// if (index === -1) {
|
for (let j = 0; j < this.studyList[i].SeriesList.length; ++j) {
|
||||||
// this.cachedImages.push({ uri: uri, timestamp: new Date().getTime() })
|
if (this.studyList[i].SeriesList[j].seriesUid === seriesUid) {
|
||||||
// } else {
|
studyIndex = i
|
||||||
// this.cachedImages[index].timestamp = new Date().getTime()
|
seriesIndex = j
|
||||||
// }
|
break
|
||||||
// var imageId = e.detail.image.imageId
|
}
|
||||||
// var seriesUid = e.detail.image.data.string('x0020000e')
|
}
|
||||||
// var studyIndex = -1
|
if (studyIndex > 0) break
|
||||||
// var seriesIndex = -1
|
}
|
||||||
// for (let i = 0; i < this.studyList.length; ++i) {
|
if (seriesIndex < 0) return
|
||||||
// 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)
|
const imageIdIndex = this.studyList[studyIndex].SeriesList[seriesIndex].imageIds.indexOf(imageId)
|
||||||
// if (imageIdIndex < 0) return
|
if (imageIdIndex < 0) return
|
||||||
// if (this.studyList[studyIndex].SeriesList[seriesIndex].imageloadedArr.indexOf(imageId) < 0) {
|
if (this.studyList[studyIndex].SeriesList[seriesIndex].imageloadedArr.indexOf(imageId) < 0) {
|
||||||
// if (this.studyList[studyIndex].SeriesList[seriesIndex].prefetchInstanceCount >= this.studyList[studyIndex].SeriesList[seriesIndex].instanceCount) {
|
if (this.studyList[studyIndex].SeriesList[seriesIndex].prefetchInstanceCount >= this.studyList[studyIndex].SeriesList[seriesIndex].instanceCount) {
|
||||||
// // 设置当前序列状态为已下载完成
|
// 设置当前序列状态为已下载完成
|
||||||
// this.studyList[studyIndex].SeriesList[seriesIndex].loadStatus = true
|
this.studyList[studyIndex].SeriesList[seriesIndex].loadStatus = true
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
},
|
|
||||||
cornerstoneimagecachechanged(e) {
|
|
||||||
const cacheInfo = cornerstone.imageCache.getCacheInfo()
|
|
||||||
console.log(cacheInfo)
|
|
||||||
},
|
|
||||||
cornerstoneimagecachefull(e) {
|
|
||||||
console.log('超过内存了')
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -841,7 +730,6 @@ export default {
|
||||||
width:100%;
|
width:100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
overflow-x: hidden;
|
|
||||||
.dicom-desc{
|
.dicom-desc{
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
|
@ -858,7 +746,7 @@ export default {
|
||||||
background-color: #607d8b!important;
|
background-color: #607d8b!important;
|
||||||
border: 1px solid #607d8b!important;
|
border: 1px solid #607d8b!important;
|
||||||
}
|
}
|
||||||
/deep/.el-progress__text{
|
/deep/ .el-progress__text{
|
||||||
color: #ccc;
|
color: #ccc;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
@ -924,18 +812,18 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/deep/.el-collapse{
|
.el-collapse{
|
||||||
border: none;
|
border: none;
|
||||||
.el-collapse-item{
|
/deep/ .el-collapse-item{
|
||||||
background-color: #000!important;
|
background-color: #000!important;
|
||||||
color: #ddd;
|
color: #ddd;
|
||||||
|
|
||||||
}
|
}
|
||||||
.el-collapse-item__content{
|
/deep/ .el-collapse-item__content{
|
||||||
padding-bottom:5px;
|
padding-bottom:5px;
|
||||||
background-color: #000!important;
|
background-color: #000!important;
|
||||||
}
|
}
|
||||||
.el-collapse-item__header{
|
/deep/ .el-collapse-item__header{
|
||||||
background-color: #000!important;
|
background-color: #000!important;
|
||||||
color: #ddd;
|
color: #ddd;
|
||||||
border-bottom-color:#5a5a5a;
|
border-bottom-color:#5a5a5a;
|
||||||
|
@ -944,33 +832,5 @@ export default {
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.sr-wrapper{
|
|
||||||
/deep/.el-dialog{
|
|
||||||
background: #fff !important;
|
|
||||||
border: 1px solid #ddd;
|
|
||||||
// color: #ddd;
|
|
||||||
.el-dialog__title{
|
|
||||||
color:#fff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/deep/.sr-dialog-container{
|
|
||||||
margin-top: 50px !important;
|
|
||||||
width:75%;
|
|
||||||
height:80%;
|
|
||||||
}
|
|
||||||
/deep/.el-dialog__body{
|
|
||||||
padding: 10px;
|
|
||||||
height: calc(100% - 50px);
|
|
||||||
}
|
|
||||||
.el-dialog__header{
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
.sr-full-dialog-container{
|
|
||||||
/deep/.is-fullscreen .el-dialog__body{
|
|
||||||
height: calc(100% - 50px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in New Issue