dcm2niix is a 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.
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.
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.
See the VERSIONS.md file for details on releases.
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/ouput /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.
cmake
and pkg-config
(optional) can be installed as follows:
Ubuntu: sudo apt-get install cmake pkg-config
MacOS: brew install cmake pkg-config
To build:
mkdir build && cd build
cmake ..
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.
optional building with OpenJPEG:
Support for JPEG2000 using OpenJPEG is optional. To build with OpenJPEG change the cmake command to cmake -DUSE_OPENJPEG=ON ..
:
mkdir build && cd build
cmake -DUSE_OPENJPEG=ON ..
make
optional batch processing version:
The batch processing binary dcm2niibatch
is optional. To build dcm2niibatch
as well change the cmake command to cmake -DBATCH_VERSION=ON ..
. This requires a compiler that supports c++11.
If you have any problems with the cmake build script described above or want to customize the software see the COMPILE.md file for details on manual compilation.
- Valerio Luccio's dinifti is focused on conversion of Siemens data
- 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).
- Xiangrui Li's dicm2nii is written in Matlab. The Matlab language makes this very scriptable.
- dicom2nifti uses the scriptable Python wrapper utilizes the high performance GDCMCONV executables.
- MRtrix mrconvert is a useful general purpose image converter and handles DTI data well. It is an outstanding tool for modern Philips enhanced images.
- Jolinda Smith's mcverter has great support for various vendors.
- mri_convert is part of the popular FreeSurfer package. In my limited experience this tool works well for GE and Siemens data, but fails with Philips 4D datasets.
- 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.
- R2A_GUI is a Matlab script that converts Philips PAR/REC images to NIfTI.
- bidsify is a Python project that uses dcm2niix to convert DICOM and Philips PAR/REC images to the BIDS standard.
- bidskit uses dcm2niix to create BIDS datasets.
- boutiques-dcm2niix is a dockerfile for installing and validating dcm2niix.
- DAC2BIDS uses dcm2niibatch to create BIDS datasets.
- Dcm2Bids uses dcm2niix to create BIDS datasets.
- dcm2niir R wrapper for dcm2niix/dcm2nii.
- dcm2niix_afni is a version of dcm2niix included with the AFNI distribution.
- divest R interface to dcm2niix.
- fsleyes is a powerful Python-based image viewer. It uses dcm2niix to handle DICOM files through its fslpy libraries.
- heudiconv can use dcm2niix to create BIDS datasets.
- MRIcroGL is available for MacOS, Linux and Windows and provides a graphical interface for dcm2niix. You can get compiled copies from the MRIcroGL NITRC web site.
- neuro_docker includes dcm2niix as part of a single, static Dockerfile.
- NeuroDebian provides up-to-date version of dcm2niix for Debian-based systems.
- neurodocker generates custom Dockerfiles given specific versions of neuroimaging software.
- nipype can use dcm2niix to convert images.
- pydcm2niix is a Python module for working with dcm2niix.
- sci-tran dcm2niix Flywheel Gear (docker).