分割标记跳转修改
parent
d30c9a5f3b
commit
cbcb396441
|
|
@ -712,12 +712,12 @@ export default {
|
|||
var studyUid = data.string('x0020000d')
|
||||
if (!studyUid) return resolve()
|
||||
var pixelDataElement = data.elements.x7fe00010
|
||||
if (!pixelDataElement && modality !== 'SR') return resolve()
|
||||
if (!pixelDataElement && modality !== 'SR' && modality !== 'ECG') return resolve()
|
||||
var studyIndex = 0
|
||||
while (
|
||||
studyIndex < scope.uploadQueues.length &&
|
||||
scope.uploadQueues[studyIndex].dicomInfo.studyUid !== studyUid &&
|
||||
(pixelDataElement || modality === 'SR') &&
|
||||
(pixelDataElement || modality === 'SR' || modality === 'ECG') &&
|
||||
modality != ''
|
||||
) {
|
||||
++studyIndex
|
||||
|
|
|
|||
|
|
@ -1720,7 +1720,7 @@ export default {
|
|||
if (annotation.metadata.toolName !== LabelMapEditWithContourTool.toolName) this.setToolsPassive()
|
||||
return
|
||||
}
|
||||
if (annotation.data.segmentation || annotation.data.segment) return
|
||||
if (annotation.metadata.segmentationId) return
|
||||
if (annotation.metadata.toolName === 'PlanarFreehandROI' && !annotation.data.contour.closed) return
|
||||
const series = this.$refs[`${this.viewportKey}-${this.activeViewportIndex}`][0].series
|
||||
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()
|
||||
return
|
||||
}
|
||||
if (annotation.data.segmentation || annotation.data.segment) return
|
||||
if (annotation.metadata.segmentationId) return
|
||||
if (!annotation.data.label) return
|
||||
if (annotation.metadata.toolName === 'PlanarFreehandROI' && !annotation.data.contour.closed) return
|
||||
const series = this.$refs[`${this.viewportKey}-${this.activeViewportIndex}`][0].series
|
||||
|
|
@ -1839,7 +1839,7 @@ export default {
|
|||
// 临时标记
|
||||
return
|
||||
}
|
||||
if (annotation.data.segmentation || annotation.data.segment) return
|
||||
if (annotation.metadata.segmentationId) return
|
||||
if (annotation.visitTaskId === this.taskInfo.VisitTaskId) {
|
||||
const isBound = this.$refs[`ecrf_${annotation.visitTaskId}`][0].verifyAnnotationIsBound(annotation)
|
||||
if (isBound && this.activeTool === 'Eraser') {
|
||||
|
|
|
|||
|
|
@ -305,7 +305,7 @@ export default {
|
|||
mounted() {
|
||||
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')
|
||||
// console.log(segmentation, 'segmentation')
|
||||
console.log(segmentation, 'segmentation')
|
||||
// console.log(annotation, 'annotation')
|
||||
eventTarget.addEventListener(
|
||||
'CORNERSTONE_TOOLS_SEGMENTATION_DATA_MODIFIED',
|
||||
|
|
@ -421,11 +421,12 @@ export default {
|
|||
segmentIndex,
|
||||
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");
|
||||
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;
|
||||
|
|
@ -481,16 +482,30 @@ export default {
|
|||
}
|
||||
this.resetViewport()
|
||||
},
|
||||
jumpBidirectional(item) {
|
||||
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')
|
||||
if (!an) return false
|
||||
let referencedImageId = an.metadata.referencedImageId;
|
||||
let sliceIndex = metaData.get('generalImageModule', referencedImageId).instanceNumber
|
||||
|
||||
const renderingEngine = getRenderingEngine(this.renderingEngineId)
|
||||
const viewportId = `${this.viewportKey}-${this.activeViewportIndex}`
|
||||
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) {
|
||||
|
|
@ -542,7 +557,8 @@ export default {
|
|||
this.viewprotIds.forEach(id => {
|
||||
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()
|
||||
},
|
||||
async addSegmentGroup() {
|
||||
|
|
@ -687,7 +703,8 @@ export default {
|
|||
let s = this.segmentList[groupIndex].segments.find(item => item.segmentIndex === segmentIndex)
|
||||
let res = await this.deleteSegment(s.id)
|
||||
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 })
|
||||
let index = this.segmentList[groupIndex].segments.findIndex(item => item.segmentIndex === segmentIndex)
|
||||
this.segmentList[groupIndex].segments.splice(index, 1)
|
||||
|
|
@ -775,9 +792,11 @@ export default {
|
|||
segmentList.forEach(segment => {
|
||||
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)
|
||||
|
||||
}
|
||||
},
|
||||
// 更改分割标记显示模式
|
||||
changeSegmentConfig(renderOutline, renderFill) {
|
||||
|
|
@ -850,6 +869,7 @@ export default {
|
|||
color.slice(0, 3).map(value => value / 255)
|
||||
).map(value => Math.round(value));
|
||||
let segment = group.segments.find(item => item.segmentIndex === segmentIndex)
|
||||
if (segment) {
|
||||
let SegmentLabel = segment.SegmentLabel
|
||||
const segmentMetadata = {
|
||||
SegmentNumber: segmentIndex.toString(),
|
||||
|
|
@ -868,7 +888,9 @@ export default {
|
|||
CodeMeaning: "Tissue"
|
||||
}
|
||||
};
|
||||
|
||||
if (segment.bidirectional && segment.stats) labelmap3D.metadata[segmentIndex] = segmentMetadata;
|
||||
}
|
||||
});
|
||||
if (labelmap3D.metadata.length <= 0) {
|
||||
return false
|
||||
|
|
|
|||
|
|
@ -891,12 +891,12 @@ export default {
|
|||
var studyUid = data.string('x0020000d')
|
||||
if (!studyUid) return resolve()
|
||||
var pixelDataElement = data.elements.x7fe00010
|
||||
if (!pixelDataElement && modality !== 'SR') return resolve()
|
||||
if (!pixelDataElement && modality !== 'SR' && modality !== 'ECG') return resolve()
|
||||
var studyIndex = 0
|
||||
while (
|
||||
studyIndex < scope.uploadQueues.length &&
|
||||
scope.uploadQueues[studyIndex].dicomInfo.studyUid !== studyUid &&
|
||||
(pixelDataElement || modality === 'SR') &&
|
||||
(pixelDataElement || modality === 'SR' || modality === 'ECG') &&
|
||||
modality != ''
|
||||
) {
|
||||
++studyIndex
|
||||
|
|
|
|||
Loading…
Reference in New Issue