diff --git a/src/views/trials/trials-panel/reading/dicoms3D/components/PetCtReadPage.vue b/src/views/trials/trials-panel/reading/dicoms3D/components/PetCtReadPage.vue deleted file mode 100644 index a18d0258..00000000 --- a/src/views/trials/trials-panel/reading/dicoms3D/components/PetCtReadPage.vue +++ /dev/null @@ -1,3344 +0,0 @@ - - - - - - - {{ - s.TaskBlindName }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - A - - - - - A - - - A - - - - - A - - - B - - - - - - - - A - - - A - - - - - A - - - A - - - - - - - - - - - - - - - - - - - - {{ item.label }} - {{ `${item.ww} / ${item.wc}` }} - - - {{ item.label }} - - - - {{ ` ${$t('trials:reading:title:preset')}` }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ rotate.label }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - 10 - 15 - 20 - 25 - 30 - - - - - - - - - - - - - - - - - - {{ $t(i.i18nKey) }} - - - - - - - - - - - - - - - - - - {{ $t('trials:lugano:button:colormap') }} - - - - - {{ colorMap - }} - - - - - - - - - - g/ml - - - - - 0 - - - - - - - - - {{ $t('trials:reading:button:handbooks') }} - - - - {{ $t('trials:reading:button:clinicalData') }} - - - - {{ $t('trials:reading:button:customCfg') }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ $t('trials:reading:button:handbooks') }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ - $t('trials:lugano:fusionDialog:label:fusionImages') }} - - - - - {{ $t('trials:lugano:fusionDialog:label:ctSeries') }} - - - - - - - - - - - #{{ scope.row.SeriesNumber }} - {{ scope.row.Modality }}: {{ scope.row.InstanceCount }} images T: {{ - parseFloat(scope.row.SliceThickness).toFixed(digitPlaces) }} - {{ scope.row.Description }} - - - - - - - - - {{ $t('trials:lugano:fusionDialog:label:ptSeries') }} - - - - - - - - - - #{{ scope.row.SeriesNumber }} - {{ scope.row.Modality }}: {{ scope.row.InstanceCount }} images T: {{ - parseFloat(scope.row.SliceThickness).toFixed(digitPlaces) }} - {{ scope.row.Description }} - - - - - - - - {{ $t('common:button:cancel') - }} - - - {{ $t('common:button:confirm') }} - - - - - - - \ No newline at end of file diff --git a/src/views/trials/trials-panel/reading/dicoms3D/components/PetCtViewport.vue b/src/views/trials/trials-panel/reading/dicoms3D/components/PetCtViewport.vue index 0bf7ef5f..f7cf3e3c 100644 --- a/src/views/trials/trials-panel/reading/dicoms3D/components/PetCtViewport.vue +++ b/src/views/trials/trials-panel/reading/dicoms3D/components/PetCtViewport.vue @@ -205,7 +205,7 @@ export default { } }) this.element.oncontextmenu = (e) => e.preventDefault() - resizeObserver.observe(this.element) + // resizeObserver.observe(this.element) this.element.addEventListener("CORNERSTONE_VOLUME_NEW_IMAGE", this.stackNewImage) this.element.addEventListener('CORNERSTONE_VOI_MODIFIED', this.voiModified) @@ -245,7 +245,10 @@ export default { this.imageInfo.location = imagePlaneModule.sliceLocation this.getOrientationMarker() // this.$emit('renderAnnotations', this.series) - var properties = viewport.getProperties() + let properties = viewport.getProperties() + if (this.isFusion) { + properties = viewport.getProperties(this.ptVolumeId) + } if (properties && properties.voiRange) { var { lower, upper } = properties.voiRange @@ -264,7 +267,10 @@ export default { voiModified(e) { const renderingEngine = getRenderingEngine(this.renderingEngineId) const viewport = renderingEngine.getViewport(this.viewportId) - const properties = viewport.getProperties() + let properties = viewport.getProperties() + if (this.isFusion) { + properties = viewport.getProperties(this.volumeId) + } if (properties && properties.voiRange) { var { lower, upper } = properties.voiRange const { windowWidth, windowCenter } = csUtils.windowLevel.toWindowLevel( @@ -387,29 +393,18 @@ export default { const voiRange = { lower: 0, upper: v } const viewport = renderingEngine.getViewport(this.viewportId) if (!viewport) return + let volumeId = this.isFusion ? this.ptVolumeId : this.volumeId const viewportsContainingVolumeUID = csUtils.getViewportsWithVolumeId( - this.volumeId, + volumeId, viewport.renderingEngineId ) - viewport.setProperties({ voiRange }, this.volumeId) + viewport.setProperties({ voiRange }, volumeId) viewportsContainingVolumeUID.forEach((vp) => { vp.render() // this.$refs[vp.id].voiModified() this.voiModified() }) - if (this.ptVolumeId) { - const viewportsContainingVolumeUIDPT = csUtils.getViewportsWithVolumeId( - this.ptVolumeId, - viewport.renderingEngineId - ) - - viewport.setProperties({ voiRange }, this.ptVolumeId) - viewportsContainingVolumeUIDPT.forEach((vp) => { - vp.render() - this.voiModified() - }) - } }, renderColorBar(presetName) { var colorMap = null diff --git a/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue b/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue index 1747f289..2dffb5e7 100644 --- a/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue +++ b/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue @@ -582,9 +582,10 @@ const { EraserTool, MIPJumpToClickTool, VolumeRotateTool, + synchronizers // cursors } = cornerstoneTools - +const { createCameraPositionSynchronizer, createVOISynchronizer } = synchronizers; const newStyles = { global: { color: 'rgb(255, 0, 0)', @@ -702,6 +703,7 @@ export default { isFusion: false, studyList: [], volumeData: {}, + fusionSerieId: {}, loadingText: null } }, @@ -1221,6 +1223,9 @@ export default { eventTarget.addEventListener('cornerstoneimageloadprogress', this.imageLoadProgress) console.log(Events, toolsEvents) + if ( this.readingTool === 2 ) { + this.setUpSynchronizers() + } }, // 影像下载进度回调 imageLoadProgress(e) { @@ -2625,6 +2630,67 @@ export default { }, delay) } }, + // 融合视口相机同步 + setUpSynchronizers() { + let axialCameraPositionSynchronizer = createCameraPositionSynchronizer( + 'AXIAL_CAMERA_SYNCHRONIZER_ID' + ); + let ctVoiSynchronizer = createVOISynchronizer('CT_VOI_SYNCHRONIZER_ID', { + syncInvertState: false, + syncColormap: false, + }); + let ptVoiSynchronizer = createVOISynchronizer('PT_VOI_SYNCHRONIZER_ID', { + syncInvertState: false, + syncColormap: false, + }); + let fusionVoiSynchronizer = createVOISynchronizer('FUSION_VOI_SYNCHRONIZER_ID', { + syncInvertState: false, + syncColormap: false, + }); + [ + `viewport-fusion-0`, + `viewport-fusion-1`, + `viewport-fusion-2`, + ].forEach((viewportId) => { + axialCameraPositionSynchronizer.add({ + renderingEngineId: this.renderingEngineId, + viewportId, + }); + }); + [ + `viewport-fusion-0`, + ].forEach((viewportId) => { + ctVoiSynchronizer.add({ + renderingEngineId: this.renderingEngineId, + viewportId, + }); + }); + [ + `viewport-fusion-3`, + `viewport-fusion-1`, + ].forEach((viewportId) => { + ptVoiSynchronizer.add({ + renderingEngineId: this.renderingEngineId, + viewportId, + }); + }); + [ + `viewport-fusion-2`, + ].forEach((viewportId) => { + fusionVoiSynchronizer.add({ + renderingEngineId, + viewportId, + }); + ctVoiSynchronizer.addTarget({ + renderingEngineId, + viewportId, + }); + ptVoiSynchronizer.addTarget({ + renderingEngineId, + viewportId, + }); + }); + }, setColorMap(rgbPresetName) { let fusionViewportIds = [`viewport-fusion-1`, `viewport-fusion-2`, `viewport-fusion-3`] fusionViewportIds.forEach(id => { @@ -2648,6 +2714,21 @@ export default { let { ct, pt } = data this.loading = true this.loadingText = this.$t('trials:lugano:message:loadVolumes') + if ( this.verifyFusionData(ct, pt) ) { + this.loading = false + this.loadingText = null + this.$refs[`viewport-0`][0].setSeriesInfo(ct) + this.$refs[`viewport-1`][0].setSeriesInfo(pt) + this.$refs[`viewport-2`][0].setSeriesInfo(pt) + this.$refs[`viewport-3`][0].setSeriesInfo(pt) + return true + } + if (!this.fusionSerieId.ct || this.fusionSerieId.ct !== ct.SeriesInstanceUid ) { + this.fusionSerieId.ct = ct.SeriesInstanceUid + } + if (!this.fusionSerieId.pt || this.fusionSerieId.pt !== pt.SeriesInstanceUid ) { + this.fusionSerieId.pt = pt.SeriesInstanceUid + } await this.getVolume(ct) await this.getVolume(pt) await this.getVolume(pt, true) @@ -2655,20 +2736,20 @@ export default { this.loadingText = null let ctData = { data: ct, - volumeId: this.volumeData[ct.Id].volumeId, + volumeId: this.volumeData[ct.SeriesInstanceUid].volumeId, } let ptData = { data: pt, - volumeId: this.volumeData[pt.Id].volumeId, - volume: this.volumeData[pt.Id].volume, + volumeId: this.volumeData[pt.SeriesInstanceUid].volumeId, + volume: this.volumeData[pt.SeriesInstanceUid].volume, } let fusionData = { ct, data: pt, - volumeId: this.volumeData[pt.Id].volumeId, - ctVolumeId: this.volumeData[ct.Id].volumeId, - ptVolumeId: this.volumeData[pt.Id].volumeId, - fusionVolumeId: this.volumeData[`fusion_${pt.Id}`].volumeId, + volumeId: this.volumeData[pt.SeriesInstanceUid].volumeId, + ctVolumeId: this.volumeData[ct.SeriesInstanceUid].volumeId, + ptVolumeId: this.volumeData[pt.SeriesInstanceUid].volumeId, + fusionVolumeId: this.volumeData[`fusion_${pt.SeriesInstanceUid}`].volumeId, } this.$refs[`viewport-0`][0].setSeriesInfo(ct) this.$refs[`viewport-1`][0].setSeriesInfo(pt) @@ -2688,9 +2769,15 @@ export default { this.loadingText = null } }, + verifyFusionData(ct, pt) { + if (this.fusionSerieId.ct === ct.SeriesInstanceUid && this.fusionSerieId.pt === pt.SeriesInstanceUid && cache.getVolume(this.volumeData[ct.SeriesInstanceUid].volumeId) && cache.getVolume(this.volumeData[pt.SeriesInstanceUid].volumeId) && cache.getVolume(this.volumeData[`fusion_${pt.SeriesInstanceUid}`].volumeId) ) { + return true + } + return false + }, async getVolume(serie, isFusion = false ) { let volumeId = null, volume = null - let key = isFusion ? `fusion_${serie.Id}` : serie.Id + let key = isFusion ? `fusion_${serie.SeriesInstanceUid}` : serie.SeriesInstanceUid if(!this.volumeData[key] || !cache.getVolume(this.volumeData[key].volumeId)) { await this.$refs[`viewport-fusion-0`][0].createImageIdsAndCacheMetaData(serie) volumeId = `${isFusion ? 'fusion' : serie.Modality}Volume` + ':' + csUtils.uuidv4() diff --git a/src/views/trials/trials-panel/reading/dicoms3D/components/VisitReview.vue b/src/views/trials/trials-panel/reading/dicoms3D/components/VisitReview.vue index e2e22161..a482febf 100644 --- a/src/views/trials/trials-panel/reading/dicoms3D/components/VisitReview.vue +++ b/src/views/trials/trials-panel/reading/dicoms3D/components/VisitReview.vue @@ -25,7 +25,6 @@