How the DICOM Viewer Works
AnyTool DICOM Viewer opens a Digital Imaging and Communications in Medicine (.dcm) file entirely in the browser using the dicom-parser library, which is bundled into the app and served from the same origin — never from a CDN — so the tool works offline and uploads nothing. When you choose a file it is read to an ArrayBuffer; the engine validates the DICM magic at offset 128 (and still accepts files without a preamble) and parses the dataset, then reads the image-pixel module — Rows, Columns, Bits Allocated/Stored, Pixel Representation, Samples Per Pixel, Photometric Interpretation, Planar Configuration and Number of Frames — the modality LUT (Rescale Slope/Intercept) and the VOI window (Window Center/Width). It decodes the pixels according to the transfer syntax and renders each frame on an HTMLCanvasElement: for grayscale it computes value = stored × slope + intercept and maps it through the window to 8-bit, honouring MONOCHROME1; for colour it copies RGB samples respecting planar configuration. Pixel decoding, windowing and PNG export all run on your device.
- Parsed with the dicom-parser library, fully in the browser — no CDN, no server
- DICM magic validated; files without a preamble are still accepted
- Reads the image-pixel module, modality LUT (rescale slope/intercept) and VOI window
- Grayscale windowed with value = stored × slope + intercept, MONOCHROME1 inverted
- Each frame rendered on a canvas; colour images copy RGB by planar configuration
