Repository navigation
chore(adapters): mark the adapters export of @dcmjs-org/dcmjs deprecated - #647
Merged
Merged
Conversation
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]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
wayfarer3130
marked this pull request as ready for review
November 25, 2026 17:39
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]>
|
🎉 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]>
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
The Cornerstone, Cornerstone3D, VTKjs and DICOMMicroscopyViewer adapters moved to
@cornerstonejs/adapters. On1.0-beta,@dcmjs-org/dcmjsstill exportsadaptersfromsrc/index.js, and nothing tells a user that the export is deprecated. Thepackages/*libraries do not export the adapters.Changes
src/adapters/index.js: a@deprecatedJSDoc tag on theadaptersobject. The tag points to@cornerstonejs/adapters. Editors show the export as deprecated.docs/MIGRATION.md: the "What needs no migration" list now says thatadaptersis 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 --checkpasses onsrc/adapters/index.js.docs/MIGRATION.mdalready failedprettier --checkbefore this change.🤖 Generated with Claude Code