分割标记跳转修改

uat_us
wangxiaoshuang 2026-03-25 13:52:14 +08:00
parent d30c9a5f3b
commit cbcb396441
4 changed files with 61 additions and 39 deletions

View File

@ -712,12 +712,12 @@ export default {
var studyUid = data.string('x0020000d') var studyUid = data.string('x0020000d')
if (!studyUid) return resolve() if (!studyUid) return resolve()
var pixelDataElement = data.elements.x7fe00010 var pixelDataElement = data.elements.x7fe00010
if (!pixelDataElement && modality !== 'SR') return resolve() if (!pixelDataElement && modality !== 'SR' && modality !== 'ECG') return resolve()
var studyIndex = 0 var studyIndex = 0
while ( while (
studyIndex < scope.uploadQueues.length && studyIndex < scope.uploadQueues.length &&
scope.uploadQueues[studyIndex].dicomInfo.studyUid !== studyUid && scope.uploadQueues[studyIndex].dicomInfo.studyUid !== studyUid &&
(pixelDataElement || modality === 'SR') && (pixelDataElement || modality === 'SR' || modality === 'ECG') &&
modality != '' modality != ''
) { ) {
++studyIndex ++studyIndex

View File

@ -1720,7 +1720,7 @@ export default {
if (annotation.metadata.toolName !== LabelMapEditWithContourTool.toolName) this.setToolsPassive() if (annotation.metadata.toolName !== LabelMapEditWithContourTool.toolName) this.setToolsPassive()
return return
} }
if (annotation.data.segmentation || annotation.data.segment) return if (annotation.metadata.segmentationId) return
if (annotation.metadata.toolName === 'PlanarFreehandROI' && !annotation.data.contour.closed) return if (annotation.metadata.toolName === 'PlanarFreehandROI' && !annotation.data.contour.closed) return
const series = this.$refs[`${this.viewportKey}-${this.activeViewportIndex}`][0].series const series = this.$refs[`${this.viewportKey}-${this.activeViewportIndex}`][0].series
if (series && series.TaskInfo.VisitTaskId && series.TaskInfo.VisitTaskId === this.taskInfo.VisitTaskId) { if (series && series.TaskInfo.VisitTaskId && series.TaskInfo.VisitTaskId === this.taskInfo.VisitTaskId) {
@ -1808,7 +1808,7 @@ export default {
if (annotation.metadata.toolName !== LabelMapEditWithContourTool.toolName) this.setToolsPassive() if (annotation.metadata.toolName !== LabelMapEditWithContourTool.toolName) this.setToolsPassive()
return return
} }
if (annotation.data.segmentation || annotation.data.segment) return if (annotation.metadata.segmentationId) return
if (!annotation.data.label) return if (!annotation.data.label) return
if (annotation.metadata.toolName === 'PlanarFreehandROI' && !annotation.data.contour.closed) return if (annotation.metadata.toolName === 'PlanarFreehandROI' && !annotation.data.contour.closed) return
const series = this.$refs[`${this.viewportKey}-${this.activeViewportIndex}`][0].series const series = this.$refs[`${this.viewportKey}-${this.activeViewportIndex}`][0].series
@ -1839,7 +1839,7 @@ export default {
// //
return return
} }
if (annotation.data.segmentation || annotation.data.segment) return if (annotation.metadata.segmentationId) return
if (annotation.visitTaskId === this.taskInfo.VisitTaskId) { if (annotation.visitTaskId === this.taskInfo.VisitTaskId) {
const isBound = this.$refs[`ecrf_${annotation.visitTaskId}`][0].verifyAnnotationIsBound(annotation) const isBound = this.$refs[`ecrf_${annotation.visitTaskId}`][0].verifyAnnotationIsBound(annotation)
if (isBound && this.activeTool === 'Eraser') { if (isBound && this.activeTool === 'Eraser') {

View File

@ -305,7 +305,7 @@ export default {
mounted() { mounted() {
this.SegmentHight = window.innerHeight > 900 ? window.innerHeight * 0.5 : window.innerHeight * 0.4; this.SegmentHight = window.innerHeight > 900 ? window.innerHeight * 0.5 : window.innerHeight * 0.4;
this.statsKey = getCustomizeStandardsSegmentDicomTools('Labelmap')[0].props.filter(item => item !== 'width' && item !== 'length') this.statsKey = getCustomizeStandardsSegmentDicomTools('Labelmap')[0].props.filter(item => item !== 'width' && item !== 'length')
// console.log(segmentation, 'segmentation') console.log(segmentation, 'segmentation')
// console.log(annotation, 'annotation') // console.log(annotation, 'annotation')
eventTarget.addEventListener( eventTarget.addEventListener(
'CORNERSTONE_TOOLS_SEGMENTATION_DATA_MODIFIED', 'CORNERSTONE_TOOLS_SEGMENTATION_DATA_MODIFIED',
@ -421,11 +421,12 @@ export default {
segmentIndex, segmentIndex,
segmentationId: item.segmentationId, segmentationId: item.segmentationId,
}); });
item.bidirectional = bidirectional
let an = annotation.state.getAllAnnotations().find(i => i.metadata.segmentationId === item.segmentationId && i.metadata.segmentIndex === bidirectional.segmentIndex && i.metadata.toolName === "SegmentBidirectional"); let an = annotation.state.getAllAnnotations().find(i => i.metadata.segmentationId === item.segmentationId && i.metadata.segmentIndex === bidirectional.segmentIndex && i.metadata.toolName === "SegmentBidirectional");
if (an) { if (an) {
annotation.locking.setAnnotationLocked(an.annotationUID, true) annotation.locking.setAnnotationLocked(an.annotationUID, true)
annotation.visibility.setAnnotationVisibility(an.annotationUID, item.bidirectionalView)
} }
item.bidirectional = bidirectional
if (DATA) { if (DATA) {
this.segmentationId = DATA.SegmentationId; this.segmentationId = DATA.SegmentationId;
this.segmentIndex = DATA.SegmentMumber; this.segmentIndex = DATA.SegmentMumber;
@ -481,16 +482,30 @@ export default {
} }
this.resetViewport() this.resetViewport()
}, },
jumpBidirectional(item) { async jumpBidirectional(item) {
if (item.bidirectional) { if (item.bidirectional) {
let an = annotation.state.getAllAnnotations().find(i => i.metadata.segmentationId === item.segmentationId && i.metadata.segmentIndex === item.segmentIndex && i.metadata.toolName === "SegmentBidirectional"); 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')
if (!an) return false if (!an) return false
let referencedImageId = an.metadata.referencedImageId;
let sliceIndex = metaData.get('generalImageModule', referencedImageId).instanceNumber
const renderingEngine = getRenderingEngine(this.renderingEngineId) const renderingEngine = getRenderingEngine(this.renderingEngineId)
const viewportId = `${this.viewportKey}-${this.activeViewportIndex}` const viewportId = `${this.viewportKey}-${this.activeViewportIndex}`
const viewport = renderingEngine.getViewport(viewportId) const viewport = renderingEngine.getViewport(viewportId)
csUtils.jumpToSlice(viewport.element, { imageIndex: sliceIndex - 1 }); let key = Object.keys(an.data.cachedStats)[0]; // referencedImageId
if (key) {
let sliceIndex = key.split("?")[1].split("&")[0].split("=")[1]
csUtils.jumpToSlice(viewport.element, { imageIndex: sliceIndex });
} else {
const points = an.data.handles.points;
const worldPoint = points[0]; //
let imageData = cache.getVolume(this.series.SeriesInstanceUid).imageData
const ijk = imageData.worldToIndex(worldPoint);
const sliceIndex = Math.abs(Math.round(ijk[2]));
let imageIds = viewport.getImageIds(this.series.SeriesInstanceUid)
// console.log(sliceIndex, 'sliceIndex')
csUtils.jumpToSlice(viewport.element, { imageIndex: imageIds.length - sliceIndex - 1 });
}
} }
}, },
viewSegmentGroup(item) { viewSegmentGroup(item) {
@ -542,7 +557,8 @@ export default {
this.viewprotIds.forEach(id => { this.viewprotIds.forEach(id => {
segmentation.activeSegmentation.setActiveSegmentation(id, this.segmentationId) segmentation.activeSegmentation.setActiveSegmentation(id, this.segmentationId)
}) })
this.selectSegment({ segmentationId: this.segmentationId, segmentIndex: 1 }) let segment = this.segmentList.find(item => item.segmentationId === this.segmentationId).segments[0]
this.selectSegment(segment)
this.readingSegmentByConfig() this.readingSegmentByConfig()
}, },
async addSegmentGroup() { async addSegmentGroup() {
@ -687,7 +703,8 @@ export default {
let s = this.segmentList[groupIndex].segments.find(item => item.segmentIndex === segmentIndex) let s = this.segmentList[groupIndex].segments.find(item => item.segmentIndex === segmentIndex)
let res = await this.deleteSegment(s.id) let res = await this.deleteSegment(s.id)
if (!res) return false if (!res) return false
segmentation.removeSegment(this.segmentationId, Number(segmentIndex), { setNextSegmentAsActive: false }) segmentation.removeSegment(this.segmentationId, Number(segmentIndex), { setNextSegmentAsActive: false, recordHistory: false })
segmentation.helpers.clearSegmentValue(this.segmentationId, Number(segmentIndex), { recordHistory: false })
// segmentation.updateSegmentations({ segmentationId: this.segmentationId }) // segmentation.updateSegmentations({ segmentationId: this.segmentationId })
let index = this.segmentList[groupIndex].segments.findIndex(item => item.segmentIndex === segmentIndex) let index = this.segmentList[groupIndex].segments.findIndex(item => item.segmentIndex === segmentIndex)
this.segmentList[groupIndex].segments.splice(index, 1) this.segmentList[groupIndex].segments.splice(index, 1)
@ -775,9 +792,11 @@ export default {
segmentList.forEach(segment => { segmentList.forEach(segment => {
this.viewBidirectional(segment.segments, this.SegmentConfig.InactiveSegmentations.show) this.viewBidirectional(segment.segments, this.SegmentConfig.InactiveSegmentations.show)
}) })
let segments = this.segmentList.find(item => item.segmentationId === this.segmentationId).segments let segmentGroup = this.segmentList.find(item => item.segmentationId === this.segmentationId)
if (segmentGroup) {
let segments = segmentGroup.segments
this.viewBidirectional(segments, true) this.viewBidirectional(segments, true)
}
}, },
// //
changeSegmentConfig(renderOutline, renderFill) { changeSegmentConfig(renderOutline, renderFill) {
@ -850,6 +869,7 @@ export default {
color.slice(0, 3).map(value => value / 255) color.slice(0, 3).map(value => value / 255)
).map(value => Math.round(value)); ).map(value => Math.round(value));
let segment = group.segments.find(item => item.segmentIndex === segmentIndex) let segment = group.segments.find(item => item.segmentIndex === segmentIndex)
if (segment) {
let SegmentLabel = segment.SegmentLabel let SegmentLabel = segment.SegmentLabel
const segmentMetadata = { const segmentMetadata = {
SegmentNumber: segmentIndex.toString(), SegmentNumber: segmentIndex.toString(),
@ -868,7 +888,9 @@ export default {
CodeMeaning: "Tissue" CodeMeaning: "Tissue"
} }
}; };
if (segment.bidirectional && segment.stats) labelmap3D.metadata[segmentIndex] = segmentMetadata; if (segment.bidirectional && segment.stats) labelmap3D.metadata[segmentIndex] = segmentMetadata;
}
}); });
if (labelmap3D.metadata.length <= 0) { if (labelmap3D.metadata.length <= 0) {
return false return false

View File

@ -891,12 +891,12 @@ export default {
var studyUid = data.string('x0020000d') var studyUid = data.string('x0020000d')
if (!studyUid) return resolve() if (!studyUid) return resolve()
var pixelDataElement = data.elements.x7fe00010 var pixelDataElement = data.elements.x7fe00010
if (!pixelDataElement && modality !== 'SR') return resolve() if (!pixelDataElement && modality !== 'SR' && modality !== 'ECG') return resolve()
var studyIndex = 0 var studyIndex = 0
while ( while (
studyIndex < scope.uploadQueues.length && studyIndex < scope.uploadQueues.length &&
scope.uploadQueues[studyIndex].dicomInfo.studyUid !== studyUid && scope.uploadQueues[studyIndex].dicomInfo.studyUid !== studyUid &&
(pixelDataElement || modality === 'SR') && (pixelDataElement || modality === 'SR' || modality === 'ECG') &&
modality != '' modality != ''
) { ) {
++studyIndex ++studyIndex