磁共振的图像在做MPR时,重建的体数据,在各个轴向上的图像数量不正确
continuous-integration/drone/push Build is running Details

main
wangxiaoshuang 2025-12-31 15:50:01 +08:00
parent b4db6b4990
commit fdc23361f9
4 changed files with 108 additions and 22 deletions

View File

@ -68,7 +68,8 @@ export default {
let { width, height } = allInfo.screen; //
// let discrete = allInfo.webgl.gpuType.discrete; //
// let estimatedMemory = allInfo.webgl.memoryInfo.estimatedMemory; //
if (parseFloat(deviceMemory) < 16 || width < 1920 || height < 1080) {
// parseFloat(deviceMemory) < 16 ||
if (width < 1920 || height < 1080) {
if (this.tip) {
this.tip += `<br/>`
}

View File

@ -2491,7 +2491,8 @@ export default {
let { width, height } = allInfo.screen; //
let discrete = allInfo.webgl.gpuType.discrete; //
let estimatedMemory = allInfo.webgl.memoryInfo.estimatedMemory; //
if (parseFloat(deviceMemory) < 16 || width < 1920 || height < 1080 || !discrete || parseFloat(estimatedMemory) < 2) {
// parseFloat(deviceMemory) < 16 ||
if (width < 1920 || height < 1080 || !discrete || parseFloat(estimatedMemory) < 2) {
let res = await this.$confirm(this.$t('browser:tip:ReadingConfiguration'))
resolve(res)
} else {

View File

@ -317,7 +317,7 @@
@dblclick="toggleFullScreen($event, index)" @click="activeViewport(index)">
<VolumeViewport :ref="`viewport-volume-${index}`" :data-viewport-uid="`viewport-volume-${index}`"
:rendering-engine-id="renderingEngineId" :viewport-id="`viewport-volume-${index}`"
:viewport-index="index" @activeViewport="activeViewport"
:viewport-index="index" :MPRInfo="MPRInfo" @activeViewport="activeViewport" @setMPRInfo="setMPRInfo"
@toggleTaskByViewport="toggleTaskByViewport" @previewCD="previewCD"
@renderAnnotations="renderAnnotations" @contentMouseup="contentMouseup" />
</div>
@ -673,7 +673,18 @@ export default {
ManualsClose: false,
isMPR: false,
volumeToolGroupId: "share-viewport-volume"
volumeToolGroupId: "share-viewport-volume",
MPRInfo: {
AXIAL: {
imageNum: 0
},
CORONAL: {
imageNum: 0
},
SAGITTAL: {
imageNum: 0
},
}
}
},
computed: {
@ -801,6 +812,10 @@ export default {
document.addEventListener("click", this.foo);
},
methods: {
setMPRInfo(obj) {
let { type, key, value } = obj
this.$set(this.MPRInfo[type], key, value)
},
handleReadingChart(row) {
let { e, data } = row
let obj = Object.assign({}, data)
@ -3478,7 +3493,8 @@ export default {
let { width, height } = allInfo.screen; //
let discrete = allInfo.webgl.gpuType.discrete; //
let estimatedMemory = allInfo.webgl.memoryInfo.estimatedMemory; //
if (parseFloat(deviceMemory) < 16 || width < 1920 || height < 1080 || !discrete || parseFloat(estimatedMemory) < 2) {
// parseFloat(deviceMemory) < 16 ||
if (width < 1920 || height < 1080 || !discrete || parseFloat(estimatedMemory) < 2) {
let res = await this.$confirm(this.$t('browser:tip:ReadingConfiguration'), this.$t('system:menu:confirm:title:warning'), {
type: 'warning'
})

View File

@ -70,6 +70,7 @@ import {
metaData,
getRenderingEngine,
utilities as csUtils,
cache
} from '@cornerstonejs/core'
import * as cornerstoneTools from '@cornerstonejs/tools'
import { createImageIdsAndCacheMetaData } from '@/views/trials/trials-panel/reading/dicoms/components/Fusion/js/createImageIdsAndCacheMetaData'
@ -91,6 +92,12 @@ export default {
type: Number,
required: true
},
MPRInfo: {
type: Object,
default: () => {
return {}
}
}
},
data() {
return {
@ -142,6 +149,25 @@ export default {
this.initViewport()
})
},
watch: {
MPRInfo: {
handler() {
if (!this.series.orientation) return false
switch (this.series.orientation) {
case 'AXIAL':
this.imageInfo.size = `${this.MPRInfo.SAGITTAL.imageNum}*${this.MPRInfo.CORONAL.imageNum}`
break;
case 'CORONAL':
this.imageInfo.size = `${this.MPRInfo.SAGITTAL.imageNum}*${this.MPRInfo.AXIAL.imageNum}`
break;
case 'SAGITTAL':
this.imageInfo.size = `${this.MPRInfo.CORONAL.imageNum}*${this.MPRInfo.AXIAL.imageNum}`
break;
}
},
deep: true
}
},
methods: {
initViewport() {
this.element = this.$refs['viewport-volume']
@ -185,6 +211,58 @@ export default {
})
},
determineImagePlane(imageOrientationPatient) {
// imageOrientationPatient [rowX, rowY, rowZ, colX, colY, colZ]
// (rowX, rowY, rowZ)
const [rowX, rowY, rowZ] = imageOrientationPatient;
// X, Y, Z
const dotX = Math.abs(rowX);
const dotY = Math.abs(rowY);
const dotZ = Math.abs(rowZ);
//
const maxDot = Math.max(dotX, dotY, dotZ);
//
if (maxDot === dotX) {
// X 线 Y Z
// 线
//
// X-Y (rowZ ) Axial
// X-Z (rowY ) Sagittal
// 线线
// 线 = ×
const [colX, colY, colZ] = imageOrientationPatient.slice(3);
const normalX = rowY * colZ - rowZ * colY;
const normalY = rowZ * colX - rowX * colZ;
const normalZ = rowX * colY - rowY * colX;
const absNormalX = Math.abs(normalX);
const absNormalY = Math.abs(normalY);
const absNormalZ = Math.abs(normalZ);
const maxNormal = Math.max(absNormalX, absNormalY, absNormalZ);
if (maxNormal === absNormalZ) {
return 'AXIAL';
} else if (maxNormal === absNormalY) {
return 'SAGITTAL';
} else if (maxNormal === absNormalX) {
return 'CORONAL';
}
} else if (maxDot === dotY) {
// Y Coronal
return 'SAGITTAL';
} else if (maxDot === dotZ) {
// Z Sagittal
return 'CORONAL';
}
return 'unknown';
},
stackNewImage(e) {
const { detail } = e
this.series.SliceIndex = detail.imageIndex
@ -195,26 +273,16 @@ export default {
this.imageInfo.zoom = zoom.toFixed(4)
let imageIds = viewport.getImageIds(this.volumeId)
let imageId = imageIds[0]
let volume = cache.getVolume(this.volumeId)
let { spacing } = volume
// if (this.series.orientation === 'AXIAL') imageId = viewport.getCurrentImageId()
if (imageId) {
this.$emit('setMPRInfo', { type: this.series.orientation, key: "imageNum", value: detail.numberOfSlices })
const imagePlaneModule = metaData.get('imagePlaneModule', imageId)
if (this.series.orientation === 'AXIAL') {
this.imageInfo.size = `${imagePlaneModule.columns}*${imagePlaneModule.rows}`
this.imageInfo.location = imagePlaneModule.sliceLocation
this.imageInfo.total = imageIds.length
this.imageInfo.sliceThickness = imagePlaneModule.sliceThickness
}
if (this.series.orientation === 'CORONAL') {
this.imageInfo.size = `${imagePlaneModule.columns}*${imageIds.length}`
this.imageInfo.total = imagePlaneModule.rows
this.imageInfo.sliceThickness = imagePlaneModule.rowPixelSpacing
}
if (this.series.orientation === 'SAGITTAL') {
this.imageInfo.size = `${imagePlaneModule.rows}*${imageIds.length}`
this.imageInfo.total = imagePlaneModule.columns
this.imageInfo.sliceThickness = imagePlaneModule.columnPixelSpacing
}
let type = this.determineImagePlane(imagePlaneModule.imageOrientationPatient)
this.imageInfo.location = type === this.series.orientation ? imagePlaneModule.sliceLocation : ''
this.imageInfo.sliceThickness = type === this.series.orientation ? spacing[2] : spacing[0]
this.imageInfo.total = detail.numberOfSlices
this.getOrientationMarker()
let properties = viewport.getProperties(this.volumeId)
if (properties && properties.voiRange) {