Repository navigation
fix(sr): map cm and cm² to the UCUM units in unit2CodingValue (port of #506) - #683
Merged
Merged
Conversation
A length in centimetres, the usual unit of an ultrasound image that is
calibrated through SequenceOfUltrasoundRegions (PhysicalUnitsXDirection
3), had no entry in knownUnits. The SR then stored the arbitrary unit
[arb'U]{cm} ("arbitrary cm"). Fixes #505.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
✅ Deploy Preview for dcmjs2 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…683) - unit2CodingValue: "cm²" maps to the existing UCUM "cm2" entry, as "mm²" maps to "mm2". Cornerstone3D labels a calibrated ultrasound area "cm² US Region", which became an arbitrary unit (review Q2). - test/issues/issue505-unit2codingvalue.test.js: the skipped "cm" case runs, with cases for "cm US Region", "cm²" and "cm² US Region". The catalog marks #505 green. The separate test/unit2CodingValue.test.js of #506 is not needed on main (review S1, Q3). Co-Authored-By: Claude Opus 5.5 <[email protected]>
wayfarer3130
marked this pull request as ready for review
November 28, 2026 00:43
This was referenced Nov 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR ports #506 by @afip94 to
main.unit2CodingValuehad no entry forcm. A length in centimetres then became the arbitrary unit[arb'U]{cm}("arbitrary cm") in the stored SR. Centimetres are the usual unit of an ultrasound image that is calibrated throughSequenceOfUltrasoundRegions(PhysicalUnitsXDirection3). Fixes #505.The PR also maps
cm²to the existing UCUM unitcm2, asmm²maps tomm2. Cornerstone3D labels a calibrated ultrasound areacm² US Region, and that label also became an arbitrary unit. #506 has the same change.The first commit keeps the original author.
Changes
src/utilities/TID300/unit2CodingValue.js:knownUnitshas the UCUM unitcm(from fix(sr): map cm and cm² to the UCUM units in unit2CodingValue #506).unitCodeMap["cm²"]is the existingcm2entry.test/issues/issue505-unit2codingvalue.test.js: the skippedcmtest runs now. New cases:cm US Regiongivescm, andcm²andcm² US Regiongivecm2.test/issues/catalog.json: the status of unit2CodingValue has no entry for "cm" — centimetre measurements become [arb'U]{cm} #505 changes fromgaptogreen.#506 adds the test file
test/unit2CodingValue.test.json0.x.mainalready has the regression test of #505 intest/issues/, so this PR uses that test and does not add the second file.Change that users can see
An SR measurement in
cmnow has the codecm(UCUM 1.4), not[arb'U]{cm}. An area incm²now has the codecm2, not[arb'U]{cm²}. Other units do not change.Tests
cm²line, the 2cm²cases fail. Without thecmentry, thecmcases fail.eslintandprettier --checkpass on the source file and the test file.test/issues/catalog.jsonalready failsprettier --checkonmain; this PR changes one value in it.Release
The squash merge with a
fix(sr):title releases the next 1.x patch version.🤖 Generated with Claude Code