三维调窗、分割保存
parent
c3e967acaa
commit
2724e0267f
|
|
@ -40,10 +40,10 @@
|
|||
<div v-if="series" class="right-bottom-text">
|
||||
<div v-show="imageInfo.location">Location: {{
|
||||
`${Number(imageInfo.location).toFixed(digitPlaces)} mm`
|
||||
}}</div>
|
||||
}}</div>
|
||||
<div v-show="imageInfo.sliceThickness">Slice Thickness: {{
|
||||
`${Number(imageInfo.sliceThickness).toFixed(digitPlaces)} mm`
|
||||
}}</div>
|
||||
}}</div>
|
||||
<div v-show="imageInfo.wwwc">WW/WL: {{ imageInfo.wwwc }}</div>
|
||||
</div>
|
||||
<div class="orientation-top">
|
||||
|
|
@ -493,7 +493,10 @@ export default {
|
|||
console.log("渲染成功")
|
||||
DicomEvent.$emit("isloaded", {})
|
||||
}
|
||||
}]).then(res => {
|
||||
}]).then(r => {
|
||||
let volume = cache.getVolume(this.volumeId)
|
||||
const voi = metaData.get('voiLutModule', volume._imageIds[Math.ceil((volume._imageIds.length - 1) / 2)])
|
||||
this.$emit('setWwwc', { ww: voi.windowWidth[0], wc: voi.windowCenter[0], id: this.viewportId })
|
||||
if (data.isLocation) {
|
||||
setTimeout(() => { csUtils.jumpToSlice(viewport.element, { imageIndex: data.SliceIndex }); })
|
||||
}
|
||||
|
|
@ -509,13 +512,51 @@ export default {
|
|||
const worldPoint = currentPoints.world
|
||||
const renderingEngine = getRenderingEngine(this.renderingEngineId)
|
||||
const viewport = renderingEngine.getViewport(this.viewportId)
|
||||
const imageData = viewport.getImageData()
|
||||
if (!imageData) return
|
||||
const index = imageData.imageData.worldToIndex(worldPoint)
|
||||
let referencedImageId = viewport.getCurrentImageId()
|
||||
const data = viewport.getImageData()
|
||||
if (!data) return
|
||||
const { dimensions, imageData, metadata, voxelManager } = data
|
||||
const index = imageData.worldToIndex(worldPoint)
|
||||
index[0] = Math.floor(index[0])
|
||||
index[1] = Math.floor(index[1])
|
||||
index[2] = Math.floor(index[2])
|
||||
this.mousePosition.index = index
|
||||
const modality = metadata.Modality
|
||||
let ijk = csUtils.transformWorldToIndex(imageData, worldPoint)
|
||||
ijk = vec3.round(ijk, ijk);
|
||||
if (csUtils.indexWithinDimensions(ijk, dimensions)) {
|
||||
this.isHandleOutsideImage = false
|
||||
let value = voxelManager.getAtIJKPoint(ijk)
|
||||
ijk[2] = viewport.getCurrentImageIdIndex()
|
||||
let modalityUnit
|
||||
if (modality === 'US') {
|
||||
const calibratedResults = cornerstoneTools.utilities.getCalibratedProbeUnitsAndValue(image, [ijk])
|
||||
const hasEnhancedRegionValues = calibratedResults.values.every(
|
||||
(value) => value !== null
|
||||
)
|
||||
value = (hasEnhancedRegionValues ? calibratedResults.values : value)
|
||||
modalityUnit = hasEnhancedRegionValues
|
||||
? calibratedResults.units
|
||||
: 'raw';
|
||||
} else {
|
||||
const scalingModule = referencedImageId && metaData.get('scalingModule', referencedImageId)
|
||||
const isSuvScaled = typeof scalingModule?.suvbw === 'number'
|
||||
if (scalingModule && scalingModule.suvbw) {
|
||||
const pixelUnitsOptions = {
|
||||
isPreScaled: cornerstoneTools.utilities.viewport.isViewportPreScaled(viewport, referencedImageId),
|
||||
isSuvScaled: isSuvScaled,
|
||||
}
|
||||
modalityUnit = cornerstoneTools.utilities.getPixelValueUnits(
|
||||
modality,
|
||||
referencedImageId,
|
||||
pixelUnitsOptions
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
this.mousePosition.value = value
|
||||
this.mousePosition.modalityUnit = modalityUnit
|
||||
}
|
||||
},
|
||||
toggleTask(evt, visitTaskNum, i) {
|
||||
this.$emit('activeViewport', this.viewportIndex)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
<template>
|
||||
<div ref="viewport-fusion" class="viewport-wrapper" v-loading="loading" :element-loading-text="NSTip"
|
||||
element-loading-background="rgba(0, 0, 0, 0.8)" @mouseup="sliderMouseup" @mousemove="sliderMousemove"
|
||||
@mouseleave="sliderMouseleave" :style="{ color: series.Modality === 'PT' || series.Modality === 'NM' || isMip ? '#666' : '#ddd' }">
|
||||
@mouseleave="sliderMouseleave"
|
||||
:style="{ color: series.Modality === 'PT' || series.Modality === 'NM' || isMip ? '#666' : '#ddd' }">
|
||||
<div v-if="isFusion" class="opacity-slider-wrapper" @mousedown.stop @mousemove.stop @mouseup.stop @wheel.stop>
|
||||
<div class="slider-title">{{ Math.round(fusionOpacity * 100) }}%</div>
|
||||
<input type="range" min="0" max="1" step="0.05" v-model.number="fusionOpacity" @input="applyFusionOpacity"
|
||||
|
|
@ -681,13 +682,48 @@ export default {
|
|||
const worldPoint = currentPoints.world
|
||||
const renderingEngine = getRenderingEngine(this.renderingEngineId)
|
||||
const viewport = renderingEngine.getViewport(this.viewportId)
|
||||
const imageData = viewport.getImageData()
|
||||
if (!imageData) return
|
||||
const index = imageData.imageData.worldToIndex(worldPoint)
|
||||
let referencedImageId = viewport.getCurrentImageId()
|
||||
const data = viewport.getImageData()
|
||||
if (!data) return
|
||||
const { dimensions, imageData, metadata, voxelManager } = data
|
||||
const index = imageData.worldToIndex(worldPoint)
|
||||
index[0] = Math.floor(index[0])
|
||||
index[1] = Math.floor(index[1])
|
||||
index[2] = Math.floor(index[2])
|
||||
this.mousePosition.index = index
|
||||
const modality = metadata.Modality
|
||||
let ijk = csUtils.transformWorldToIndex(imageData, worldPoint)
|
||||
ijk = vec3.round(ijk, ijk);
|
||||
if (csUtils.indexWithinDimensions(ijk, dimensions)) {
|
||||
this.isHandleOutsideImage = false
|
||||
let value = voxelManager.getAtIJKPoint(ijk)
|
||||
ijk[2] = viewport.getCurrentImageIdIndex()
|
||||
let modalityUnit
|
||||
if (modality === 'US') {
|
||||
const calibratedResults = cornerstoneTools.utilities.getCalibratedProbeUnitsAndValue(image, [ijk])
|
||||
const hasEnhancedRegionValues = calibratedResults.values.every(
|
||||
(value) => value !== null
|
||||
)
|
||||
value = (hasEnhancedRegionValues ? calibratedResults.values : value)
|
||||
modalityUnit = hasEnhancedRegionValues
|
||||
? calibratedResults.units
|
||||
: 'raw';
|
||||
} else {
|
||||
const scalingModule = referencedImageId && metaData.get('scalingModule', referencedImageId)
|
||||
const isSuvScaled = typeof scalingModule?.suvbw === 'number'
|
||||
const pixelUnitsOptions = {
|
||||
isPreScaled: cornerstoneTools.utilities.viewport.isViewportPreScaled(viewport, referencedImageId),
|
||||
isSuvScaled: isSuvScaled,
|
||||
}
|
||||
modalityUnit = cornerstoneTools.utilities.getPixelValueUnits(
|
||||
modality,
|
||||
referencedImageId,
|
||||
pixelUnitsOptions
|
||||
);
|
||||
}
|
||||
this.mousePosition.value = value
|
||||
this.mousePosition.modalityUnit = modalityUnit
|
||||
}
|
||||
},
|
||||
toggleTask(evt, visitTaskNum, i) {
|
||||
this.$emit('activeViewport', this.viewportIndex)
|
||||
|
|
|
|||
|
|
@ -309,7 +309,8 @@
|
|||
<VolumeViewport :ref="`viewport-${index}`" :data-viewport-uid="`viewport-${index}`"
|
||||
:rendering-engine-id="renderingEngineId" :viewport-id="`viewport-${index}`" :viewport-index="index"
|
||||
@activeViewport="activeViewport" @toggleTaskByViewport="toggleTaskByViewport" @previewCD="previewCD"
|
||||
@renderAnnotations="renderAnnotations" @contentMouseup="contentMouseup" v-if="readingTool === 3" />
|
||||
@renderAnnotations="renderAnnotations" @contentMouseup="contentMouseup" @setWwwc="setWwwc"
|
||||
v-if="readingTool === 3" />
|
||||
<Viewport :ref="`viewport-${index}`" :data-viewport-uid="`viewport-${index}`"
|
||||
:rendering-engine-id="renderingEngineId" :viewport-id="`viewport-${index}`" :viewport-index="index"
|
||||
@activeViewport="activeViewport" @toggleTaskByViewport="toggleTaskByViewport" @previewCD="previewCD"
|
||||
|
|
@ -327,7 +328,7 @@
|
|||
:rendering-engine-id="renderingEngineId" :viewport-id="`viewport-MPR-${index}`"
|
||||
:viewport-index="index" :MPRInfo="MPRInfo" @activeViewport="activeViewport" @setMPRInfo="setMPRInfo"
|
||||
@toggleTaskByViewport="toggleTaskByViewport" @previewCD="previewCD"
|
||||
@renderAnnotations="renderAnnotations" @contentMouseup="contentMouseup" />
|
||||
@renderAnnotations="renderAnnotations" @contentMouseup="contentMouseup" @setWwwc="setWwwc" />
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="readingTool === 2"
|
||||
|
|
@ -1607,6 +1608,7 @@ export default {
|
|||
const taskIdx = this.visitTaskList.findIndex(i => i.VisitTaskId === taskId)
|
||||
if (taskIdx === -1) return
|
||||
const annotations = this.visitTaskList[taskIdx].Annotations
|
||||
console.log(annotations, 'annotations')
|
||||
annotations.map(i => {
|
||||
if (i.MeasureData && !Object.hasOwn(i.MeasureData, 'isDicomReading')) {
|
||||
const annotation = i.MeasureData
|
||||
|
|
@ -2511,7 +2513,14 @@ export default {
|
|||
const viewport = renderingEngine.getViewport(viewportId)
|
||||
this.$refs[`${this.viewportKey}-${this.activeViewportIndex}`][0].resetOrientationMarkers()
|
||||
viewport.resetCamera({ resetPan: true, resetZoom: true, resetToCenter: true })
|
||||
viewport.resetProperties()
|
||||
if (this.isMPR || this.readingTool === 3) {
|
||||
let volume = cache.getVolume(this.$refs[viewportId][0].volumeId)
|
||||
const voi = metaData.get('voiLutModule', volume._imageIds[Math.ceil((volume._imageIds.length - 1) / 2)])
|
||||
this.setWwwc({ ww: voi.windowWidth[0], wc: voi.windowCenter[0] })
|
||||
} else {
|
||||
viewport.resetProperties()
|
||||
}
|
||||
|
||||
viewport.render()
|
||||
renderingEngine.render()
|
||||
},
|
||||
|
|
@ -2606,6 +2615,11 @@ export default {
|
|||
const viewport = renderingEngine.getViewport(viewportId)
|
||||
if (v.val === -1) {
|
||||
// 默认值
|
||||
if (this.isMPR || this.readingTool === 3) {
|
||||
let volume = cache.getVolume(this.$refs[viewportId][0].volumeId)
|
||||
const voi = metaData.get('voiLutModule', volume._imageIds[Math.ceil((volume._imageIds.length - 1) / 2)])
|
||||
return this.setWwwc({ ww: voi.windowWidth[0], wc: voi.windowCenter[0] })
|
||||
}
|
||||
viewport.resetProperties()
|
||||
viewport.render()
|
||||
} else if (v.val === 0) {
|
||||
|
|
@ -2631,7 +2645,7 @@ export default {
|
|||
// 设置窗宽窗位
|
||||
setWwwc(v) {
|
||||
const renderingEngine = getRenderingEngine(renderingEngineId)
|
||||
const viewportId = `${this.viewportKey}-${this.activeViewportIndex}`
|
||||
const viewportId = v.id ? v.id : `${this.viewportKey}-${this.activeViewportIndex}`
|
||||
const viewport = renderingEngine.getViewport(viewportId)
|
||||
const lower = v.wc - v.ww / 2
|
||||
const upper = v.wc + v.ww / 2 - 1
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@
|
|||
<div class="messageBox">
|
||||
<el-popover placement="left" :title="item.SegmentLabel" width="200" trigger="hover">
|
||||
<div class="Bidirectionalbox">
|
||||
<div class="BidirectionalBtn" @click.stop="getBidirectional([item])"
|
||||
<div class="BidirectionalBtn" @click.stop="addTip(item)"
|
||||
v-if="!item.bidirectional">
|
||||
{{ $t('trials:reading:Segmentations:button:getBidirectional') }}
|
||||
</div>
|
||||
|
|
@ -450,6 +450,11 @@ export default {
|
|||
this.actionConfiguration.contourBidirectional.data.segmentationId = segmentationId
|
||||
this.actionConfiguration.contourBidirectional.data.segmentIndex = segmentIndex
|
||||
},
|
||||
addTip(item) {
|
||||
this.calculateStatistics([item.segmentIndex], item.segmentationId, 'individual');
|
||||
this.getBidirectional([item])
|
||||
|
||||
},
|
||||
getBidirectional(list, DATA = null) {
|
||||
list.forEach(item => {
|
||||
this.createSegmentConfiguration(item.segmentIndex, item.segmentationId);
|
||||
|
|
@ -458,58 +463,57 @@ export default {
|
|||
const renderingEngine = getRenderingEngine(this.renderingEngineId)
|
||||
const viewportId = `${this.viewportKey}-${this.activeViewportIndex}`
|
||||
const viewport = renderingEngine.getViewport(viewportId);
|
||||
this.$nextTick(() => {
|
||||
[viewport.element].forEach(async (element) => {
|
||||
const bidirectionalData =
|
||||
await CStUtils.segmentation.getSegmentLargestBidirectional({
|
||||
segmentationId: list[0].segmentationId,
|
||||
segmentIndices: list.map(item => item.segmentIndex),
|
||||
});
|
||||
if (bidirectionalData.length <= 0) {
|
||||
list.forEach(item => {
|
||||
let annotations = annotation.state.getAllAnnotations().filter(i => i.metadata.segmentationId === item.segmentationId && i.metadata.segmentIndex === item.segmentIndex);
|
||||
annotations.forEach(i => {
|
||||
annotation.state.removeAnnotation(i.annotationUID)
|
||||
})
|
||||
item.bidirectional = null
|
||||
})
|
||||
|
||||
this.resetViewport(false)
|
||||
|
||||
if (DATA) {
|
||||
this.segmentationId = DATA.SegmentationId;
|
||||
this.segmentIndex = DATA.SegmentMumber;
|
||||
setTimeout(() => {
|
||||
this.selectSegment(DATA)
|
||||
})
|
||||
}
|
||||
}
|
||||
bidirectionalData.forEach((bidirectional) => {
|
||||
const { segmentIndex } = bidirectional;
|
||||
const { majorAxis, minorAxis, maxMajor, maxMinor } = bidirectional;
|
||||
let item = list.find(i => i.segmentIndex === segmentIndex)
|
||||
SegmentBidirectionalTool.hydrate(viewportId, [majorAxis, minorAxis], {
|
||||
segmentIndex,
|
||||
segmentationId: item.segmentationId,
|
||||
});
|
||||
let an = annotation.state.getAllAnnotations().find(i => i.metadata.segmentationId === item.segmentationId && i.metadata.segmentIndex === bidirectional.segmentIndex && i.metadata.toolName === "SegmentBidirectional");
|
||||
if (an) {
|
||||
annotation.locking.setAnnotationLocked(an.annotationUID, true)
|
||||
annotation.visibility.setAnnotationVisibility(an.annotationUID, item.bidirectionalView)
|
||||
}
|
||||
item.bidirectional = bidirectional
|
||||
if (DATA) {
|
||||
this.segmentationId = DATA.SegmentationId;
|
||||
this.segmentIndex = DATA.SegmentMumber;
|
||||
setTimeout(() => {
|
||||
this.selectSegment(DATA)
|
||||
})
|
||||
}
|
||||
// render the bidirectional tool data
|
||||
[viewport.element].forEach(async (element) => {
|
||||
const bidirectionalData =
|
||||
await CStUtils.segmentation.getSegmentLargestBidirectional({
|
||||
segmentationId: list[0].segmentationId,
|
||||
segmentIndices: list.map(item => item.segmentIndex),
|
||||
});
|
||||
console.log(bidirectionalData, 'bidirectionalData')
|
||||
if (bidirectionalData.length <= 0) {
|
||||
list.forEach(item => {
|
||||
let annotations = annotation.state.getAllAnnotations().filter(i => i.metadata.segmentationId === item.segmentationId && i.metadata.segmentIndex === item.segmentIndex);
|
||||
annotations.forEach(i => {
|
||||
annotation.state.removeAnnotation(i.annotationUID)
|
||||
})
|
||||
item.bidirectional = null
|
||||
})
|
||||
|
||||
this.resetViewport(false)
|
||||
|
||||
if (DATA) {
|
||||
this.segmentationId = DATA.SegmentationId;
|
||||
this.segmentIndex = DATA.SegmentMumber;
|
||||
setTimeout(() => {
|
||||
this.selectSegment(DATA)
|
||||
})
|
||||
}
|
||||
}
|
||||
bidirectionalData.forEach((bidirectional) => {
|
||||
const { segmentIndex } = bidirectional;
|
||||
const { majorAxis, minorAxis, maxMajor, maxMinor } = bidirectional;
|
||||
let item = list.find(i => i.segmentIndex === segmentIndex)
|
||||
SegmentBidirectionalTool.hydrate(viewportId, [majorAxis, minorAxis], {
|
||||
segmentIndex,
|
||||
segmentationId: item.segmentationId,
|
||||
});
|
||||
let an = annotation.state.getAllAnnotations().find(i => i.metadata.segmentationId === item.segmentationId && i.metadata.segmentIndex === bidirectional.segmentIndex && i.metadata.toolName === "SegmentBidirectional");
|
||||
if (an) {
|
||||
annotation.locking.setAnnotationLocked(an.annotationUID, true)
|
||||
annotation.visibility.setAnnotationVisibility(an.annotationUID, item.bidirectionalView)
|
||||
}
|
||||
item.bidirectional = bidirectional
|
||||
if (DATA) {
|
||||
this.segmentationId = DATA.SegmentationId;
|
||||
this.segmentIndex = DATA.SegmentMumber;
|
||||
setTimeout(() => {
|
||||
this.selectSegment(DATA)
|
||||
})
|
||||
}
|
||||
// render the bidirectional tool data
|
||||
});
|
||||
})
|
||||
|
||||
});
|
||||
},
|
||||
setToolActive(toolName) {
|
||||
if (this.segmentList.length <= 0) return false
|
||||
|
|
@ -560,7 +564,7 @@ export default {
|
|||
async jumpBidirectional(item) {
|
||||
if (item.bidirectional) {
|
||||
let an = annotation.state.getAllAnnotations().find(i => i.metadata.segmentationId === item.segmentationId && i.metadata.segmentIndex === item.segmentIndex && i.metadata.toolName === "SegmentBidirectional");
|
||||
// console.log(an, 'an')
|
||||
console.log(an, 'an')
|
||||
if (!an) return false
|
||||
|
||||
const renderingEngine = getRenderingEngine(this.renderingEngineId)
|
||||
|
|
@ -823,6 +827,7 @@ export default {
|
|||
},
|
||||
async customPrompt() {
|
||||
try {
|
||||
console.log(annotation.state.getAllAnnotations(), 'annotation.state.getAllAnnotations()')
|
||||
const that = this
|
||||
// 请输入标记名称
|
||||
let message = this.$t('trials:reading:Segmentations:message:rename')
|
||||
|
|
@ -986,7 +991,10 @@ export default {
|
|||
metaData
|
||||
);
|
||||
group.segments.forEach((item, index) => {
|
||||
generatedSegmentation.dataset.SegmentSequence[index].SegmentNumber = item.segmentIndex.toString()
|
||||
if (generatedSegmentation.dataset.SegmentSequence[index]) {
|
||||
generatedSegmentation.dataset.SegmentSequence[index].SegmentNumber = item.segmentIndex.toString()
|
||||
}
|
||||
|
||||
})
|
||||
if (!isFile) {
|
||||
const buffer = Buffer.from(dcmjs.data.datasetToDict(generatedSegmentation.dataset).write());
|
||||
|
|
@ -1131,6 +1139,7 @@ export default {
|
|||
if (toolName === 'ThresholdSphere') {
|
||||
this.setDynamicRadius()
|
||||
}
|
||||
console.log(this.brushThreshold.dynamicRadius, 'this.brushThreshold.dynamicRadius')
|
||||
},
|
||||
setDynamicRadius() {
|
||||
let volume = cache.getVolume(this.series.SeriesInstanceUid);
|
||||
|
|
@ -1182,7 +1191,7 @@ export default {
|
|||
},
|
||||
segmentationModifiedCallback(evt) {
|
||||
const { detail } = evt;
|
||||
console.log(detail)
|
||||
// console.log(detail)
|
||||
if (detail.segmentIndex === 0) {
|
||||
this.drawing = true
|
||||
this.isDel = true
|
||||
|
|
@ -1200,7 +1209,7 @@ export default {
|
|||
segmentIndices: indices,
|
||||
mode,
|
||||
});
|
||||
|
||||
console.log(stats)
|
||||
if (mode === 'individual') {
|
||||
const segmentStats = stats;
|
||||
|
||||
|
|
@ -1263,8 +1272,9 @@ export default {
|
|||
annotation.state.removeAnnotation(i.annotationUID)
|
||||
}
|
||||
})
|
||||
this.getBidirectional(segmentGroup.segments)
|
||||
this.calculateStatistics(segmentIndexs, this.segmentationId, 'individual');
|
||||
this.getBidirectional(segmentGroup.segments)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -180,6 +180,7 @@ export default {
|
|||
// resizeObserver.observe(this.element)
|
||||
this.element.addEventListener("CORNERSTONE_VOLUME_NEW_IMAGE", this.stackNewImage)
|
||||
this.element.addEventListener('CORNERSTONE_VOI_MODIFIED', this.voiModified)
|
||||
this.element.addEventListener('CORNERSTONE_IMAGE_RENDERED', this.imageRendered)
|
||||
this.element.addEventListener('wheel', (e) => {
|
||||
console.log('CORNERSTONE_STACK_VIEWPORT_SCROLL')
|
||||
const renderingEngine = getRenderingEngine(this.renderingEngineId)
|
||||
|
|
@ -274,8 +275,6 @@ export default {
|
|||
let imageId = imageIds[detail.imageIndex]
|
||||
if (imageId) {
|
||||
const imagePlaneModule = metaData.get('imagePlaneModule', imageId)
|
||||
// const voi = metaData.get('voiLutModule', imageId)
|
||||
// console.log(voi, 'voi')
|
||||
this.imageInfo.imageOrientationPatient = imagePlaneModule.imageOrientationPatient
|
||||
this.imageInfo.imagePositionPatient = imagePlaneModule.imagePositionPatient
|
||||
this.imageInfo.size = `${imagePlaneModule.columns}*${imagePlaneModule.rows}`
|
||||
|
|
@ -326,6 +325,22 @@ export default {
|
|||
this.$emit('upperRangeChange', Math.round(windowWidth))
|
||||
}
|
||||
},
|
||||
imageRendered(e) {
|
||||
const renderingEngine = getRenderingEngine(this.renderingEngineId)
|
||||
const viewport = renderingEngine.getViewport(this.viewportId)
|
||||
const properties = viewport.getProperties()
|
||||
|
||||
if (properties && properties.voiRange) {
|
||||
var { lower, upper } = properties.voiRange
|
||||
const { windowWidth, windowCenter } = csUtils.windowLevel.toWindowLevel(
|
||||
lower,
|
||||
upper
|
||||
)
|
||||
this.imageInfo.wwwc = `${Math.round(windowWidth)}/${Math.round(windowCenter)}`
|
||||
}
|
||||
const zoom = viewport.getZoom()
|
||||
this.imageInfo.zoom = zoom.toFixed(4)
|
||||
},
|
||||
getOrientationMarker() {
|
||||
const renderingEngine = getRenderingEngine(this.renderingEngineId)
|
||||
const viewport = renderingEngine.getViewport(this.viewportId)
|
||||
|
|
@ -508,7 +523,10 @@ export default {
|
|||
}
|
||||
console.log("渲染成功")
|
||||
}
|
||||
}]).then(res => {
|
||||
}]).then(r => {
|
||||
const voi = metaData.get('voiLutModule', res.volume._imageIds[Math.ceil((res.volume._imageIds.length - 1) / 2)])
|
||||
this.$emit('setWwwc', { ww: voi.windowWidth[0], wc: voi.windowCenter[0], id: this.viewportId })
|
||||
// console.log(viewport.getSlabThickness(), 'getSlabThickness')
|
||||
if (data.segment) {
|
||||
return DicomEvent.$emit("isloaded", { segment: data.segment })
|
||||
}
|
||||
|
|
@ -528,13 +546,50 @@ export default {
|
|||
const worldPoint = currentPoints.world
|
||||
const renderingEngine = getRenderingEngine(this.renderingEngineId)
|
||||
const viewport = renderingEngine.getViewport(this.viewportId)
|
||||
const imageData = viewport.getImageData()
|
||||
if (!imageData) return
|
||||
const index = imageData.imageData.worldToIndex(worldPoint)
|
||||
let referencedImageId = viewport.getCurrentImageId()
|
||||
const data = viewport.getImageData()
|
||||
if (!data) return
|
||||
const { dimensions, imageData, metadata, voxelManager } = data
|
||||
const index = imageData.worldToIndex(worldPoint)
|
||||
index[0] = Math.floor(index[0])
|
||||
index[1] = Math.floor(index[1])
|
||||
index[2] = Math.floor(index[2])
|
||||
this.mousePosition.index = index
|
||||
const modality = metadata.Modality
|
||||
let ijk = csUtils.transformWorldToIndex(imageData, worldPoint)
|
||||
ijk = vec3.round(ijk, ijk);
|
||||
if (csUtils.indexWithinDimensions(ijk, dimensions)) {
|
||||
this.isHandleOutsideImage = false
|
||||
let value = voxelManager.getAtIJKPoint(ijk)
|
||||
ijk[2] = viewport.getCurrentImageIdIndex()
|
||||
let modalityUnit
|
||||
if (modality === 'US') {
|
||||
const calibratedResults = cornerstoneTools.utilities.getCalibratedProbeUnitsAndValue(image, [ijk])
|
||||
const hasEnhancedRegionValues = calibratedResults.values.every(
|
||||
(value) => value !== null
|
||||
)
|
||||
value = (hasEnhancedRegionValues ? calibratedResults.values : value)
|
||||
modalityUnit = hasEnhancedRegionValues
|
||||
? calibratedResults.units
|
||||
: 'raw';
|
||||
} else {
|
||||
const scalingModule = referencedImageId && metaData.get('scalingModule', referencedImageId)
|
||||
const isSuvScaled = typeof scalingModule?.suvbw === 'number'
|
||||
if (scalingModule && scalingModule.suvbw) {
|
||||
const pixelUnitsOptions = {
|
||||
isPreScaled: cornerstoneTools.utilities.viewport.isViewportPreScaled(viewport, referencedImageId),
|
||||
isSuvScaled: isSuvScaled,
|
||||
}
|
||||
modalityUnit = cornerstoneTools.utilities.getPixelValueUnits(
|
||||
modality,
|
||||
referencedImageId,
|
||||
pixelUnitsOptions
|
||||
);
|
||||
}
|
||||
}
|
||||
this.mousePosition.value = value
|
||||
this.mousePosition.modalityUnit = modalityUnit
|
||||
}
|
||||
},
|
||||
toggleTask(evt, visitTaskNum, i) {
|
||||
this.$emit('activeViewport', this.viewportIndex)
|
||||
|
|
|
|||
Loading…
Reference in New Issue