dcm2niix – Free DICOM to NIfTI Converter
dcm2niix is a free, open-source DICOM to NIfTI converter designed to transform medical imaging files into NIfTI format. Convert MRI and CT scans, process multiple DICOM files, and prepare neuroimaging data for research with a powerful, cross-platform conversion tool.
What Is dcm2niix?
Making Medical Images Research-Ready
dcm2niix is a free, open-source software tool developed to convert medical imaging files from DICOM (Digital Imaging and Communications in Medicine) into NIfTI (Neuroimaging Informatics Technology Initiative) format. It is widely used in neuroscience, medical imaging research, and scientific data preparation.
DICOM is a standard format used by medical imaging equipment to store images and associated information. NIfTI is a widely supported format in neuroimaging research, particularly for organizing and analyzing multidimensional MRI and other compatible imaging data.
dcm2niix helps bridge the gap between clinical imaging formats and scientific research software. Researchers, imaging specialists, and data scientists use it to prepare image datasets for applications such as FSL, SPM, and other neuroimaging tools. The software is available for Windows, macOS, and Linux.
How Does dcm2niix Work?
dcm2niix converts supported DICOM image series into NIfTI datasets through a straightforward conversion process. From reading scanner files to generating research-ready output, each stage helps organize medical imaging data for further analysis.
Read DICOM Files
The process begins when dcm2niix reads a folder containing DICOM images from an MRI, CT, or another supported scanner. These files provide the image data and scanner information required for conversion.
Interpret Image Data
dcm2niix identifies image series and interprets relevant acquisition details, including image orientation and spatial information. This helps organize supported scanner data into a suitable volumetric image structure.
Generate NIfTI Files
Once the image data has been interpreted, the converter writes it into NIfTI format. The resulting files can use the standard .nii extension or the compressed .nii.gz format.
Export Metadata
When JSON sidecar output is enabled, dcm2niix saves relevant acquisition information in a separate .json file. The NIfTI images and metadata can then be used in compatible neuroimaging analysis workflows.
Key Features of dcm2niix
dcm2niix offers a practical set of tools for converting medical imaging datasets. Its capabilities support efficient file preparation, scanner compatibility, flexible output options, and integration with neuroimaging research environments.
Built for Research Workflows
From individual image series to larger datasets, dcm2niix provides flexible conversion options that help streamline medical imaging preparation and support reproducible research workflows.
Fast DICOM to NIfTI Conversion
Convert supported DICOM image series into NIfTI datasets efficiently, reducing manual file preparation and simplifying imaging research tasks.
MRI & CT Scanner Support
Handle DICOM datasets from a wide range of modern medical imaging scanners, including supported MRI and CT acquisition formats.
Batch DICOM Conversion
Process multiple compatible imaging series through command-line workflows, making larger research datasets easier to manage.
NIfTI Compression Options
Save converted images as standard .nii files or compressed .nii.gz files to provide flexible storage options for imaging datasets.
JSON Metadata Export
Generate BIDS-style JSON sidecar files containing useful acquisition details that support imaging documentation and dataset organization.
Cross-Platform Compatibility
Run dcm2niix on Windows, macOS, and Linux, allowing researchers to use familiar computing environments and automated processing pipelines.
Download & Install dcm2niix
Download dcm2niix and choose an installation method that fits your operating system. The software is available for Windows, macOS, and Linux, with package manager options for researchers and developers. Select a ready-to-use release or install through Homebrew, APT, Conda, or Python's pip package manager.
Download dcm2niix ZIPZIP archive download. Source archives may require compilation; compiled executables are available through the official releases.
Choose Your Installation Method
4 OptionsWindows
Download the compiled Windows release, extract the ZIP archive, and run the executable using Command Prompt or PowerShell.
dcm2niix.exe -h Windows ReleasesmacOS
Install dcm2niix through Homebrew from your macOS Terminal, or use the macOS installer available in official releases.
brew install dcm2niix
Homebrew Package
Linux
Install the package through APT on Debian-based systems, or choose a compatible Linux binary from GitHub.
sudo apt-get install dcm2niix
Linux Releases
Conda / Python
Use Conda to install the converter in a managed research environment, or install the Python package with pip.
conda install -c conda-forge dcm2niix
Python Package
dcm2niix -h in your terminal
to display the available command-line options.
How to Convert DICOM to NIfTI Using dcm2niix
Convert DICOM images into NIfTI format using dcm2niix with this simple step-by-step guide. Learn how to prepare medical imaging files, execute the conversion command, and verify the generated NIfTI output for further research and analysis.
Conversion Steps
Prepare Your DICOM Files
Organize the DICOM images into a dedicated folder. Keep files from each scanning session together so dcm2niix can identify compatible image series. Name the source directory input_folder for this example.
Open Command Prompt or Terminal
Launch Command Prompt or PowerShell on Windows, or Terminal on macOS and Linux. Navigate to your working directory and confirm that dcm2niix is installed and accessible.
Run the Conversion Command
Create an output folder and execute the
conversion command. The
-o option defines the
output location, while
-z y enables gzip
compression for NIfTI files.
Verify Your Converted Files
Open the destination folder to find your generated .nii.gz images and optional .json metadata sidecars. Review conversion messages and validate the image files before further analysis.
$ mkdir -p output_folder
$ dcm2niix -z y -o output_folder input_folder
Example Conversion Output
Your Converted Files
Common dcm2niix Commands & Options
dcm2niix provides command-line options to customize image conversion, output filenames, compression, and metadata export. The following commonly used parameters help you configure conversion tasks and maintain consistent imaging datasets.
| Option | Description | Command Example |
|---|---|---|
-o
Output Directory
|
Specifies the destination folder where converted NIfTI images and associated output files will be saved. The specified directory must exist. |
dcm2niix -o output_folder input_folder
|
-f
Filename Format
|
Customizes the output filename using text and supported format specifiers, helping organize converted scans with meaningful names. |
dcm2niix -f scan_%s input_folder
|
-z y
GZIP Compression
|
Enables gzip compression to create .nii.gz files. This provides a compressed alternative to uncompressed .nii output. |
dcm2niix -z y input_folder
|
-b y
JSON Sidecar
|
Enables BIDS-style JSON sidecar output containing relevant acquisition metadata alongside converted imaging files. |
dcm2niix -b y input_folder
|
-h
Help Information
|
Displays the available command-line parameters and usage information for the installed version of dcm2niix. |
dcm2niix -h
|
Combined Command Example
Apply multiple options in one command to control the destination, filename, compression, and metadata output.
# Create the output directory first
$ mkdir -p output_folder
# Convert DICOM images
$ dcm2niix -z y -b y -f scan_%s -o output_folder input_folder
Why Use dcm2niix for Medical Imaging?
dcm2niix helps researchers and imaging professionals work more effectively with medical imaging datasets. By providing a dependable bridge between scanner data and scientific analysis environments, it supports organized, repeatable, and flexible research workflows across different computing platforms.
A more organized imaging workflow means less time preparing datasets and more time focusing on meaningful research.
Simplified Research Workflows
Reduce unnecessary preparation steps and organize medical imaging datasets for smoother integration into scientific research projects.
Neuroimaging Software Compatibility
Prepare NIfTI datasets for established analysis environments such as FSL, SPM, and AFNI, which commonly use NIfTI-based imaging data.
Time-Saving Automation
Incorporate conversion tasks into scripts and processing pipelines to minimize repetitive manual work when handling multiple imaging sessions.
Consistent Dataset Organization
Use configurable file naming and output directories to maintain structured datasets that are easier to review, share, and manage.
Open-Source Flexibility
Benefit from freely available software that can be incorporated into academic, institutional, and automated research environments without proprietary conversion licensing.
dcm2niix vs dcm2nii – What's the Difference?
Both dcm2niix and dcm2nii convert medical imaging data into research-friendly formats, but they serve different needs. dcm2niix is generally recommended for modern DICOM datasets, while the older dcm2nii may still be useful for certain archival imaging studies.
dcm2niix
Designed for modern scanner data and contemporary neuroimaging research.
Supports a wide range of contemporary MRI and CT DICOM formats and scanner workflows.
Optimized for practical conversion of modern image series and automated research datasets.
Provides NIfTI files and BIDS-style metadata sidecars for supported acquisitions.
Suitable for command-line automation and integration with modern neuroimaging tools.
dcm2nii
An older conversion utility with potential uses for historical medical imaging data.
May be useful for older proprietary image formats or archival studies with compatibility requirements.
Can provide an alternative when older imaging datasets are not handled as expected by newer conversion software.
Provides image conversion functionality, but lacks some newer features associated with dcm2niix.
Primarily relevant when maintaining older processing pipelines or working with legacy scanner datasets.
Which Converter Should You Choose?
Choose dcm2niix for most modern DICOM-to-NIfTI conversion projects, particularly those involving contemporary scanners and research pipelines. Consider dcm2nii when working with specific older proprietary formats. Always verify converted image orientation and metadata before scientific analysis.
Troubleshooting Common dcm2niix Issues
Experiencing conversion errors or unexpected output? Explore common dcm2niix problems, identify possible causes, and follow practical troubleshooting steps to resolve installation, file conversion, and imaging compatibility issues.
Installation Error
dcm2niix Command Not Found
Possible Cause
The executable may not be installed correctly, or its location is missing from the system PATH environment variable.
Solution
Verify the installation, use the full executable path, or add the installation directory to PATH. Reopen the terminal and check the available commands.
dcm2niix -h
Conversion Error
DICOM Files Not Converting
Possible Cause
Input files may be incomplete, corrupted, inaccessible, or stored in an unsupported DICOM variant.
Solution
Confirm the source folder contains valid DICOM images. Review conversion warnings, ensure the image series is complete, and try a current compatible release of dcm2niix.
Output Error
Missing NIfTI Output Files
Possible Cause
The output directory may be incorrect, missing, or inaccessible. Conversion may also have stopped due to an input file error.
Solution
Make sure the destination directory exists and has write permissions. Set the output location using -o and review terminal messages for errors.
dcm2niix -o output_folder input_folder
Image Validation
Incorrect Image Orientation
Possible Cause
Viewer conventions, unusual acquisition geometry, or differences in spatial orientation information may cause unexpected image displays.
Solution
Compare the original DICOM images with the converted NIfTI data in a reliable imaging viewer. Check spatial metadata and avoid manually flipping image axes without validation.
Everything You Need to Know About dcm2niix
Find clear answers to common questions about dcm2niix, including software compatibility, DICOM to NIfTI conversion, installation methods, output formats, and practical command-line usage.
General & Software FAQs
Basic information and compatibility
What is dcm2niix used for?
dcm2niix is used to convert supported DICOM medical images into NIfTI format. Researchers commonly use it to prepare MRI, CT, and other imaging datasets for compatible scientific analysis software.
Is dcm2niix free and open source?
Yes. dcm2niix is freely available as an open-source project. Its source code is publicly accessible, and users can obtain compatible builds or install the software through supported package managers.
Which operating systems support dcm2niix?
dcm2niix supports Windows, macOS, and Linux. Installation methods differ by platform, including compiled executables, operating system package managers, and Conda-based environments.
Does dcm2niix support MRI and CT images?
Yes. dcm2niix supports many MRI and CT DICOM datasets. Compatibility depends on the scanner manufacturer, acquisition type, and specific DICOM encoding used in the original images.
What is the difference between DICOM and NIfTI?
DICOM is a standard for storing and exchanging medical images with associated information. NIfTI is an image format commonly used to represent multidimensional brain imaging data in scientific research.
Can dcm2niix convert multiple DICOM files?
Yes. dcm2niix can process multiple supported DICOM images and series from an input directory. This makes it useful for preparing larger imaging collections and automating repetitive conversion tasks.
Does dcm2niix require an internet connection?
No. Once the required software is installed, dcm2niix can convert local DICOM files without an active internet connection. Internet access may be needed to download the software or updates.
Is dcm2niix suitable for neuroimaging research?
Yes. dcm2niix is widely used in neuroimaging research to prepare datasets for software such as FSL, SPM, and AFNI. Converted images should be checked before subsequent analysis.
Is dcm2niix the same as dcm2nii?
No. dcm2niix is the newer converter, generally preferred for modern DICOM datasets. The older dcm2nii may remain useful for certain legacy imaging formats and archival workflows.
Can beginners use dcm2niix?
Yes. Beginners can use dcm2niix by following installation instructions and basic command-line examples. Familiarity with folders, terminal commands, and medical imaging formats is helpful.
Installation & Conversion FAQs
Commands, output formats and setup
How do I install dcm2niix on Windows?
Download a compatible Windows release,
extract the archive, and locate
dcm2niix.exe. Run the executable
from Command Prompt or PowerShell, or
configure its folder in PATH for easier access.
How do I install dcm2niix on macOS?
On macOS, you can install dcm2niix using
Homebrew with brew install dcm2niix.
After installation, open Terminal and
run dcm2niix -h to verify
that the command is available.
How do I install dcm2niix on Linux?
On supported Debian-based distributions,
use sudo apt install dcm2niix.
Other Linux environments may use Conda,
available packages, or compatible
binaries from project releases.
Can I install dcm2niix using Conda?
Yes. dcm2niix is distributed through
conda-forge. Run
conda install -c conda-forge dcm2niix
in your selected Conda environment to
install the available package.
Can I use dcm2niix with Python?
Yes. A dcm2niix package is available
through PyPI. Python applications can
also invoke the installed command-line
executable using modules such as
subprocess for automated workflows.
What command converts DICOM to NIfTI?
A basic conversion command is
dcm2niix input_folder.
To write compressed NIfTI files into an
existing destination directory, use
dcm2niix -z y -o output_folder input_folder.
What output files does dcm2niix create?
dcm2niix generates NIfTI images in
.nii or
.nii.gz format, depending
on the selected compression settings.
It can also produce JSON sidecar files
containing relevant acquisition metadata.
How do I enable NIfTI compression?
Use the -z y option when
running dcm2niix. This enables gzip
compression and creates
.nii.gz files instead of
standard uncompressed NIfTI output.
How do I export JSON metadata?
Use -b y to enable
BIDS-style JSON sidecar output.
The generated metadata can include
useful acquisition parameters, depending
on the original DICOM data.
How can I check my dcm2niix version?
Open your terminal and run
dcm2niix -h. The help
output typically includes build or
version information along with the
supported command-line options.