分裂主病灶状态计算逻辑优化
parent
dc6340f65c
commit
af9ad72798
|
@ -516,7 +516,7 @@ export default {
|
|||
loadingText: '',
|
||||
initAnnotations: [],
|
||||
activeCanvasWW: null,
|
||||
activeCanvasWC: null,
|
||||
activeCanvasWC: null
|
||||
|
||||
}
|
||||
},
|
||||
|
@ -701,9 +701,9 @@ export default {
|
|||
const debouncedCallback = this.debounce((e) => {
|
||||
const { annotation } = e.detail
|
||||
const { remark } = annotation.data
|
||||
if(this.initAnnotations.length > 0 && this.initAnnotations[0].orderMark === remark && !this.initAnnotations[0].isInit){
|
||||
if (this.initAnnotations.length > 0 && this.initAnnotations[0].orderMark === remark && !this.initAnnotations[0].isInit) {
|
||||
this.initAnnotations[0].isInit = true
|
||||
}else{
|
||||
} else {
|
||||
this.onAnnotationModified(e)
|
||||
}
|
||||
// const { cachedStats } = annotation.data
|
||||
|
|
|
@ -18,8 +18,8 @@ const {
|
|||
} = cornerstoneTools
|
||||
// const { getWorldWidthAndHeightFromTwoPoints } = utilities.planar
|
||||
// const { roundNumber } = utilities
|
||||
const { hideElementCursor,resetElementCursor } = cursors.elementCursor
|
||||
const { getAnnotations,addAnnotation } = annotation.state
|
||||
const { hideElementCursor } = cursors.elementCursor
|
||||
const { getAnnotations, addAnnotation } = annotation.state
|
||||
const { isAnnotationVisible } = annotation.visibility
|
||||
const { isAnnotationLocked } = annotation.locking
|
||||
const drawHandlesSvg = drawing.drawHandles
|
||||
|
@ -84,27 +84,27 @@ class CircleROITool extends cornerstoneTools.CircleROITool {
|
|||
// this._getTextLines = this.getTextLines
|
||||
}
|
||||
addNewAnnotation = (evt) => {
|
||||
const eventDetail = evt.detail;
|
||||
const { currentPoints, element } = eventDetail;
|
||||
const worldPos = currentPoints.world;
|
||||
const eventDetail = evt.detail
|
||||
const { currentPoints, element } = eventDetail
|
||||
const worldPos = currentPoints.world
|
||||
// const canvasPos = currentPoints.canvas;
|
||||
|
||||
const enabledElement = getEnabledElement(element);
|
||||
const { viewport, renderingEngine } = enabledElement;
|
||||
const enabledElement = getEnabledElement(element)
|
||||
const { viewport, renderingEngine } = enabledElement
|
||||
|
||||
this.isDrawing = true;
|
||||
this.isDrawing = true
|
||||
|
||||
const camera = viewport.getCamera();
|
||||
const { viewPlaneNormal, viewUp } = camera;
|
||||
const camera = viewport.getCamera()
|
||||
const { viewPlaneNormal, viewUp } = camera
|
||||
|
||||
const referencedImageId = this.getReferencedImageId(
|
||||
viewport,
|
||||
worldPos,
|
||||
viewPlaneNormal,
|
||||
viewUp
|
||||
);
|
||||
)
|
||||
|
||||
const FrameOfReferenceUID = viewport.getFrameOfReferenceUID();
|
||||
const FrameOfReferenceUID = viewport.getFrameOfReferenceUID()
|
||||
|
||||
const annotation = {
|
||||
highlighted: true,
|
||||
|
@ -114,7 +114,7 @@ class CircleROITool extends cornerstoneTools.CircleROITool {
|
|||
viewPlaneNormal: [...viewPlaneNormal],
|
||||
viewUp: [...viewUp],
|
||||
FrameOfReferenceUID,
|
||||
referencedImageId,
|
||||
referencedImageId
|
||||
},
|
||||
data: {
|
||||
label: '',
|
||||
|
@ -126,43 +126,43 @@ class CircleROITool extends cornerstoneTools.CircleROITool {
|
|||
topLeft: [0, 0, 0],
|
||||
topRight: [0, 0, 0],
|
||||
bottomLeft: [0, 0, 0],
|
||||
bottomRight: [0, 0, 0],
|
||||
},
|
||||
bottomRight: [0, 0, 0]
|
||||
}
|
||||
},
|
||||
points: [[...worldPos], [...worldPos]],
|
||||
activeHandleIndex: 1,
|
||||
activeHandleIndex: 1
|
||||
},
|
||||
cachedStats: {},
|
||||
},
|
||||
};
|
||||
addAnnotation(annotation, element);
|
||||
cachedStats: {}
|
||||
}
|
||||
}
|
||||
addAnnotation(annotation, element)
|
||||
|
||||
const viewportIdsToRender = getViewportIdsWithToolToRender(
|
||||
element,
|
||||
this.getToolName()
|
||||
);
|
||||
)
|
||||
|
||||
this.editData = {
|
||||
annotation,
|
||||
viewportIdsToRender,
|
||||
newAnnotation: true,
|
||||
hasMoved: false,
|
||||
};
|
||||
this._activateDraw(element);
|
||||
hasMoved: false
|
||||
}
|
||||
this._activateDraw(element)
|
||||
|
||||
hideElementCursor(element);
|
||||
hideElementCursor(element)
|
||||
|
||||
evt.preventDefault();
|
||||
evt.preventDefault()
|
||||
|
||||
triggerAnnotationRenderForViewportIds(renderingEngine, viewportIdsToRender);
|
||||
triggerAnnotationRenderForViewportIds(renderingEngine, viewportIdsToRender)
|
||||
|
||||
return annotation;
|
||||
return annotation
|
||||
};
|
||||
renderAnnotation = (enabledElement, svgDrawingHelper) => {
|
||||
let renderStatus = false
|
||||
const { viewport } = enabledElement
|
||||
const { element } = viewport
|
||||
|
||||
|
||||
let annotations = getAnnotations(this.getToolName(), element)
|
||||
|
||||
if (!annotations || (annotations && annotations.length === 0)) {
|
||||
|
@ -195,7 +195,7 @@ class CircleROITool extends cornerstoneTools.CircleROITool {
|
|||
// const { points, activeHandleIndex } = handles
|
||||
const { points } = handles
|
||||
var activeHandleIndex = null
|
||||
if(annotation.highlighted && !annotation.isLocked && annotation.isVisible){
|
||||
if (annotation.highlighted && !annotation.isLocked && annotation.isVisible) {
|
||||
activeHandleIndex = 1
|
||||
}
|
||||
|
||||
|
@ -249,7 +249,6 @@ class CircleROITool extends cornerstoneTools.CircleROITool {
|
|||
modalityUnitOptions
|
||||
)
|
||||
} else if (annotation.invalidated) {
|
||||
|
||||
this._throttledCalculateCachedStats(
|
||||
annotation,
|
||||
viewport,
|
||||
|
@ -430,74 +429,74 @@ class CircleROITool extends cornerstoneTools.CircleROITool {
|
|||
) => {
|
||||
const data = annotation.data
|
||||
const { viewportId, renderingEngineId } = enabledElement
|
||||
|
||||
|
||||
const { points } = data.handles
|
||||
|
||||
|
||||
const canvasCoordinates = points.map((p) => viewport.worldToCanvas(p))
|
||||
const { viewPlaneNormal, viewUp } = viewport.getCamera()
|
||||
|
||||
|
||||
const [topLeftCanvas, bottomRightCanvas] = (
|
||||
getCanvasCircleCorners(canvasCoordinates)
|
||||
)
|
||||
|
||||
|
||||
const topLeftWorld = viewport.canvasToWorld(topLeftCanvas)
|
||||
const bottomRightWorld = viewport.canvasToWorld(bottomRightCanvas)
|
||||
const { cachedStats } = data
|
||||
|
||||
|
||||
const targetIds = Object.keys(cachedStats)
|
||||
const worldPos1 = topLeftWorld
|
||||
const worldPos2 = bottomRightWorld
|
||||
for (let i = 0; i < targetIds.length; i++) {
|
||||
const targetId = targetIds[i]
|
||||
|
||||
|
||||
const image = this.getTargetIdImage(targetId, renderingEngine)
|
||||
|
||||
|
||||
// If image does not exists for the targetId, skip. This can be due
|
||||
// to various reasons such as if the target was a volumeViewport, and
|
||||
// the volumeViewport has been decached in the meantime.
|
||||
if (!image) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
const { dimensions, imageData, metadata } = image
|
||||
|
||||
|
||||
const worldPos1Index = transformWorldToIndex(imageData, worldPos1)
|
||||
|
||||
|
||||
worldPos1Index[0] = Math.floor(worldPos1Index[0])
|
||||
worldPos1Index[1] = Math.floor(worldPos1Index[1])
|
||||
worldPos1Index[2] = Math.floor(worldPos1Index[2])
|
||||
|
||||
|
||||
const worldPos2Index = transformWorldToIndex(imageData, worldPos2)
|
||||
|
||||
|
||||
worldPos2Index[0] = Math.floor(worldPos2Index[0])
|
||||
worldPos2Index[1] = Math.floor(worldPos2Index[1])
|
||||
worldPos2Index[2] = Math.floor(worldPos2Index[2])
|
||||
|
||||
|
||||
// Check if one of the indexes are inside the volume, this then gives us
|
||||
// Some area to do stats over.
|
||||
|
||||
|
||||
if (this._isInsideVolume(worldPos1Index, worldPos2Index, dimensions)) {
|
||||
const iMin = Math.min(worldPos1Index[0], worldPos2Index[0])
|
||||
const iMax = Math.max(worldPos1Index[0], worldPos2Index[0])
|
||||
|
||||
|
||||
const jMin = Math.min(worldPos1Index[1], worldPos2Index[1])
|
||||
const jMax = Math.max(worldPos1Index[1], worldPos2Index[1])
|
||||
|
||||
|
||||
const kMin = Math.min(worldPos1Index[2], worldPos2Index[2])
|
||||
const kMax = Math.max(worldPos1Index[2], worldPos2Index[2])
|
||||
|
||||
|
||||
const boundsIJK = [
|
||||
[iMin, iMax],
|
||||
[jMin, jMax],
|
||||
[kMin, kMax]
|
||||
]
|
||||
|
||||
|
||||
const center = [
|
||||
(topLeftWorld[0] + bottomRightWorld[0]) / 2,
|
||||
(topLeftWorld[1] + bottomRightWorld[1]) / 2,
|
||||
(topLeftWorld[2] + bottomRightWorld[2]) / 2
|
||||
]
|
||||
|
||||
|
||||
const ellipseObj = {
|
||||
center,
|
||||
xRadius: Math.abs(topLeftWorld[0] - bottomRightWorld[0]) / 2,
|
||||
|
@ -518,7 +517,7 @@ class CircleROITool extends cornerstoneTools.CircleROITool {
|
|||
(worldWidth / scale / 2) *
|
||||
(worldHeight / aspect / scale / 2)
|
||||
)
|
||||
|
||||
|
||||
const modalityUnit = getModalityUnit(
|
||||
metadata.Modality,
|
||||
annotation.metadata.referencedImageId,
|
||||
|
@ -530,9 +529,9 @@ class CircleROITool extends cornerstoneTools.CircleROITool {
|
|||
this.configuration.statsCalculator.statsCallback,
|
||||
boundsIJK
|
||||
)
|
||||
|
||||
|
||||
const stats = this.configuration.statsCalculator.getStatistics()
|
||||
|
||||
|
||||
cachedStats[targetId] = {
|
||||
Modality: metadata.Modality,
|
||||
area,
|
||||
|
@ -551,7 +550,7 @@ class CircleROITool extends cornerstoneTools.CircleROITool {
|
|||
annotation.isHandleOutsideImage = false
|
||||
} else {
|
||||
this.isHandleOutsideImage = true
|
||||
|
||||
|
||||
cachedStats[targetId] = {
|
||||
Modality: metadata.Modality,
|
||||
areaUnit: getCalibratedAreaUnits(null, image)
|
||||
|
@ -559,19 +558,19 @@ class CircleROITool extends cornerstoneTools.CircleROITool {
|
|||
annotation.isHandleOutsideImage = true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
annotation.invalidated = false
|
||||
|
||||
|
||||
// Dispatching annotation modified
|
||||
const eventType = Enums.Events.ANNOTATION_MODIFIED
|
||||
|
||||
|
||||
const eventDetail = {
|
||||
annotation,
|
||||
viewportId,
|
||||
renderingEngineId
|
||||
}
|
||||
triggerEvent(eventTarget, eventType, eventDetail)
|
||||
|
||||
|
||||
return cachedStats
|
||||
}
|
||||
}
|
||||
|
|
|
@ -450,13 +450,15 @@ export default {
|
|||
const lesionState = !isNaN(parseInt(this.getQuestionVal(7))) ? parseInt(this.getQuestionVal(7)) : ''
|
||||
this.$emit('resetQuestions', { isLymphLesion, lesionPart, lesionOrgan, lesionShort, lesionState, saveTypeEnum: this.questionForm.saveTypeEnum, lesionLength, rowIndex: this.rowIndex, questionId: this.parentQsId, anwsers: this.questionForm })
|
||||
}
|
||||
if (this.lesionType === 0 && params && params.splitLesionTargetPPD) {
|
||||
if (this.lesionType === 0 && params) {
|
||||
// ppd
|
||||
|
||||
var ppd = this.getQuestionVal(12)
|
||||
ppd = isNaN(parseFloat(ppd)) ? 0 : parseFloat(ppd)
|
||||
|
||||
this.splitLesionTargetPDD = ppd + params.splitLesionTargetPPD
|
||||
this.splitLesionTargetLDi = params.splitLesionTargetLDi
|
||||
this.splitLesionTargetSDi = params.splitLesionTargetSDi
|
||||
}
|
||||
|
||||
// 如果当前病灶状态为“疾病进展”,且满足疾病进展的条件,则状态不允许更改
|
||||
|
@ -464,9 +466,6 @@ export default {
|
|||
state = isNaN(parseInt(state)) ? 0 : parseInt(state)
|
||||
var ldi = this.getQuestionVal(0)// 长径
|
||||
ldi = isNaN(parseFloat(ldi)) ? 0 : ldi
|
||||
if (this.lesionType === 0 && params && params.splitLesionTargetLDi) {
|
||||
this.splitLesionTargetLDi = ldi + params.splitLesionTargetLDi
|
||||
}
|
||||
var pddIncrease = this.getQuestionVal(17) // 相比最低点PPD增加百分比
|
||||
pddIncrease = isNaN(parseFloat(pddIncrease)) ? 0 : parseFloat(pddIncrease)
|
||||
var ldiIncrease = this.getQuestionVal(18)// 相比PPD最低点LDi增加值
|
||||
|
@ -490,10 +489,17 @@ export default {
|
|||
var minPPD = this.getQuestionVal(13)
|
||||
minPPD = parseFloat(minPPD)
|
||||
pddIncrease = ((((this.splitLesionTargetPDD - minPPD) / minPPD)) * 100).toFixed(this.digitPlaces)
|
||||
ldi = this.splitLesionTargetLDi + ldi
|
||||
var minLDi = this.getQuestionVal(15)
|
||||
ldiIncrease = ldi - minLDi
|
||||
var sdi = this.getQuestionVal(1)// 短径
|
||||
sdi = isNaN(parseFloat(sdi)) ? 0 : sdi
|
||||
sdi = this.splitLesionTargetSDi + sdi
|
||||
var minSDi = this.getQuestionVal(16)
|
||||
sdiIncrease = sdi - minSDi
|
||||
}
|
||||
if (this.splitLesionTargetPDD) {
|
||||
ldi = this.splitLesionTargetLDi
|
||||
}
|
||||
// if(this.)
|
||||
|
||||
/** 疾病进展
|
||||
* 15mm<当前靶病灶LDi≤20mm
|
||||
* 相比最低点PPD增加百分比 ≥50%
|
||||
|
@ -983,6 +989,10 @@ export default {
|
|||
var pddIncreaseNum = null
|
||||
if (this.splitLesionTargetPDD) {
|
||||
pddIncreaseNum = ((((this.splitLesionTargetPDD - minPPD) / minPPD)) * 100).toFixed(this.digitPlaces)
|
||||
ldi = this.splitLesionTargetLDi + ldi
|
||||
ldiIncrease = ldi - minLDi
|
||||
sdi = this.splitLesionTargetSDi + sdi
|
||||
sdiIncrease = sdi - minSDi
|
||||
} else {
|
||||
pddIncreaseNum = ((((ppd - minPPD) / minPPD)) * 100).toFixed(this.digitPlaces)
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ export default {
|
|||
spleenInfo: null,
|
||||
calculateSpleenStatus: '',
|
||||
formChanged: false,
|
||||
digitPlaces:null
|
||||
digitPlaces: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
|
Loading…
Reference in New Issue