Skip to content

docs: a library-oriented EXAMPLES.md with runnable streaming recipes - #558

Merged
awatson1978 merged 1 commit into
release/1.0-beta-corefrom
core/examples-doc
Sep 30, 2026
Merged

awatson1978 merged 1 commit into
release/1.0-beta-corefrom
core/examples-doc

Conversation

@awatson1978

Copy link
Copy Markdown
Collaborator

This brings the "by example" document forward from the dcmjs-commands CLI repo and rewrites it for the library itself. Same spirit — every snippet ran against real files before it was written down — but the recipes now exercise the APIs on this branch directly: readFile with the new allowMissingHeader opt-in, the DicomEventStream facade, NaturalizedListener, StreamingPart10Writer with end-to-end backpressure, the DICOMweb JSON source/sink pair, and early-exit cancellation through the async event iterable.

The reviewer test-drive section at the bottom is the part I'd start with: it fetches real fixtures from the dcmjs-org/data releases, synthesizes a 211 MB stress file through an event-stream filter, and then reads it back at a measured 15.6 MB peak of live ArrayBuffer memory (the eager path sits at 379 MB on the same file). The whole-slide recipe runs against the public OHIF demo DICOMweb with no downloads at all — a four-level SM pyramid, 21,710 frames at the base, naturalized from live server metadata. All URLs verified serving at time of writing.

🤖 Generated with Claude Code

Adapted from the CLI-oriented EXAMPLES.md on the docs/examples branch of
awatson1978/dcmjs-commands, rewritten against the library APIs on this
branch: DicomMessage.readFile (+ allowMissingHeader), the DicomEventStream
facade, NaturalizedListener, StreamingPart10Writer, the DICOMweb JSON
source/sink pair, and the cancellable async event iterable. Every snippet
was executed against real downloadable data before being written down,
including a live whole-slide-imaging recipe against the public OHIF demo
DICOMweb and a memory-boundedness demonstration (211 MB file, 15.6 MB peak
live ArrayBuffer memory vs 379 MB on the eager path).

Co-Authored-By: Claude Fable 5 <[email protected]>
@awatson1978
awatson1978 merged commit daa0340 into release/1.0-beta-core Sep 30, 2026
8 checks passed
@awatson1978
awatson1978 deleted the core/examples-doc branch September 30, 2026 16:33
@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