Skip to content

test: vendor the parser test-image corpus with citations - #534

Merged
awatson1978 merged 2 commits into
release/1.0-beta-fixturesfrom
fixtures/parser-test-corpus
Sep 29, 2026
Merged

awatson1978 merged 2 commits into
release/1.0-beta-fixturesfrom
fixtures/parser-test-corpus

Conversation

@awatson1978

@awatson1978 awatson1978 commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

No engine code in this one — it vendors the 23 binary test images (plus their provenance READMEs) that the streaming reader's test suites walk as their corpus. The files land under packages/fixtures/testImages/:

  • the CT1_UNC endianness triple — explicit little, explicit big, and implicit little endian; the two converted variants were made with dcmtk's dcmconv, as the directory README records,
  • the dclunie deflate samples — image_dfl, report_dfl, wave_dfl, extension-less files in the deflated transfer syntax,
  • and the encapsulated single- and multi-frame permutations — CT1_UNC, CT0012, and IM00001 in fragmented and non-fragmented forms, with and without a Basic Offset Table, across JPEG baseline, JPEG lossless, JPEG-LS, and RLE.

Provenance and licensing come first. Every file family has a row in DATACITATION.md stating its origin, license, and patient-data status. The corpus is vendored from the dicomParser project's MIT-licensed test set (cornerstonejs/dicomParser), and the deflate files come from David Clunie's published deflate test set. All of them are published test corpora, believed de-identified. The DATACITATION.md format follows OHIF's example, and it sets the rule going forward: no DICOM file merges without a citation row in the same pull request.

On repository weight: the binaries are declared data in their own commit, and the identical blobs already exist in this repository's history on another branch — so the push uploads nothing new.

Here's how the reader suites consume the corpus. They discover the whole tree and gate every file against the existing parser; condensed from test/eventStream/fromPart10.test.js:

const FIXTURES = discoverFixtures(
    path.join(REPO_ROOT, "packages", "fixtures", "testImages"),
    name => !name.toLowerCase().endsWith(".md")
).map(full => [path.relative(REPO_ROOT, full), full]);

test.each(FIXTURES)("%s", async (_rel, full) => {
    const source = DicomMessage.readFile(readBuffer(full));

    const listener = new CollectorListener();
    await fromPart10(readBuffer(full), listener);

    // Deep-compare the event-built tree against the existing parse.
    expect(compareTrees(source, listener.result)).toEqual([]);
});

Because discovery is recursive, dropping a new image anywhere in the tree adds it to the gate automatically — and DATACITATION.md makes sure it can't arrive without its citation.

🤖 Generated with Claude Code

@awatson1978
awatson1978 merged commit 10acdee into release/1.0-beta-fixtures Sep 29, 2026
8 checks passed
@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