磁共振的图像在做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 { width, height } = allInfo.screen; //
// let discrete = allInfo.webgl.gpuType.discrete; // // let discrete = allInfo.webgl.gpuType.discrete; //
// let estimatedMemory = allInfo.webgl.memoryInfo.estimatedMemory; // // 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) { if (this.tip) {
this.tip += `<br/>` this.tip += `<br/>`
} }

View File

@ -2491,7 +2491,8 @@ export default {
let { width, height } = allInfo.screen; // let { width, height } = allInfo.screen; //
let discrete = allInfo.webgl.gpuType.discrete; // let discrete = allInfo.webgl.gpuType.discrete; //
let estimatedMemory = allInfo.webgl.memoryInfo.estimatedMemory; // 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')) let res = await this.$confirm(this.$t('browser:tip:ReadingConfiguration'))
resolve(res) resolve(res)
} else { } else {

View File

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

View File

@ -70,6 +70,7 @@ import {
metaData, metaData,
getRenderingEngine, getRenderingEngine,
utilities as csUtils, utilities as csUtils,
cache
} from '@cornerstonejs/core' } from '@cornerstonejs/core'
import * as cornerstoneTools from '@cornerstonejs/tools' import * as cornerstoneTools from '@cornerstonejs/tools'
import { createImageIdsAndCacheMetaData } from '@/views/trials/trials-panel/reading/dicoms/components/Fusion/js/createImageIdsAndCacheMetaData' import { createImageIdsAndCacheMetaData } from '@/views/trials/trials-panel/reading/dicoms/components/Fusion/js/createImageIdsAndCacheMetaData'
@ -91,6 +92,12 @@ export default {
type: Number, type: Number,
required: true required: true
}, },
MPRInfo: {
type: Object,
default: () => {
return {}
}
}
}, },
data() { data() {
return { return {
@ -142,6 +149,25 @@ export default {
this.initViewport() 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: { methods: {
initViewport() { initViewport() {
this.element = this.$refs['viewport-volume'] 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) { stackNewImage(e) {
const { detail } = e const { detail } = e
this.series.SliceIndex = detail.imageIndex this.series.SliceIndex = detail.imageIndex
@ -195,26 +273,16 @@ export default {
this.imageInfo.zoom = zoom.toFixed(4) this.imageInfo.zoom = zoom.toFixed(4)
let imageIds = viewport.getImageIds(this.volumeId) let imageIds = viewport.getImageIds(this.volumeId)
let imageId = imageIds[0] let imageId = imageIds[0]
let volume = cache.getVolume(this.volumeId)
let { spacing } = volume
// if (this.series.orientation === 'AXIAL') imageId = viewport.getCurrentImageId() // if (this.series.orientation === 'AXIAL') imageId = viewport.getCurrentImageId()
if (imageId) { if (imageId) {
this.$emit('setMPRInfo', { type: this.series.orientation, key: "imageNum", value: detail.numberOfSlices })
const imagePlaneModule = metaData.get('imagePlaneModule', imageId) const imagePlaneModule = metaData.get('imagePlaneModule', imageId)
if (this.series.orientation === 'AXIAL') { let type = this.determineImagePlane(imagePlaneModule.imageOrientationPatient)
this.imageInfo.size = `${imagePlaneModule.columns}*${imagePlaneModule.rows}` this.imageInfo.location = type === this.series.orientation ? imagePlaneModule.sliceLocation : ''
this.imageInfo.location = imagePlaneModule.sliceLocation this.imageInfo.sliceThickness = type === this.series.orientation ? spacing[2] : spacing[0]
this.imageInfo.total = imageIds.length this.imageInfo.total = detail.numberOfSlices
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
}
this.getOrientationMarker() this.getOrientationMarker()
let properties = viewport.getProperties(this.volumeId) let properties = viewport.getProperties(this.volumeId)
if (properties && properties.voiRange) { if (properties && properties.voiRange) {