Skip to content

fix(sr): map cm and cm² to the UCUM units in unit2CodingValue (port of #506) - #683

Merged
wayfarer3130 merged 2 commits into
mainfrom
fix/port-506-ucum-cm
Nov 28, 2026
Merged

wayfarer3130 merged 2 commits into
mainfrom
fix/port-506-ucum-cm

Conversation

@wayfarer3130

@wayfarer3130 wayfarer3130 commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR ports #506 by @afip94 to main. unit2CodingValue had no entry for cm. 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 through SequenceOfUltrasoundRegions (PhysicalUnitsXDirection 3). Fixes #505.

The PR also maps cm² to the existing UCUM unit cm2, as mm² maps to mm2. Cornerstone3D labels a calibrated ultrasound area cm² US Region, and that label also became an arbitrary unit. #506 has the same change.

The first commit keeps the original author.

Changes

#506 adds the test file test/unit2CodingValue.test.js on 0.x. main already has the regression test of #505 in test/issues/, so this PR uses that test and does not add the second file.

Change that users can see

An SR measurement in cm now has the code cm (UCUM 1.4), not [arb'U]{cm}. An area in cm² now has the code cm2, not [arb'U]{cm²}. Other units do not change.

Tests

Release

The squash merge with a fix(sr): title releases the next 1.x patch version.

🤖 Generated with Claude Code

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]>
@netlify

netlify Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for dcmjs2 ready!

Name Link
🔨 Latest commit f3fb6b2
🔍 Latest deploy log https://app.netlify.com/projects/dcmjs2/deploys/6b0a2311d05a9f424c4ecd52
😎 Deploy Preview https://deploy-preview-683--dcmjs2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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 wayfarer3130 changed the title fix(sr): map cm to the UCUM unit in unit2CodingValue (port of #506) fix(sr): map cm and cm² to the UCUM units in unit2CodingValue (port of #506) Nov 28, 2026
@wayfarer3130
wayfarer3130 marked this pull request as ready for review November 28, 2026 00:43
@wayfarer3130
wayfarer3130 merged commit c745683 into main Nov 28, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

unit2CodingValue has no entry for "cm" — centimetre measurements become [arb'U]{cm}

1 participant