重置标记更改;标记定位更改
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
84a81e1851
commit
6ecc0e58e9
|
|
@ -1221,12 +1221,7 @@ export default {
|
||||||
this.selectArr.push(item.VisitTaskId)
|
this.selectArr.push(item.VisitTaskId)
|
||||||
}
|
}
|
||||||
if (item.IsCurrentTask) {
|
if (item.IsCurrentTask) {
|
||||||
this.markedSeriesIds = []
|
this.syncMarkedSeriesIds(annotations)
|
||||||
annotations.map(i => {
|
|
||||||
if (i.MeasureData && i.MeasureData.seriesId) {
|
|
||||||
this.markedSeriesIds.push(i.MeasureData.seriesId)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2052,7 +2047,7 @@ export default {
|
||||||
|
|
||||||
// this.$refs['ecrf'].setAnnotation({ annotation, toolName: annotation.metadata.toolName })
|
// this.$refs['ecrf'].setAnnotation({ annotation, toolName: annotation.metadata.toolName })
|
||||||
this.$refs[`ecrf_${this.lastViewportTaskId}`][0].setAnnotation({ annotation, toolName: annotation.metadata.toolName })
|
this.$refs[`ecrf_${this.lastViewportTaskId}`][0].setAnnotation({ annotation, toolName: annotation.metadata.toolName })
|
||||||
this.markedSeriesIds.push(series.Id)
|
this.syncMarkedSeriesIdsFromState(series.TaskInfo.VisitTaskId)
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setToolsPassive()
|
this.setToolsPassive()
|
||||||
|
|
@ -2087,16 +2082,14 @@ export default {
|
||||||
throw errorMsg
|
throw errorMsg
|
||||||
}
|
}
|
||||||
if (annotation.visitTaskId === this.taskInfo.VisitTaskId && annotation.seriesId) {
|
if (annotation.visitTaskId === this.taskInfo.VisitTaskId && annotation.seriesId) {
|
||||||
const index = this.markedSeriesIds.indexOf(annotation.seriesId)
|
this.syncMarkedSeriesIdsFromState(annotation.visitTaskId)
|
||||||
if (index !== -1) {
|
|
||||||
this.markedSeriesIds.splice(index, 1)
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
const errorMsg = { message: 'annotation Not allowed to operate' }
|
const errorMsg = { message: 'annotation Not allowed to operate' }
|
||||||
throw errorMsg
|
throw errorMsg
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
cornerstoneTools.annotation.state.addAnnotation(annotation)
|
cornerstoneTools.annotation.state.addAnnotation(annotation)
|
||||||
|
this.syncMarkedSeriesIdsFromState(annotation.visitTaskId)
|
||||||
const renderingEngine = getRenderingEngine(renderingEngineId)
|
const renderingEngine = getRenderingEngine(renderingEngineId)
|
||||||
for (let i = 0; i < this.cells.length; i++) {
|
for (let i = 0; i < this.cells.length; i++) {
|
||||||
const viewportId = `${this.viewportKey}-${i}`
|
const viewportId = `${this.viewportKey}-${i}`
|
||||||
|
|
@ -2133,7 +2126,7 @@ export default {
|
||||||
annotation.sliceThickness = series.SliceThickness
|
annotation.sliceThickness = series.SliceThickness
|
||||||
annotation.numberOfFrames = isNaN(parseInt(params.frame)) ? null : parseInt(params.frame)
|
annotation.numberOfFrames = isNaN(parseInt(params.frame)) ? null : parseInt(params.frame)
|
||||||
annotation.markTool = annotation.metadata.toolName
|
annotation.markTool = annotation.metadata.toolName
|
||||||
this.markedSeriesIds.push(series.Id)
|
this.syncMarkedSeriesIdsFromState(series.TaskInfo.VisitTaskId)
|
||||||
const operateStateEnum = this.$refs[`ecrf_${this.taskInfo.VisitTaskId}`][0].operateStateEnum
|
const operateStateEnum = this.$refs[`ecrf_${this.taskInfo.VisitTaskId}`][0].operateStateEnum
|
||||||
const markName = await this.customPrompt(!this.isNumber(operateStateEnum))
|
const markName = await this.customPrompt(!this.isNumber(operateStateEnum))
|
||||||
|
|
||||||
|
|
@ -2275,10 +2268,7 @@ export default {
|
||||||
if (!res.IsSuccess) throw ''
|
if (!res.IsSuccess) throw ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const index = this.markedSeriesIds.indexOf(annotation.seriesId)
|
this.syncMarkedSeriesIdsFromState(annotation.visitTaskId)
|
||||||
if (index !== -1) {
|
|
||||||
this.markedSeriesIds.splice(index, 1)
|
|
||||||
}
|
|
||||||
const renderingEngine = getRenderingEngine(renderingEngineId)
|
const renderingEngine = getRenderingEngine(renderingEngineId)
|
||||||
for (let i = 0; i < this.cells.length; i++) {
|
for (let i = 0; i < this.cells.length; i++) {
|
||||||
const viewportId = `${this.viewportKey}-${i}`
|
const viewportId = `${this.viewportKey}-${i}`
|
||||||
|
|
@ -2291,6 +2281,7 @@ export default {
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
cornerstoneTools.annotation.state.addAnnotation(annotation)
|
cornerstoneTools.annotation.state.addAnnotation(annotation)
|
||||||
|
this.syncMarkedSeriesIdsFromState(annotation.visitTaskId)
|
||||||
const renderingEngine = getRenderingEngine(renderingEngineId)
|
const renderingEngine = getRenderingEngine(renderingEngineId)
|
||||||
for (let i = 0; i < this.cells.length; i++) {
|
for (let i = 0; i < this.cells.length; i++) {
|
||||||
const viewportId = `${this.viewportKey}-${i}`
|
const viewportId = `${this.viewportKey}-${i}`
|
||||||
|
|
@ -2367,6 +2358,22 @@ export default {
|
||||||
this.$set(this.visitTaskList[taskIdx], 'Annotations', annotations)
|
this.$set(this.visitTaskList[taskIdx], 'Annotations', annotations)
|
||||||
this.$set(this.visitTaskList[taskIdx], 'AnnotationUIDs', annotationUIDs)
|
this.$set(this.visitTaskList[taskIdx], 'AnnotationUIDs', annotationUIDs)
|
||||||
},
|
},
|
||||||
|
collectMarkedSeriesIds(list = []) {
|
||||||
|
return [...new Set(
|
||||||
|
list
|
||||||
|
.map(item => item?.MeasureData?.seriesId || item?.seriesId)
|
||||||
|
.filter(Boolean)
|
||||||
|
)]
|
||||||
|
},
|
||||||
|
syncMarkedSeriesIds(list = []) {
|
||||||
|
this.markedSeriesIds = this.collectMarkedSeriesIds(list)
|
||||||
|
},
|
||||||
|
syncMarkedSeriesIdsFromState(visitTaskId = this.taskInfo?.VisitTaskId) {
|
||||||
|
const annotations = cornerstoneTools.annotation.state.getAllAnnotations().filter(item => {
|
||||||
|
return item.visitTaskId === visitTaskId && item.seriesId
|
||||||
|
})
|
||||||
|
this.syncMarkedSeriesIds(annotations)
|
||||||
|
},
|
||||||
async resetAnnotations(visitTaskId) {
|
async resetAnnotations(visitTaskId) {
|
||||||
if (this.readingTaskState === 2) return
|
if (this.readingTaskState === 2) return
|
||||||
const taskIdx = this.visitTaskList.findIndex(i => i.VisitTaskId === visitTaskId)
|
const taskIdx = this.visitTaskList.findIndex(i => i.VisitTaskId === visitTaskId)
|
||||||
|
|
@ -2401,9 +2408,9 @@ export default {
|
||||||
if (i.MeasureData) {
|
if (i.MeasureData) {
|
||||||
const annotation = i.MeasureData
|
const annotation = i.MeasureData
|
||||||
cornerstoneTools.annotation.state.addAnnotation(annotation)
|
cornerstoneTools.annotation.state.addAnnotation(annotation)
|
||||||
this.markedSeriesIds.push(annotation.seriesId)
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
this.syncMarkedSeriesIds(annotations)
|
||||||
const renderingEngine = getRenderingEngine(renderingEngineId)
|
const renderingEngine = getRenderingEngine(renderingEngineId)
|
||||||
for (let i = 0; i < this.cells.length; i++) {
|
for (let i = 0; i < this.cells.length; i++) {
|
||||||
const viewportId = `${this.viewportKey}-${i}`
|
const viewportId = `${this.viewportKey}-${i}`
|
||||||
|
|
@ -4046,8 +4053,10 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.$refs[`${this.viewportKey}-${this.activeViewportIndex}`][0].setSeriesInfo(series, true)
|
if (!this.isActiveViewportAtMeasureLocation(obj.annotation)) {
|
||||||
this.$refs[series.TaskInfo.VisitTaskId][0].setSeriesActive(series.StudyIndex, series.SeriesIndex)
|
this.$refs[`${this.viewportKey}-${this.activeViewportIndex}`][0].setSeriesInfo(series, true)
|
||||||
|
this.$refs[series.TaskInfo.VisitTaskId][0].setSeriesActive(series.StudyIndex, series.SeriesIndex)
|
||||||
|
}
|
||||||
setTimeout(async () => {
|
setTimeout(async () => {
|
||||||
const divForDownloadViewport = document.querySelector(
|
const divForDownloadViewport = document.querySelector(
|
||||||
`div[data-viewport-uid="${this.viewportKey}-${this.activeViewportIndex}"]`
|
`div[data-viewport-uid="${this.viewportKey}-${this.activeViewportIndex}"]`
|
||||||
|
|
@ -4058,9 +4067,48 @@ export default {
|
||||||
}, 200)
|
}, 200)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
getMeasureImageLocation(measureData = {}) {
|
||||||
|
const referencedImageId = measureData?.metadata?.referencedImageId
|
||||||
|
const referencedImageParams = referencedImageId ? this.getInstanceInfo(referencedImageId) : {}
|
||||||
|
return {
|
||||||
|
visitTaskId: measureData.visitTaskId,
|
||||||
|
studyId: measureData.studyId || measureData.StudyId,
|
||||||
|
seriesId: measureData.seriesId || measureData.SeriesId,
|
||||||
|
instanceId: measureData.instanceId || measureData.InstanceId || referencedImageParams.instanceId || null,
|
||||||
|
frame: measureData.numberOfFrames ?? measureData.NumberOfFrames ?? referencedImageParams.frame
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getActiveViewportImageLocation() {
|
||||||
|
const viewportRef = this.$refs[`${this.viewportKey}-${this.activeViewportIndex}`]?.[0]
|
||||||
|
const currentSeries = viewportRef?.series
|
||||||
|
if (!currentSeries) return null
|
||||||
|
const renderingEngine = getRenderingEngine(renderingEngineId)
|
||||||
|
const viewport = renderingEngine?.getViewport(`${this.viewportKey}-${this.activeViewportIndex}`)
|
||||||
|
const currentImageId = viewport?.getCurrentImageId?.()
|
||||||
|
const currentImageParams = currentImageId ? this.getInstanceInfo(currentImageId) : {}
|
||||||
|
return {
|
||||||
|
visitTaskId: currentSeries.TaskInfo?.VisitTaskId,
|
||||||
|
studyId: currentSeries.StudyId,
|
||||||
|
seriesId: currentSeries.Id,
|
||||||
|
instanceId: currentImageParams.instanceId || null,
|
||||||
|
frame: currentImageParams.frame
|
||||||
|
}
|
||||||
|
},
|
||||||
|
isActiveViewportAtMeasureLocation(measureData) {
|
||||||
|
const targetLocation = this.getMeasureImageLocation(measureData)
|
||||||
|
const currentLocation = this.getActiveViewportImageLocation()
|
||||||
|
if (!currentLocation || !targetLocation.seriesId) return false
|
||||||
|
if (targetLocation.visitTaskId && currentLocation.visitTaskId !== targetLocation.visitTaskId) return false
|
||||||
|
if (targetLocation.studyId && currentLocation.studyId !== targetLocation.studyId) return false
|
||||||
|
if (currentLocation.seriesId !== targetLocation.seriesId) return false
|
||||||
|
if (targetLocation.instanceId && currentLocation.instanceId !== targetLocation.instanceId) return false
|
||||||
|
return currentLocation.frame === targetLocation.frame
|
||||||
|
},
|
||||||
async getScreenshots(measureData, callback) {
|
async getScreenshots(measureData, callback) {
|
||||||
if (measureData) {
|
if (measureData) {
|
||||||
await this.imageLocation(measureData)
|
if (!this.isActiveViewportAtMeasureLocation(measureData.annotation)) {
|
||||||
|
await this.imageLocation(measureData)
|
||||||
|
}
|
||||||
const divForDownloadViewport = document.querySelector(
|
const divForDownloadViewport = document.querySelector(
|
||||||
`div[data-viewport-uid="${this.viewportKey}-${this.activeViewportIndex}"]`
|
`div[data-viewport-uid="${this.viewportKey}-${this.activeViewportIndex}"]`
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -251,7 +251,7 @@ export default {
|
||||||
return i
|
return i
|
||||||
})
|
})
|
||||||
this.$set(this.visitTaskList[taskIdx], 'Annotations', annotations)
|
this.$set(this.visitTaskList[taskIdx], 'Annotations', annotations)
|
||||||
this.$refs[visitTaskId][0].initCurrentMaredFiles()
|
this.$refs[visitTaskId][0].initCurrentMaredFiles(annotations)
|
||||||
this.$refs.fileViewer.resetAnnotations({ annotations, visitTaskId })
|
this.$refs.fileViewer.resetAnnotations({ annotations, visitTaskId })
|
||||||
},
|
},
|
||||||
setReadingTaskState(state) {
|
setReadingTaskState(state) {
|
||||||
|
|
|
||||||
|
|
@ -97,6 +97,7 @@ export default {
|
||||||
this.taskInfo = JSON.parse(localStorage.getItem('taskInfo'))
|
this.taskInfo = JSON.parse(localStorage.getItem('taskInfo'))
|
||||||
this.BodyPart.Bodypart = await this.$getBodyPart(this.$route.query.trialId)
|
this.BodyPart.Bodypart = await this.$getBodyPart(this.$route.query.trialId)
|
||||||
this.studyList = this.decorateStudyList(this.visitTaskInfo.StudyList || [])
|
this.studyList = this.decorateStudyList(this.visitTaskInfo.StudyList || [])
|
||||||
|
this.initCurrentMaredFiles(this.visitTaskInfo.Annotations)
|
||||||
if (this.studyList.length === 0) return
|
if (this.studyList.length === 0) return
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.activeStudy(this.studyList[0].Id)
|
this.activeStudy(this.studyList[0].Id)
|
||||||
|
|
@ -110,8 +111,26 @@ export default {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
'visitTaskInfo.Annotations': {
|
||||||
|
handler(annotations) {
|
||||||
|
this.initCurrentMaredFiles(annotations)
|
||||||
|
},
|
||||||
|
deep: true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
buildCurrentMarkedFiles(annotations = []) {
|
||||||
|
return annotations.reduce((result, item) => {
|
||||||
|
const fileId = item?.NoneDicomFileId
|
||||||
|
if (!fileId) return result
|
||||||
|
if (!Object.hasOwn(result, fileId)) {
|
||||||
|
result[fileId] = { count: 1 }
|
||||||
|
} else {
|
||||||
|
result[fileId].count++
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
}, {})
|
||||||
|
},
|
||||||
decorateStudyList(studyList = []) {
|
decorateStudyList(studyList = []) {
|
||||||
return studyList.map(study => ({
|
return studyList.map(study => ({
|
||||||
...study,
|
...study,
|
||||||
|
|
@ -204,6 +223,9 @@ export default {
|
||||||
if (type === 'remove') {
|
if (type === 'remove') {
|
||||||
if (Object.hasOwn(this.currentMarkedFiles, fileId)) {
|
if (Object.hasOwn(this.currentMarkedFiles, fileId)) {
|
||||||
this.currentMarkedFiles[fileId].count--
|
this.currentMarkedFiles[fileId].count--
|
||||||
|
if (this.currentMarkedFiles[fileId].count <= 0) {
|
||||||
|
this.$delete(this.currentMarkedFiles, fileId)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (type === 'add') {
|
} else if (type === 'add') {
|
||||||
if (!Object.hasOwn(this.currentMarkedFiles, fileId)) {
|
if (!Object.hasOwn(this.currentMarkedFiles, fileId)) {
|
||||||
|
|
@ -214,15 +236,8 @@ export default {
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
initCurrentMaredFiles() {
|
initCurrentMaredFiles(annotations = this.visitTaskInfo.Annotations || []) {
|
||||||
this.currentMarkedFiles = {}
|
this.currentMarkedFiles = this.buildCurrentMarkedFiles(annotations)
|
||||||
this.visitTaskInfo.Annotations.map(i => {
|
|
||||||
if (!Object.hasOwn(this.currentMarkedFiles, i.NoneDicomFileId)) {
|
|
||||||
this.$set(this.currentMarkedFiles, i.NoneDicomFileId, { count: 1 })
|
|
||||||
} else {
|
|
||||||
this.currentMarkedFiles[i.NoneDicomFileId].count++
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue