非DICOM阅片工具支持测量与标注
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
1586643fc2
commit
f997cec4fb
|
|
@ -313,6 +313,15 @@ const config = {
|
||||||
'isDisabled': false,
|
'isDisabled': false,
|
||||||
'disabledReason': ''
|
'disabledReason': ''
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'name': '长短径测量工具',
|
||||||
|
'icon': 'bidirection',
|
||||||
|
'toolName': 'Bidirectional',
|
||||||
|
'props': ['length', 'width'],
|
||||||
|
'i18nKey': 'trials:reading:button:bidirectional',
|
||||||
|
'isDisabled': false,
|
||||||
|
'disabledReason': ''
|
||||||
|
},
|
||||||
{
|
{
|
||||||
'name': '矩形工具',
|
'name': '矩形工具',
|
||||||
'icon': 'rectangle',
|
'icon': 'rectangle',
|
||||||
|
|
@ -322,15 +331,6 @@ const config = {
|
||||||
'isDisabled': false,
|
'isDisabled': false,
|
||||||
'disabledReason': ''
|
'disabledReason': ''
|
||||||
},
|
},
|
||||||
{
|
|
||||||
'name': '箭头工具',
|
|
||||||
'icon': 'arrow',
|
|
||||||
'toolName': 'ArrowAnnotate',
|
|
||||||
'props': [],
|
|
||||||
'i18nKey': 'trials:reading:button:arrowAnnotate',
|
|
||||||
'isDisabled': false,
|
|
||||||
'disabledReason': ''
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
'name': '圆形工具',
|
'name': '圆形工具',
|
||||||
'icon': 'oval',
|
'icon': 'oval',
|
||||||
|
|
@ -349,6 +349,15 @@ const config = {
|
||||||
'isDisabled': false,
|
'isDisabled': false,
|
||||||
'disabledReason': ''
|
'disabledReason': ''
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'name': '自由曲线',
|
||||||
|
'icon': 'polygon',
|
||||||
|
'toolName': 'PlanarFreehandROI',
|
||||||
|
'props': ['area', 'mean', 'max', 'stdDev', 'perimeter'],
|
||||||
|
'i18nKey': 'trials:reading:button:planarFreehandROI',
|
||||||
|
'isDisabled': false,
|
||||||
|
'disabledReason': ''
|
||||||
|
},
|
||||||
{
|
{
|
||||||
'name': '角度工具',
|
'name': '角度工具',
|
||||||
'icon': 'angle',
|
'icon': 'angle',
|
||||||
|
|
@ -359,11 +368,11 @@ const config = {
|
||||||
'disabledReason': ''
|
'disabledReason': ''
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'name': '自由曲线',
|
'name': '箭头工具',
|
||||||
'icon': 'polygon',
|
'icon': 'arrow',
|
||||||
'toolName': 'PlanarFreehandROI',
|
'toolName': 'ArrowAnnotate',
|
||||||
'props': ['area', 'mean', 'max', 'stdDev', 'perimeter'],
|
'props': [],
|
||||||
'i18nKey': 'trials:reading:button:planarFreehandROI',
|
'i18nKey': 'trials:reading:button:arrowAnnotate',
|
||||||
'isDisabled': false,
|
'isDisabled': false,
|
||||||
'disabledReason': ''
|
'disabledReason': ''
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -308,7 +308,8 @@ const {
|
||||||
LengthTool,
|
LengthTool,
|
||||||
EllipticalROITool,
|
EllipticalROITool,
|
||||||
CircleROITool,
|
CircleROITool,
|
||||||
AngleTool
|
AngleTool,
|
||||||
|
BidirectionalTool,
|
||||||
// cursors
|
// cursors
|
||||||
} = cornerstoneTools
|
} = cornerstoneTools
|
||||||
const { MouseBindings, Events: toolsEvents } = csToolsEnums
|
const { MouseBindings, Events: toolsEvents } = csToolsEnums
|
||||||
|
|
@ -607,7 +608,7 @@ export default {
|
||||||
cornerstoneTools.addTool(EraserTool)
|
cornerstoneTools.addTool(EraserTool)
|
||||||
cornerstoneTools.addTool(LengthTool)
|
cornerstoneTools.addTool(LengthTool)
|
||||||
cornerstoneTools.addTool(LengthscaleTool)
|
cornerstoneTools.addTool(LengthscaleTool)
|
||||||
|
cornerstoneTools.addTool(BidirectionalTool)
|
||||||
viewportIds.forEach((viewportId, i) => {
|
viewportIds.forEach((viewportId, i) => {
|
||||||
const toolGroupId = `canvas-${i}`
|
const toolGroupId = `canvas-${i}`
|
||||||
const toolGroup = ToolGroupManager.createToolGroup(toolGroupId)
|
const toolGroup = ToolGroupManager.createToolGroup(toolGroupId)
|
||||||
|
|
@ -635,6 +636,10 @@ export default {
|
||||||
cachedStats: false,
|
cachedStats: false,
|
||||||
getTextLines: this.getRectangleROIToolTextLines
|
getTextLines: this.getRectangleROIToolTextLines
|
||||||
})
|
})
|
||||||
|
toolGroup.addTool(BidirectionalTool.toolName, {
|
||||||
|
// cachedStats: true
|
||||||
|
getTextLines: this.getBidirectionalToolTextLines
|
||||||
|
})
|
||||||
toolGroup.addTool(EllipticalROITool.toolName, {
|
toolGroup.addTool(EllipticalROITool.toolName, {
|
||||||
cachedStats: false,
|
cachedStats: false,
|
||||||
getTextLines: this.getEllipticalROIToolTextLines
|
getTextLines: this.getEllipticalROIToolTextLines
|
||||||
|
|
@ -684,6 +689,7 @@ export default {
|
||||||
toolGroup.setToolPassive(SplineROITool.toolName)
|
toolGroup.setToolPassive(SplineROITool.toolName)
|
||||||
toolGroup.setToolPassive(LengthTool.toolName)
|
toolGroup.setToolPassive(LengthTool.toolName)
|
||||||
toolGroup.setToolPassive(LengthscaleTool.toolName)
|
toolGroup.setToolPassive(LengthscaleTool.toolName)
|
||||||
|
toolGroup.setToolPassive(BidirectionalTool.toolName)
|
||||||
} else {
|
} else {
|
||||||
toolGroup.setToolEnabled(ArrowAnnotateTool.toolName)
|
toolGroup.setToolEnabled(ArrowAnnotateTool.toolName)
|
||||||
toolGroup.setToolEnabled(RectangleROITool.toolName)
|
toolGroup.setToolEnabled(RectangleROITool.toolName)
|
||||||
|
|
@ -694,6 +700,7 @@ export default {
|
||||||
toolGroup.setToolEnabled(SplineROITool.toolName)
|
toolGroup.setToolEnabled(SplineROITool.toolName)
|
||||||
toolGroup.setToolEnabled(LengthTool.toolName)
|
toolGroup.setToolEnabled(LengthTool.toolName)
|
||||||
toolGroup.setToolEnabled(LengthscaleTool.toolName)
|
toolGroup.setToolEnabled(LengthscaleTool.toolName)
|
||||||
|
toolGroup.setToolEnabled(BidirectionalTool.toolName)
|
||||||
}
|
}
|
||||||
toolGroup.setToolPassive(EraserTool.toolName)
|
toolGroup.setToolPassive(EraserTool.toolName)
|
||||||
})
|
})
|
||||||
|
|
@ -1430,6 +1437,38 @@ export default {
|
||||||
}
|
}
|
||||||
return textLines
|
return textLines
|
||||||
},
|
},
|
||||||
|
// 长短径工具注释
|
||||||
|
getBidirectionalToolTextLines(data, targetId) {
|
||||||
|
const { cachedStats, label } = data
|
||||||
|
const { length, width, unit } = cachedStats[targetId]
|
||||||
|
let ps = null
|
||||||
|
const path = targetId.split(`web:${this.OSSclientConfig.basePath}`)[1]
|
||||||
|
const i = this.psArr.findIndex(i => i.Path === path)
|
||||||
|
if (i > -1 && this.psArr[i].PS) {
|
||||||
|
ps = parseFloat(this.psArr[i].PS).toFixed(3)
|
||||||
|
}
|
||||||
|
const textLines = []
|
||||||
|
if (label) {
|
||||||
|
textLines.push(data.status ? `${label}(${data.status})` : label)
|
||||||
|
}
|
||||||
|
if (length === undefined) {
|
||||||
|
return textLines
|
||||||
|
}
|
||||||
|
if (ps) {
|
||||||
|
textLines.push(
|
||||||
|
`L: ${this.reRound(csUtils.roundNumber(length * ps), this.digitPlaces)} mm`,
|
||||||
|
`S: ${this.reRound(csUtils.roundNumber(width * ps), this.digitPlaces)} mm`
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
textLines.push(
|
||||||
|
`L: ${this.reRound(csUtils.roundNumber(length), this.digitPlaces)} ${unit || unit}`,
|
||||||
|
`S: ${this.reRound(csUtils.roundNumber(length), this.digitPlaces)} ${unit}`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return textLines
|
||||||
|
},
|
||||||
// 直线工具注释
|
// 直线工具注释
|
||||||
getLengthToolTextLines(data, targetId) {
|
getLengthToolTextLines(data, targetId) {
|
||||||
const cachedVolumeStats = data.cachedStats[targetId]
|
const cachedVolumeStats = data.cachedStats[targetId]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue