diff --git a/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue b/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue index b48dc850..9eba66c0 100644 --- a/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue +++ b/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue @@ -596,6 +596,8 @@ const { // RectangleROITool, PlanarFreehandROITool, CircleROITool, + AngleTool, + CobbAngleTool, EraserTool, MIPJumpToClickTool, VolumeRotateTool, @@ -1136,6 +1138,8 @@ export default { cornerstoneTools.addTool(BidirectionalTool) cornerstoneTools.addTool(ScaleOverlayTool) cornerstoneTools.addTool(CircleROITool) + cornerstoneTools.addTool(AngleTool) + cornerstoneTools.addTool(CobbAngleTool) cornerstoneTools.addTool(MIPJumpToClickTool) cornerstoneTools.addTool(VolumeRotateTool) @@ -1183,6 +1187,12 @@ export default { toolGroup.addTool(CircleROITool.toolName, { getTextLines: this.getCircleROIToolTextLines }) + toolGroup.addTool(AngleTool.toolName, { + getTextLines: this.getAngleToolTextLines + }) + toolGroup.addTool(CobbAngleTool.toolName, { + getTextLines: this.getCobbAngleToolTextLines + }) if (toolGroupId === 'viewport-fusion-3') { toolGroup.addTool(VolumeRotateTool.toolName) toolGroup.setToolActive(VolumeRotateTool.toolName, { @@ -1229,6 +1239,8 @@ export default { toolGroup.setToolPassive(LengthTool.toolName) toolGroup.setToolPassive(BidirectionalTool.toolName) toolGroup.setToolPassive(CircleROITool.toolName) + toolGroup.setToolPassive(AngleTool.toolName) + toolGroup.setToolPassive(CobbAngleTool.toolName) } else { toolGroup.setToolEnabled(ArrowAnnotateTool.toolName) toolGroup.setToolEnabled(RectangleROITool.toolName) @@ -1236,6 +1248,8 @@ export default { toolGroup.setToolEnabled(LengthTool.toolName) toolGroup.setToolEnabled(BidirectionalTool.toolName) toolGroup.setToolEnabled(CircleROITool.toolName) + toolGroup.setToolEnabled(AngleTool.toolName) + toolGroup.setToolEnabled(CobbAngleTool.toolName) } toolGroup.setToolPassive(EraserTool.toolName) }) @@ -1666,7 +1680,6 @@ export default { } const textLines = [] if (data.label) { - // textLines.push(data.label) textLines.push(data.status ? `${data.label}(${data.status})` : data.label) } textLines.push(`${parseFloat(length).toFixed(this.digitPlaces)} ${unit}`) @@ -1688,7 +1701,9 @@ export default { } = cachedVolumeStats || {} const textLines = [] - + if (data.label) { + textLines.push(data.label) + } if (area) { const areaLine = isEmptyArea ? `Area: Oblique not supported` @@ -1743,6 +1758,9 @@ export default { } const textLines = [] + if (data.label) { + textLines.push(data.label) + } textLines.push(`Area: ${this.reRound(area, this.digitPlaces)} ${areaUnit}`) textLines.push(`Mean: ${this.reRound(mean, this.digitPlaces)} ${modalityUnit}`) @@ -1756,11 +1774,8 @@ export default { const { length, width, unit } = cachedStats[targetId] const textLines = [] - // if (label) { - // textLines.push(label); - // } + if (label) { - // textLines.push(label) textLines.push(data.status ? `${label}(${data.status})` : label) } if (length === undefined) { @@ -1790,7 +1805,7 @@ export default { const textLines = [] if (data.label) { // textLines.push(data.label) - textLines.push(data.status ? `${data.label}(${data.status})` : data.label) + textLines.push(data.label) } if (radius) { @@ -1821,8 +1836,40 @@ export default { return textLines }, + getAngleToolTextLines(data, targetId) { + const cachedVolumeStats = data.cachedStats[targetId] + 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 + }, + getCobbAngleToolTextLines(data, targetId) { + const cachedVolumeStats = data.cachedStats[targetId] + const { angle } = cachedVolumeStats + + if (angle === undefined) { + return + } + const textLines = [] + if (label) { + textLines.push(label) + } + textLines.push(`${angle.toFixed(this.digitPlaces)} ${String.fromCharCode(176)}`) + + return textLines + }, reRound(result, finalPrecision) { - if (result.includes(', ')) { + if (typeof result === 'string' && result.includes(', ')) { const numStrs = result.split(', ') const processed = numStrs.map(str => this.processSingle(str, finalPrecision)) return processed.join(', ') diff --git a/src/views/trials/trials-panel/reading/dicoms3D/components/customize/QuestionFormItem.vue b/src/views/trials/trials-panel/reading/dicoms3D/components/customize/QuestionFormItem.vue index 586c878e..fb4cf890 100644 --- a/src/views/trials/trials-panel/reading/dicoms3D/components/customize/QuestionFormItem.vue +++ b/src/views/trials/trials-panel/reading/dicoms3D/components/customize/QuestionFormItem.vue @@ -232,9 +232,9 @@