Skip to content

fix: classify only 0x0010-0x00FF odd-group elements as private creators - #559

Merged
awatson1978 merged 1 commit into
release/1.0-beta-corefrom
core/finding-26-private-creator-range
Sep 30, 2026
Merged

awatson1978 merged 1 commit into
release/1.0-beta-corefrom
core/finding-26-private-creator-range

Conversation

@awatson1978

Copy link
Copy Markdown
Collaborator

This narrows Tag.isPrivateCreator to the element range the standard actually assigns to private creators, and unskips the issue-356 regression test that pins it.

Some background. DICOM reserves odd-numbered groups for vendor-private data, and a vendor claims a block of an odd group by writing a private creator element — a short text label like "ACME 1.0" that says who owns the block. The standard (PS3.5 section 7.8.1) puts those creator elements at element numbers 0x0010 through 0x00FF of the odd group, and it explicitly reserves 0x0001 through 0x000F: they "shall not be used". So an element like (0009,0001) is not a creator label, and nothing in the standard says its bytes are text.

The check on this branch accepted the whole 0x0001–0x00FF range. That matters on the implicit-VR read path, where files don't carry type codes inline and isPrivateCreator() is what promotes an unknown odd-group tag to LO (a text type). A reserved-range element was being decoded as a text label when the standard gives no basis for that. With the narrowed check it reads as UN — unknown, raw bytes intact — which is the honest answer:

import { Tag } from "dcmjs/src/Tag.js";

Tag.fromNumbers(0x0009, 0x0010).isPrivateCreator(); // true  — first creator slot
Tag.fromNumbers(0x0009, 0x00ff).isPrivateCreator(); // true  — last creator slot
Tag.fromNumbers(0x0009, 0x0001).isPrivateCreator(); // was true, now false — reserved, "shall not be used"
Tag.fromNumbers(0x0009, 0x000f).isPrivateCreator(); // was true, now false — reserved

The change is ported from the v2 line, where it landed with the PS3.5 citation in a comment. The issue-356 suite (test/issues/issue356-private-creator-range.test.js) already pinned the five conformant cases and carried the reserved-range case as a skipped KNOWN GAP; I verified the skipped test fails against the old check, applied the fix, and unskipped it. The catalog entry for #356 flips gap → green.

This is review finding 26 of the PR #512 review map. The map's verdict calls it an improvement to keep, not a regression to revert: the new behavior is exactly conformant, and the parse stays lossless (the raw bytes survive in the UN element, so a downstream filter can re-decode them as text if someone needs the old reading). One thing worth saying plainly: master is more permissive here — it accepts 0x0001 and up as creators — so this is a documented, intentional behavior difference, not a bug fix to backport.

🤖 Generated with Claude Code

Tag.isPrivateCreator accepted any odd-group element from 0x0001 to
0x00FF, but PS3.5 7.8.1 places private creator data elements in
(gggg,0010-00FF) only and reserves (gggg,0001-000F) — they "shall not
be used". On the implicit-VR read path isPrivateCreator() promotes
unknown tags to VR LO, so a reserved-range element decoded as a text
creator label instead of reading as UN with its bytes intact.

Ports the range check from the v2 line, unskips the KNOWN GAP test in
the issue-356 suite, and flips the catalog entry to green.

Closes review finding 26 of the PR #512 review map.

Co-Authored-By: Claude Fable 5 <[email protected]>
@awatson1978
awatson1978 merged commit c48f95b into release/1.0-beta-core Sep 30, 2026
12 checks passed
@awatson1978
awatson1978 deleted the core/finding-26-private-creator-range branch September 30, 2026 19:13
awatson1978 added a commit that referenced this pull request Sep 30, 2026
Finding 26 landed as PR #559 and finding 33 as PR #562 (which ported
the v2 uid() rather than documenting only). Master hotfixes are
deferred per today's decision; finding 2's documentation pre-landed
in docs/INTENTIONAL_CHANGES.md ahead of the anonymizer port.

Co-Authored-By: Claude Fable 5 <[email protected]>
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.0.0-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant