Skip to main content

dcm2niix

Build

About

dcm2niix is designed to convert neuroimaging data from the DICOM format to the NIfTI format. This web page hosts the developmental source code - a compiled version for Linux, MacOS, and Windows of the most recent stable release is included with MRIcroGL. A full manual for this software is available in the form of a NITRC wiki.

The DICOM format is the standard image format generated by modern medical imaging devices. However, DICOM is very complicated and has been interpreted differently by different vendors. The NIfTI format is popular with scientists, it is very simple and explicit. However, this simplicity also imposes limitations (e.g. it demands equidistant slices). dcm2niix is also able to generate a BIDS JSON format sidecar which includes relevant information for brain scientists in a vendor agnostic and human readable form. The Neuroimaging DICOM and NIfTI Primer provides details.

JavaScript/WebAssembly

To view the WASM specific README, please click here. The rest of this README is for the dcm2niix CLI program.

License

This software is open source. The bulk of the code is covered by the BSD license. Some units are either public domain (nifti*.*, miniz.c) or use the MIT license (ujpeg.cpp). See the license.txt file for more details.

Dependencies

This software should run on macOS, Linux and Windows typically without requiring any other software. However, if you use dcm2niix to create gz-compressed images it will be faster if you have pigz installed. You can get a version of both dcm2niix and pigz compiled for your operating system by downloading MRIcroGL.

Image Conversion and Compression

DICOM provides many ways to store/compress image data, known as transfer syntaxes. The COMPILE.md file describes details on how to enable different options to provide support for more formats.

  • The base code includes support for raw, run-length encoded, and classic JPEG lossless decoding.
  • Lossy JPEG is handled by the included NanoJPEG. This support is modular: you can compile for libjpeg-turbo or disable it altogether.
  • JPEG-LS lossless support is optional, and can be provided by using CharLS.
  • JPEG2000 lossy and lossless support is optional, and can be provided using OpenJPEG or Jasper.
  • GZ compression (e.g. creating .nii.gz images) is optional, and can be provided using either the included miniz or the popular zlib. Of particular note, the Cloudflare zlib exploits modern hardware (available since 2008) for very rapid compression. Alternatively, you can compile dcm2niix without a gzip compressor. Regardless of how you compile dcm2niix, it can use the external program pigz for parallel compression.
  • Zstandard compression (creating .nii.zst images via -z s) is optional, and can be enabled with -DUSE_ZSTD=ON (CMake) or ZSTD=1 make (Makefile). Zstandard offers a favorable compression/speed tradeoff compared to gzip.

Versions

See releases for recent release notes. See the VERSIONS.md file for details on earlier releases.

Contribute

dcm2niix is developed by the community for the community and everybody can become a part of the community.

Running

Command line usage is described in the NITRC wiki. The minimal command line call would be dcm2niix /path/to/dicom/folder. However, you may want to invoke additional options, for example the call dcm2niix -z y -f %p_%t_%s -o /path/output /path/to/dicom/folder will save data as gzip compressed, with the filename based on the protocol name (%p) acquisition time (%t) and DICOM series number (%s), with all files saved to the folder "output". For more help see help: dcm2niix -h.

See the BATCH.md file for instructions on using the batch processing version.

Install

There are a couple ways to install dcm2niix

  • Github Releases provides the latest compiled executables. This is an excellent option for MacOS and Windows users. However, the provided Linux executable requires a recent version of Linux (e.g. Ubuntu 14.04 or later), so the provided Unix executable is not suitable for very old distributions. Specifically, it requires Glibc 2.19 (from 2014) or later. Users of older systems can compile their own copy of dcm2niix or download the compiled version included with MRIcroGL Glibc 2.12 (from 2011, see below).
  • Run the following command to get the latest release version for Linux, Macintosh or Windows:
    • curl -fLO https://github.com/rordenlab/dcm2niix/releases/latest/download/dcm2niix_lnx.zip
    • curl -fLO https://github.com/rordenlab/dcm2niix/releases/latest/download/macos_dcm2niix.pkg
    • curl -fLO https://github.com/rordenlab/dcm2niix/releases/latest/download/dcm2niix_win.zip
  • Latest development builds are available as artifacts from GitHub Actions for Linux, Macintosh, and Windows.
  • MRIcroGL (NITRC) or MRIcroGL (GitHub) includes dcm2niix that can be run from the command line or from the graphical user interface (select the Import menu item). The Linux version of dcm2niix is compiled on a holy build box, so it should run on any Linux distribution.
  • If you have a MacOS computer with Homebrew or MacPorts you can run brew install dcm2niix or sudo port install dcm2niix, respectively.
  • If you have Conda, conda install -c conda-forge dcm2niix on Linux, MacOS or Windows.
  • If you have pip, python -m pip install dcm2niix on Linux, MacOS or Windows.
  • On Debian Linux computers you can run sudo apt-get install dcm2niix.

Build from source

It is often easier to download and install a precompiled version. However, you can also build from source.

Build command line version with cmake (Linux, MacOS, Windows)

cmake and pkg-config (optional) can be installed as follows:

Ubuntu: sudo apt-get install cmake pkg-config

MacOS: brew install cmake pkg-config or sudo port install cmake pkgconfig

Once these tools are available, you can compile with cmake:

git clone https://github.com/rordenlab/dcm2niix.git
cd dcm2niix
mkdir build && cd build
cmake -DZLIB_IMPLEMENTATION=Cloudflare -DUSE_JPEGLS=ON -DUSE_OPENJPEG=ON ..
make

dcm2niix will be created in the bin subfolder. To install on the system run make install instead of make - this will copy the executable to your path so you do not have to provide the full path to the executable.

In rare case if cmake fails with the message like "Generator: execution of make failed", it could be fixed by sudo ln -s `which make` /usr/bin/gmake.

Building the command line version without cmake

This is the simplest way to compile dcm2niix on a Linux or MacOS computer. Be warned that this minimal version will not be able to extract DICOM images compressed with the (rarely used) JPEG2000 or JPEG-LS formats.

git clone https://github.com/rordenlab/dcm2niix.git
cd dcm2niix/console
make
./dcm2niix

Referencing

  • Li X, Morgan PS, Ashburner J, Smith J, Rorden C (2016) The first step for neuroimaging data analysis: DICOM to NIfTI conversion. J Neurosci Methods. 264:47-56. doi: 10.1016/j.jneumeth.2016.03.001. PMID: 26945974

Alternatives

  • BIDS-converter hosts Matlab and Python scripts for PET images, supporting DICOM and ECAT (ecat2nii) formats.
  • dcm2nii is the predecessor of dcm2niix. It is deprecated for modern images, but does handle image formats that predate DICOM (proprietary Elscint, GE and Siemens formats).
  • Python dcmstack DICOM to Nifti conversion with meta data preservation.
  • dicm2nii is written in Matlab. The Matlab language makes this very scriptable.
  • dicom2nifti uses the scriptable Python wrapper utilizes the high performance GDCMCONV executables.
  • dicomtonifti leverages VTK.
  • dimon and to3d are included with AFNI.
  • dinifti is focused on conversion of classic Siemens DICOMs.
  • DWIConvert converts DICOM images to NRRD and NIfTI formats.
  • mcverter a great tool for classic DICOMs.
  • mri_convert is part of the popular FreeSurfer package.
  • MRtrix mrconvert is a useful general purpose image converter and handles DTI data well. It is an outstanding tool for modern Philips enhanced images.
  • nanconvert uses the ITK library to convert DICOM from GE and proprietary Bruker to standard formats like DICOM.
  • Plastimatch is a Swiss Army knife - it computes registration, image processing, statistics and it has a basic image format converter that can convert some DICOM images to NIfTI or NRRD.
  • Simple Dicom Reader 2 (Sdr2) uses dcmtk to read DICOM images and convert them to the NIfTI format.
  • SlicerHeart extension is specifically designed to help 3D Slicer support ultra sound (US) images stored as DICOM.
  • spec2nii converts MR spectroscopy to NIFTI.
  • SPM12 is one of the most popular tools in the field. It includes DICOM to NIfTI conversion. Being based on Matlab it is easy to script.

dcm2niix is a core dependency of BIDS converters:

The following tools exploit dcm2niix

Metadata

Release files for dcm2niix 1.0.20260416

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dcm2niix 1.0.20260416
File Size Uploaded Provenance Actions
dcm2niix-1.0.20260416.tar.gz 566.8 kB With provenance Details for dcm2niix-1.0.20260416.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for dcm2niix 1.0.20260416
File Actions
dcm2niix-1.0.20260416-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details for dcm2niix-1.0.20260416-cp38-abi3-win_amd64.whl
dcm2niix-1.0.20260416-cp38-abi3-musllinux_1_2_x86_64.whl CPython 3.8 abi3 Linux musl 1.2+ x86-64 Details for dcm2niix-1.0.20260416-cp38-abi3-musllinux_1_2_x86_64.whl
dcm2niix-1.0.20260416-cp38-abi3-musllinux_1_2_aarch64.whl CPython 3.8 abi3 Linux musl 1.2+ ARM64 Details for dcm2niix-1.0.20260416-cp38-abi3-musllinux_1_2_aarch64.whl
dcm2niix-1.0.20260416-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 abi3 Linux glibc 2.17+ x86-64 Details for dcm2niix-1.0.20260416-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
dcm2niix-1.0.20260416-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.8 abi3 Linux glibc 2.17+ ARM64 Details for dcm2niix-1.0.20260416-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
dcm2niix-1.0.20260416-cp38-abi3-macosx_11_0_arm64.whl CPython 3.8 abi3 macOS 11.0+ ARM64 Details for dcm2niix-1.0.20260416-cp38-abi3-macosx_11_0_arm64.whl
dcm2niix-1.0.20260416-cp38-abi3-macosx_10_9_x86_64.whl CPython 3.8 abi3 macOS 10.9+ x86-64 Details for dcm2niix-1.0.20260416-cp38-abi3-macosx_10_9_x86_64.whl

Total release size: 13.6 MB

Release files / dcm2niix-1.0.20260416.tar.gz

Download URL dcm2niix-1.0.20260416.tar.gz
Size 566.8 kB
Tags Source
SHA-256 checksum
How to use checksums
65ed563d218e38ea5a836a756bd1bd5298377489a70f44c06dc11b807969f4b6
BLAKE2b-256 checksum
How to use checksums
72df5f62409d488b771e8b7b17bee8023d35c3f745af685df1a863c402f3adf7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.2.0 CPython/3.14.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 7, 2026.

Transparency log

Release files / dcm2niix-1.0.20260416-cp38-abi3-win_amd64.whl

Download URL dcm2niix-1.0.20260416-cp38-abi3-win_amd64.whl
Size 2.4 MB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
7c03bd92cd72640061a25e86c16bda28e76a822b0d14ece8bd40a53244f30e1b
BLAKE2b-256 checksum
How to use checksums
227fc87fad5be26a52cc0351a8aca4a4b7aa8f4ab7835467ae6715a7536504a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.2.0 CPython/3.14.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 7, 2026.

Transparency log

Release files / dcm2niix-1.0.20260416-cp38-abi3-musllinux_1_2_x86_64.whl

Download URL dcm2niix-1.0.20260416-cp38-abi3-musllinux_1_2_x86_64.whl
Size 2.3 MB
Tags CPython 3.8 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
cc1ef067b1b290118150eab7f4c44947321f058998dbcf018e714e2e9e389236
BLAKE2b-256 checksum
How to use checksums
11f9b5e85eb70ac8d9289cfaf30c5a99079d9a89236254ab1827ddb6133c3b11
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.2.0 CPython/3.14.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 7, 2026.

Transparency log

Release files / dcm2niix-1.0.20260416-cp38-abi3-musllinux_1_2_aarch64.whl

Download URL dcm2niix-1.0.20260416-cp38-abi3-musllinux_1_2_aarch64.whl
Size 2.3 MB
Tags CPython 3.8 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
2eb75032ced26c3a66fb09b46dfa725b774b718914f4f29b10241702ae85da6c
BLAKE2b-256 checksum
How to use checksums
981a64da2cfe3072cfacaa9dc5985d793de4279894ffe98d5805425b42f63b6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.2.0 CPython/3.14.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 7, 2026.

Transparency log

Release files / dcm2niix-1.0.20260416-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL dcm2niix-1.0.20260416-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.9 MB
Tags CPython 3.8 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
c9c5e42819c18f58942c2ed138199e81f294f9c96874e29b675b737e1b69a596
BLAKE2b-256 checksum
How to use checksums
25914adf9bd64a123cf0c1ffb882362bf79a0022a315d29abd8929bedaafdf70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.2.0 CPython/3.14.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 7, 2026.

Transparency log

Release files / dcm2niix-1.0.20260416-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL dcm2niix-1.0.20260416-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 2.0 MB
Tags CPython 3.8 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
69e42958deffc7d71b323c17aab31555c43f6f1acac045cca810a4f5f5fb9261
BLAKE2b-256 checksum
How to use checksums
990042dcf199dd76f1d59acf8e53d71c1a36c672c29f72d7385f1d51d20e1cd3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.2.0 CPython/3.14.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 7, 2026.

Transparency log

Release files / dcm2niix-1.0.20260416-cp38-abi3-macosx_11_0_arm64.whl

Download URL dcm2niix-1.0.20260416-cp38-abi3-macosx_11_0_arm64.whl
Size 1.0 MB
Tags CPython 3.8 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
e16bd062eccffc7740e93250561b894c5664325bebfb8b59fbf90227b8ccdfc5
BLAKE2b-256 checksum
How to use checksums
6a8be7e64c05645d1a67d6e034a9a4fcff642f4cb6fdec16c1600618cde6bd42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.2.0 CPython/3.14.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 7, 2026.

Transparency log

Release files / dcm2niix-1.0.20260416-cp38-abi3-macosx_10_9_x86_64.whl

Download URL dcm2niix-1.0.20260416-cp38-abi3-macosx_10_9_x86_64.whl
Size 1.1 MB
Tags CPython 3.8 abi3 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
6789bada369fc3c6c8f71521a2d8a615a27534f591757db4a9e616caecdb7ba4
BLAKE2b-256 checksum
How to use checksums
87f7031d62ab7cfa104b6139f615c3e048d1e2d50ec4fe7441939dafd7f927d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.2.0 CPython/3.14.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 7, 2026.

Transparency log

Security for dcm2niix 1.0.20260416

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 8 files in this release have been uploaded with provenance metadata.

Select from 8 files

Attestation for dcm2niix-1.0.20260416.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 7, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page