From d1c62bcfc87c93410856afbb25b435a639b2defc Mon Sep 17 00:00:00 2001 From: Pedro Kohler Date: Thu, 17 Apr 2025 16:11:15 -0300 Subject: [PATCH] feat: add text box group to TID300 measurements --- src/utilities/TID300/TID300Measurement.js | 34 ++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/src/utilities/TID300/TID300Measurement.js b/src/utilities/TID300/TID300Measurement.js index e5d98391..d0b6e2f5 100644 --- a/src/utilities/TID300/TID300Measurement.js +++ b/src/utilities/TID300/TID300Measurement.js @@ -12,10 +12,42 @@ export default class TID300Measurement { ...this.getTrackingGroups(), ...this.getFindingGroup(), ...this.getFindingSiteGroups(), - ...contentSequenceEntries + ...contentSequenceEntries, + ...this.getTextBoxGroups() ]; } + getTextBoxGroups() { + const { textBoxPoint } = this.props; + + if ( + !textBoxPoint || + typeof textBoxPoint.x !== "number" || + typeof textBoxPoint.y !== "number" + ) { + return []; + } + + const textBoxSequence = { + RelationshipType: "CONTAINS", + ValueType: "SCOORD", + ConceptNameCodeSequence: { + CodeValue: "111030", + CodingSchemeDesignator: "DCM", + CodeMeaning: "Annotation Position" + }, + GraphicType: "POINT", + GraphicData: [textBoxPoint.x, textBoxPoint.y], + ContentSequence: { + RelationshipType: "SELECTED FROM", + ValueType: "IMAGE", + ReferencedSOPSequence: this.ReferencedSOPSequence + } + }; + + return [textBoxSequence]; + } + getTrackingGroups() { let { trackingIdentifierTextValue } = this.props;