JavaScript library
dcmjs
An MIT-licensed JavaScript implementation of DICOM manipulation. Its latest npm release dates from May 2026.
DICOM
@cosyte/dicom reads the headers of real-world, vendor-quirky Part 10 files (patient, study, series, image, codes and UIDs), records every deviation it tolerated as a stable warning code, and never decodes pixels. Zero runtime dependencies.
npm install @cosyte/dicomNeed it integrated? Talk to us.
The standard
@cosyte/dicom
Most software that touches imaging needs a handful of header fields: who the patient is, which study and series an instance belongs to, and how the pixels are to be interpreted. Getting them usually means adopting a toolkit built around a pixel pipeline you will not use. This library is the metadata half only.
import { parseDicom } from "@cosyte/dicom";
// A synthetic CT object, saved without its 128-byte preamble: an invented patient and example-root
// UIDs, no real PHI. In your integration these are the bytes of the file you read.
const buf = Buffer.from(
"AgAAAFVMBAAcAAAAAgAQAFVJFAAxLjIuODQwLjEwMDA4LjEuMi4xAAgAFgBVSRoAMS4yLjg0MC4xMDAwOC41LjEuNC4xLjEuMgAIABgAVUkeADEuMi44MjYuMC4xLjM2ODAwNDMuOC40OTguMTExAAgAIABEQQgAMTkwMDAxMDEIAGAAQ1MCAENUEAAQAFBOCABEb2VeSmFuZRAAIABMTwYATVJOLTQyEAAhAExPDABTQU1QTEUtSE9TUCAgAA0AVUkeADEuMi44MjYuMC4xLjM2ODAwNDMuOC40OTguMS4xACAADgBVSR4AMS4yLjgyNi4wLjEuMzY4MDA0My44LjQ5OC4xLjIAIAARAElTAgAyICgAEABVUwIAAAIoABEAVVMCAAACKAAAAVVTAgAQACgAAwFVUwIAAQAoAFIQRFMGAC0xMDI0ICgAUxBEUwIAMSAoADAARFMIADAuNVwwLjUg",
"base64",
);
const ds = parseDicom(buf);
console.log("patient", ds.patient.id, "issuer", ds.patient.issuerOfId);
console.log("study", ds.study.instanceUid);
console.log("series", ds.series.modality, "image", ds.image.rows, "x", ds.image.columns);
console.log("rescale slope", ds.image.rescaleSlope, "intercept", ds.image.rescaleIntercept);
console.log("tolerated", ds.warnings.length, ds.warnings[0]?.code);
// The values printed above, which the test suite asserts on every run.
// NOT globally unique on its own: pair it with ds.patient.issuerOfId.
ds.patient.id; // => "MRN-42"
// The global study anchor.
ds.study.instanceUid; // => "1.2.826.0.1.3680043.8.498.1.1"
ds.series.modality; // => "CT"
ds.image.rows; // => 512
// number | undefined: undefined means "absent", never a substituted 1.
ds.image.rescaleSlope; // => 1
// What the parser tolerated, as stable codes.
ds.warnings.map((w) => w.code); // => ["DICOM_MISSING_PREAMBLE"]From the @cosyte/dicom README on GitHub, verbatim. Every value in it is synthetic.
Limits
It is metadata-first by design. Its README says not to rely on it for:
Alternatives
Each description comes from the project’s own documentation or listing, linked below.
JavaScript library
An MIT-licensed JavaScript implementation of DICOM manipulation. Its latest npm release dates from May 2026.
JavaScript library
An MIT-licensed JavaScript parser for DICOM Part 10 data, from the Cornerstone project. Its latest npm release dates from February 2023.
Node.js library
An MIT-licensed DICOM DIMSE implementation for Node.js, built on dcmjs. If you need DIMSE networking, which @cosyte/dicom does not do, this is where to look.
Python library
A pure Python package for reading and writing DICOM data.
DICOM server
An open-source DICOM server for healthcare and medical research. A server stores and serves studies; @cosyte/dicom reads and writes files inside your own code.
Works with
It is free and MIT-licensed. If it saves you a day, a star on GitHub helps other engineers find it.
Need it integrated? Talk to us, or see what our integration services cover.