DICOM Viewer, MRI Viewer & CT Viewer (NIfTI)

DICOM Viewer, MRI Viewer & CT Viewer (NIfTI), a VS Code extension by Zovo

Open CT and MRI scans in VS Code (single .dcm files, DICOM folders, .nii and .nii.gz) and scroll, window and inspect them without leaving the editor.

Install in VS CodeOpen the Marketplace page

Free, MIT license. Needs VS Code 1.90.0 or newer. Extension ID zovo.dicom-nifti-viewer, version 0.1.4.

DICOM Viewer showing a chest CT phantom in the lung window with the tag table beside it

Screenshot of VS Code 1.142 with a synthetic chest phantom made by scripts/make-samples.js. No patient data was used anywhere in this project.

Quick start

  1. Install DICOM Viewer & NIfTI Viewer for CT and MRI.
  2. Click a .dcm, .nii or .nii.gz file, or a DICOMDIR. For a folder of slices, right-click the folder and pick Open Folder as DICOM Series.

Questions people ask

Is DICOM Viewer, MRI Viewer & CT Viewer (NIfTI) free?

Yes. DICOM Viewer, MRI Viewer & CT Viewer (NIfTI) is free and MIT licensed.

How do I install DICOM Viewer, MRI Viewer & CT Viewer (NIfTI)?

Click "Install in VS Code" above, or search for zovo.dicom-nifti-viewer in the Extensions view.

What you can do

ActionHow
Next or previous sliceScroll, the arrow keys, Page Up and Page Down, or the slider
Window and levelDrag on the image (left and right for width, up and down for level), or type W and L
Presets1 CT brain (W 80, L 40), 2 soft tissue (W 400, L 40), 3 lung (W 1500, L -600), 4 bone (W 1800, L 400), 0 auto. The window stored in the file is also there
ViewsAxial, Coronal and Sagittal buttons, or A, C and S
Zoom and panCtrl or Cmd and scroll to zoom at the cursor, Shift and drag (or the right button) to pan, F or a double-click to fit
InvertInvert button or I. MONOCHROME1 images open inverted already
TagsTags button or T. Search by tag number, name or value, double-click a row to copy it
ExportExport PNG saves the slice you see at its real proportions
A coronal reformat of the chest phantom in the bone window

The bar under the image shows the voxel under the cursor as i, j and k, then the value. CT values are in Hounsfield units with the stored pixel value next to them. Letters on the image edges (R, L, A, P, S, I) show the patient direction when the file says it.

Anonymity check

DICOM Viewer reads Patient's Name (0010,0010) and Patient ID (0010,0020) in every file of the series. When either is filled, a yellow bar names the values and counts the files, and those rows are marked in the tag table. It also lists other identifying tags it finds, such as the birth date, address, accession number or institution. When both are empty, a short grey line says so.

It's a check, not a de-identification tool. Burned-in text in the pixels and private tags aren't checked.

The warning bar for a phantom file with a made-up name and ID

Formats

FormatWhat opens
DICOM transfer syntaxesImplicit VR Little Endian, Explicit VR Little Endian, Explicit VR Big Endian, Deflated Explicit VR Little Endian and RLE Lossless
Not supported yetJPEG Baseline, JPEG Extended, JPEG Lossless, JPEG-LS, JPEG 2000, HTJ2K and MPEG or HEVC video. These files still open with their full tag table and a message that names the transfer syntax
DICOM pixels8, 16 and 32 bit, signed or unsigned, MONOCHROME1, MONOCHROME2, RGB and YBR_FULL, single frame and multi-frame, Rescale Slope and Intercept applied
DICOM foldersA DICOMDIR (its Referenced File IDs), or any folder with .dcm, .dicom or .ima files or files without an extension, 4 folders deep. Slices are sorted by Image Position (Patient). With several series you pick one from a list
NIfTINIfTI-1 and NIfTI-2, .nii and .nii.gz, uint8 to float64 and RGB, with scl_slope and the sform or qform orientation. A 4D file shows one volume at a time, with a picker
A NIfTI brain phantom in the sagittal view with its header fields

Big scans

Files are read in a worker thread, so VS Code stays responsive. A 48-slice 256 x 256 series stacks in well under a second. Scans over 1024 MB (for .nii.gz, the unpacked size) show a message and aren't read. You can raise the limit with dicomViewer.maxFileMB, up to 4096.

Settings

SettingDefaultWhat it does
dicomViewer.maxFileMB1024Largest file or folder that is read
dicomViewer.defaultViewautoView a scan opens in. Auto uses the plane the slices were stored in
dicomViewer.smoothingfalseSmooth pixels when zoomed
dicomViewer.askForRatingtrueAsk one time for a Marketplace rating after a few days of use
dicomViewer.showSupportLinkstrueShow the small Sponsor and More free viewers links under the image

Privacy

No network calls and no telemetry. The webview has a strict Content-Security-Policy, file text is shown as plain text, and the only file DICOM Viewer writes is the PNG you choose in the save dialog.

Known limits

License

MIT. dicom-parser, nifti-reader-js and fflate are MIT too, see THIRD-PARTY-NOTICES.md.

Guides

Install DICOM Viewer, MRI Viewer & CT Viewer (NIfTI)

Click the button to open VS Code and install it, or press Ctrl+P (Cmd+P on macOS) in VS Code and run ext install zovo.dicom-nifti-viewer.

Free, MIT license. Needs VS Code 1.90.0 or newer. Extension ID zovo.dicom-nifti-viewer, version 0.1.4.

Source code and issues are on GitHub.

All our VS Code extensions

Support this work

If this extension saves you time, you can support the work on GitHub Sponsors. Monthly tiers start at $5, and one-time tiers start at $15. Sponsorship is optional, and the tool works the same without it.