Skip to content

Commit

Permalink
Update polyline tid300 to include new values
Browse files Browse the repository at this point in the history
  • Loading branch information
igoroctaviano committed Mar 18, 2024
1 parent 76ca6f5 commit 6465412
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 3 deletions.
88 changes: 86 additions & 2 deletions src/utilities/TID300/Polyline.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 9 additions & 1 deletion src/utilities/TID300/unit2CodingValue.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,22 @@ const NO_UNIT = {
CodeMeaning: "px"
};

const HU_UNIT = {
CodeValue: "HU",
CodingSchemeDesignator: "UCUM",
CodingSchemeVersion: "1.4",
CodeMeaning: "HU"
};

const NO2_UNIT = NO_UNIT;

const measurementMap = {
px: NO_UNIT,
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
Expand Down

0 comments on commit 6465412

Please sign in to comment.