添加自定义MIPJumpToClickTool工具
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
52ab454860
commit
0e252b0377
|
|
@ -584,6 +584,7 @@ import CircleROITool from './tools/CircleROITool'
|
|||
import ScaleOverlayTool from './tools/ScaleOverlayTool'
|
||||
import SegmentBidirectionalTool from './tools/SegmentBidirectionalTool'
|
||||
import FusionJumpToPointTool from './tools/FusionJumpToPointTool'
|
||||
import MIPJumpToClickTool from './tools/MIPJumpToClickTool'
|
||||
import { setPTClinicalDataForInstance, clearPTClinicalDataCache } from '@/utils/ptClinicalDataCache'
|
||||
import FixedRadiusCircleROITool from './tools/FixedRadiusCircleROITool'
|
||||
import uploadDicomAndNonedicom from '@/components/uploadDicomAndNonedicom'
|
||||
|
|
@ -621,7 +622,6 @@ const {
|
|||
VolumeRotateTool,
|
||||
CrosshairsTool,
|
||||
EllipticalROITool,
|
||||
MIPJumpToClickTool,
|
||||
synchronizers,
|
||||
LabelMapEditWithContourTool,
|
||||
BrushTool,
|
||||
|
|
@ -1729,6 +1729,7 @@ export default {
|
|||
toolGroup.addTool(VolumeRotateTool.toolName)
|
||||
toolGroup.addTool(MIPJumpToClickTool.toolName, {
|
||||
targetViewportIds: ['viewport-fusion-0', 'viewport-fusion-1', 'viewport-fusion-2', 'viewport-fusion-3', 'viewport-fusion-hidden-sag'],
|
||||
sourceViewportIds: ['viewport-fusion-3'],
|
||||
})
|
||||
toolGroup.addTool(FusionJumpToPointTool.toolName, {
|
||||
targetViewportIds: ['viewport-fusion-0', 'viewport-fusion-1', 'viewport-fusion-2', 'viewport-fusion-3', 'viewport-fusion-hidden-sag'],
|
||||
|
|
@ -2521,6 +2522,10 @@ export default {
|
|||
textLines.push(areaLine)
|
||||
}
|
||||
|
||||
if (total !== undefined && total !== null && Modality === 'NM') {
|
||||
textLines.push(`Total: ${this.formatStatSum(total)}`)
|
||||
}
|
||||
|
||||
if (mean) {
|
||||
textLines.push(`Mean: ${this.reRound(mean, this.digitPlaces)} ${modalityUnit}`)
|
||||
}
|
||||
|
|
@ -2533,10 +2538,6 @@ export default {
|
|||
textLines.push(`Std Dev: ${this.reRound(stdDev, this.digitPlaces)} ${modalityUnit}`)
|
||||
}
|
||||
|
||||
if (total !== undefined && total !== null && Modality === 'NM') {
|
||||
textLines.push(`Total: ${this.formatStatSum(total)}`)
|
||||
}
|
||||
|
||||
return textLines
|
||||
},
|
||||
getEllipticalROIToolTextLines(data, targetId) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
import { getEnabledElement } from '@cornerstonejs/core'
|
||||
import * as cornerstoneTools from '@cornerstonejs/tools'
|
||||
|
||||
|
||||
class MIPJumpToClickTool extends cornerstoneTools.MIPJumpToClickTool {
|
||||
static toolName = 'MIPJumpToClickTool'
|
||||
|
||||
constructor(toolProps = {}, defaultToolProps) {
|
||||
const mergedDefaultToolProps = defaultToolProps || {
|
||||
supportedInteractionTypes: ['Mouse', 'Touch'],
|
||||
configuration: {
|
||||
targetViewportIds: [],
|
||||
sourceViewportIds: [],
|
||||
},
|
||||
}
|
||||
|
||||
super(toolProps, mergedDefaultToolProps)
|
||||
}
|
||||
|
||||
mouseClickCallback(evt) {
|
||||
const { element, viewportId } = evt.detail || {}
|
||||
const enabledElement = element ? getEnabledElement(element) : null
|
||||
const sourceViewportId = viewportId || enabledElement?.viewport?.id || ''
|
||||
const sourceViewportIds = this.configuration?.sourceViewportIds
|
||||
const hasSourceLimit = Array.isArray(sourceViewportIds) && sourceViewportIds.length > 0
|
||||
if (hasSourceLimit && !sourceViewportIds.includes(sourceViewportId)) {
|
||||
return
|
||||
}
|
||||
|
||||
return super.mouseClickCallback(evt)
|
||||
}
|
||||
}
|
||||
|
||||
export default MIPJumpToClickTool
|
||||
Loading…
Reference in New Issue