Skip to content

chore(adapters): mark the adapters export of @dcmjs-org/dcmjs deprecated - #647

Merged
wayfarer3130 merged 2 commits into
1.0-betafrom
chore/1.0-beta-deprecate-adapters
Nov 25, 2026
Merged

wayfarer3130 merged 2 commits into
1.0-betafrom
chore/1.0-beta-deprecate-adapters

Conversation

@wayfarer3130

Copy link
Copy Markdown
Contributor

Summary

The Cornerstone, Cornerstone3D, VTKjs and DICOMMicroscopyViewer adapters moved to @cornerstonejs/adapters. On 1.0-beta, @dcmjs-org/dcmjs still exports adapters from src/index.js, and nothing tells a user that the export is deprecated. The packages/* libraries do not export the adapters.

Changes

  • src/adapters/index.js: a @deprecated JSDoc tag on the adapters object. The tag points to @cornerstonejs/adapters. Editors show the export as deprecated.
  • docs/MIGRATION.md: the "What needs no migration" list now says that adapters is still exported but deprecated, and where to import the adapters from.

Behaviour

No change at run time. The export stays for compatibility with 0.x. This PR adds no console warning, because a warning on each access changes the behaviour for current users. A later major release can remove the export.

Tests

No tests. The change is a doc comment and a documentation line only. prettier --check passes on src/adapters/index.js. docs/MIGRATION.md already failed prettier --check before this change.

🤖 Generated with Claude Code

The adapters moved to @cornerstonejs/adapters. Keep the export for 0.x
compatibility, and point users to the new package.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@wayfarer3130
wayfarer3130 marked this pull request as ready for review November 25, 2026 17:39
@wayfarer3130
wayfarer3130 merged commit f3db5fb into 1.0-beta Nov 25, 2026
4 checks passed
@wayfarer3130
wayfarer3130 deleted the chore/1.0-beta-deprecate-adapters branch November 25, 2026 17:40
wayfarer3130 added a commit that referenced this pull request Nov 25, 2026
…rge of 1.0-beta

dcmjs.js is 1,509,340 bytes (ratio 1.09022) and dcmjs.es.js is
1,456,286 bytes (ratio 1.07284) after the merge of #654, #656 and #647.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown

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

The release is available on:

Your semantic-release bot 📦🚀

wayfarer3130 added a commit that referenced this pull request Nov 25, 2026
…t of #622) (#663)

* fix: byte order of binary value fields in Explicit VR Big Endian (port of #622)

Explicit VR Big Endian stores the words of OW, OF and OD (and OL / OV)
value fields most significant byte first. dcmjs 1.0 gave them to the
caller, and wrote them, in the order of the caller's memory.

- core: swapBytes / swappedCopy (utilities/byteSwap.js, exported);
  BinaryRepresentation.wordWidth; swap on read, swap a copy on write;
  ParsedUnknownValue re-reads in the right byte order;
  BufferStream.readUint16Array off-by-one.
- legacy: AsyncDicomReader cuts fragments to whole words and swaps them,
  also on the bit-packed path; a UN "ox" pixel data uses the OW width.
- The event-stream parser and StreamingPart10Writer go through core.
- test/big-endian.test.js: independent encoder; every reader and the
  writer, plus the CT1_UNC big endian / little endian fixture pair.
- bundle-size ceilings 1.085 / 1.068.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(async): swap Big Endian OW pixel data before it is cut into frames

When a frame of OW pixel data is not a whole number of words (8-bit data
stored as OW, odd samples per frame), a word spans two frames. The async
reader cut the value into frames first and swapped each frame alone, so it
mixed the bytes of the two frames. It now reads and swaps the whole value
first and then cuts it into frames, as the 1-bit path already does.

The big endian test now runs for Explicit VR Big Endian only, with one
little endian write test as a control, and checks the odd frame case on
DicomMessage, AsyncDicomReader, fromPart10 and fromPart10Stream.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* docs: little endian binary values in memory for every transfer syntax; bundle-size ceilings

Add NAT-U-BIN-7 and NAT-I-BIN-4 to the naturalized dataset spec, a
MIGRATION.md note for callers that swapped the bytes themselves, and the
raw byte order and maxFragmentSize rounding to the AsyncDicomReader doc.
Set the bundle-size ceilings to the measured ratios (x1.08949, x1.07200).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(async): swap expectsRaw OW/OF/OD words to little endian in Big Endian

AsyncDicomReader.readRawBinary now passes the word width of the VR to
_emitSplitValues, so a listener that returns expectsRaw gets OW, OF, OL,
OD and OV words as little endian, the same as on the other read paths.
OB, UN and other VRs keep the byte order of the file.

Use one VR list in NAT-U-BIN-7, MIGRATION.md and the AsyncDicomReader
skill doc: OW, OF and OD, and OL and OV where the VR is supported.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(bundle-size): raise the ceilings to 1.091 and 1.073 after the merge of 1.0-beta

dcmjs.js is 1,509,340 bytes (ratio 1.09022) and dcmjs.es.js is
1,456,286 bytes (ratio 1.07284) after the merge of #654, #656 and #647.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(VR): give a VR with no registered class a word width of 1

A UN element whose dictionary VR is OV (or OL) with no registered VR
class, for example (7FE0,0001), now reads the same with DicomMessage,
fromPart10 and AsyncDicomReader: BinaryRepresentation.wordWidth is 1
for a type that Vrs does not hold, so no reader swaps it.

Docs: NAT-I-BIN-4 states this rule; NAT-U-BIN-7, MIGRATION.md and the
AsyncDicomReader skill say that a UN element whose dictionary VR is
OW, OF or OD reads as that VR and gets the swap. Fix the readRawBinary
doc comment (fragments of maxFragmentSize, not 64KB chunks) and rewrap
a long MIGRATION.md line.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(big-endian): read explicit OL and OV, and UN with dictionary VR OV, the same with every reader

With the OL and OV VR classes of #653, DicomMessage, fromPart10 and
AsyncDicomReader (normal and expectsRaw) give little endian words for
an explicit OL or OV value and for a UN value whose dictionary VR is
OV. Drop the stale "no OL VR class" sentence of the dataset comment.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(VR): drop the Vrs check from wordWidth; name OL and OV in the swap docs

After #653, every key of WORD_WIDTHS has a built-in VR class, so the
Vrs check in BinaryRepresentation.wordWidth had no effect. NAT-I-BIN-4 now
says that a code not in WORD_WIDTHS, also one that registerVr adds, has a
width of 1. NAT-U-BIN-7, MIGRATION.md and the AsyncDicomReader skill doc
name OW, OF, OD, OL and OV for the swap and for the UN rule, and item 7 of
the skill doc lists SV and UV.

Tests: UN rows for OW (0028,1201) and OF (0066,0016), fromPart10Stream
in the every-reader check, SV in LENGTH_32_VRS, and a corrected comment
for (0066,0040).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
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