非dicom角度工具添加注释
continuous-integration/drone/push Build is passing Details

main
wangxiaoshuang 2025-10-29 16:04:08 +08:00
parent fe0ba42736
commit 5394a2cde5
1 changed files with 23 additions and 1 deletions

View File

@ -574,7 +574,10 @@ export default {
cachedStats: false, cachedStats: false,
getTextLines: this.getCircleROIToolTextLines getTextLines: this.getCircleROIToolTextLines
}) })
toolGroup.addTool(AngleTool.toolName) toolGroup.addTool(AngleTool.toolName, {
cachedStats: false,
getTextLines: this.getAngleToolTextLines
})
toolGroup.addTool(PlanarFreehandROITool.toolName, { toolGroup.addTool(PlanarFreehandROITool.toolName, {
allowOpenContours: false, allowOpenContours: false,
cachedStats: false, cachedStats: false,
@ -1541,6 +1544,25 @@ export default {
} }
return textLines return textLines
}, },
//
getAngleToolTextLines(data, targetId) {
const cachedVolumeStats = data.cachedStats[targetId]
const { label } = data
const { angle } = cachedVolumeStats
if (angle === undefined) {
return
}
if (isNaN(angle)) {
return [`${angle}`]
}
const textLines = []
if (label) {
textLines.push(label)
}
textLines.push(`${angle.toFixed(this.digitPlaces)} ${String.fromCharCode(176)}`)
return textLines
},
reRound(result, finalPrecision) { reRound(result, finalPrecision) {
if (typeof result === 'string' && result.includes(', ')) { if (typeof result === 'string' && result.includes(', ')) {
const numStrs = result.split(', ') const numStrs = result.split(', ')