diff --git a/src/utilities/TID300/Polyline.js b/src/utilities/TID300/Polyline.js index 023ce2d2..3674321b 100644 --- a/src/utilities/TID300/Polyline.js +++ b/src/utilities/TID300/Polyline.js @@ -31,13 +31,97 @@ export default class Polyline extends TID300Measurement { ReferencedSOPSequence, use3DSpatialCoordinates = false, perimeter, - unit = "mm" + unit = "mm", + stdDev, + mean, + max, + modalityUnit } = this.props; const GraphicData = expandPoints(points); - // TODO: Add Mean and STDev value of (modality?) pixels return this.getMeasurement([ + { + RelationshipType: "CONTAINS", + ValueType: "NUM", + ConceptNameCodeSequence: { + CodeValue: "56851009", + CodingSchemeDesignator: "SCT", + CodeMeaning: "Maximum" + }, + MeasuredValueSequence: { + MeasurementUnitsCodeSequence: + unit2CodingValue(modalityUnit), + NumericValue: max + }, + ContentSequence: { + RelationshipType: "INFERRED FROM", + ValueType: use3DSpatialCoordinates ? "SCOORD3D" : "SCOORD", + GraphicType: "POLYLINE", + GraphicData, + ContentSequence: use3DSpatialCoordinates + ? undefined + : { + RelationshipType: "SELECTED FROM", + ValueType: "IMAGE", + ReferencedSOPSequence + } + } + }, + { + RelationshipType: "CONTAINS", + ValueType: "NUM", + ConceptNameCodeSequence: { + CodeValue: "386136009", + CodingSchemeDesignator: "SCT", + CodeMeaning: "Standard Deviation" + }, + MeasuredValueSequence: { + MeasurementUnitsCodeSequence: + unit2CodingValue(modalityUnit), + NumericValue: stdDev + }, + ContentSequence: { + RelationshipType: "INFERRED FROM", + ValueType: use3DSpatialCoordinates ? "SCOORD3D" : "SCOORD", + GraphicType: "POLYLINE", + GraphicData, + ContentSequence: use3DSpatialCoordinates + ? undefined + : { + RelationshipType: "SELECTED FROM", + ValueType: "IMAGE", + ReferencedSOPSequence + } + } + }, + { + RelationshipType: "CONTAINS", + ValueType: "NUM", + ConceptNameCodeSequence: { + CodeValue: "373098007", + CodingSchemeDesignator: "SCT", + CodeMeaning: "Mean" + }, + MeasuredValueSequence: { + MeasurementUnitsCodeSequence: + unit2CodingValue(modalityUnit), + NumericValue: mean + }, + ContentSequence: { + RelationshipType: "INFERRED FROM", + ValueType: use3DSpatialCoordinates ? "SCOORD3D" : "SCOORD", + GraphicType: "POLYLINE", + GraphicData, + ContentSequence: use3DSpatialCoordinates + ? undefined + : { + RelationshipType: "SELECTED FROM", + ValueType: "IMAGE", + ReferencedSOPSequence + } + } + }, { RelationshipType: "CONTAINS", ValueType: "NUM", diff --git a/src/utilities/TID300/unit2CodingValue.js b/src/utilities/TID300/unit2CodingValue.js index 54de41ce..d717e384 100644 --- a/src/utilities/TID300/unit2CodingValue.js +++ b/src/utilities/TID300/unit2CodingValue.js @@ -21,6 +21,13 @@ const NO_UNIT = { CodeMeaning: "px" }; +const HU_UNIT = { + CodeValue: "HU", + CodingSchemeDesignator: "UCUM", + CodingSchemeVersion: "1.4", + CodeMeaning: "HU" +}; + const NO2_UNIT = NO_UNIT; const measurementMap = { @@ -28,7 +35,8 @@ const measurementMap = { mm: MM_UNIT, mm2: MM2_UNIT, "mm\xB2": MM2_UNIT, - "px\xB2": NO2_UNIT + "px\xB2": NO2_UNIT, + HU: HU_UNIT }; /** Converts the given unit into the