or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/dcm2niix@1.0.x

docs

index.md
tile.json

tessl/pypi-dcm2niix

tessl install tessl/pypi-dcm2niix@1.0.5

Command-line application that converts medical imaging data from DICOM format to NIfTI format with BIDS support

supported-formats.mddocs/reference/

Supported DICOM Formats

dcm2niix supports a wide range of DICOM transfer syntaxes, modalities, and manufacturers.

Capabilities

Uncompressed Transfer Syntaxes

Standard DICOM transfer syntaxes without compression.

1.2.840.10008.1.2     Implicit VR Little Endian (default)
1.2.840.10008.1.2.1   Explicit VR Little Endian
1.2.840.10008.1.2.2   Explicit VR Big Endian

Implicit VR Little Endian:

  • Most common DICOM transfer syntax
  • Value Representation (VR) is implicit from data dictionary
  • Little-endian byte order (LSB first)

Explicit VR Little Endian:

  • VR explicitly stated in each data element
  • Little-endian byte order
  • More robust parsing

Explicit VR Big Endian:

  • VR explicitly stated
  • Big-endian byte order (MSB first)
  • Less common, typically older equipment

Run-Length Encoding

Lossless compression using run-length encoding.

1.2.840.10008.1.2.5   RLE Lossless

RLE Lossless:

  • Lossless compression using run-length encoding
  • Effective for images with large uniform regions
  • Typical compression ratio: 1.5:1 to 3:1
  • Native support, no external libraries required

JPEG Compression

JPEG-based transfer syntaxes for lossy and lossless compression.

1.2.840.10008.1.2.4.50   JPEG Baseline (lossy, 8-bit)
1.2.840.10008.1.2.4.51   JPEG Extended (lossy, 12-bit)
1.2.840.10008.1.2.4.57   JPEG Lossless, Non-Hierarchical (Process 14)
1.2.840.10008.1.2.4.70   JPEG Lossless, Non-Hierarchical, First-Order Prediction (Process 14, Selection Value 1)

JPEG Baseline (1.2.840.10008.1.2.4.50):

  • Lossy compression, 8-bit samples
  • Standard JPEG compression algorithm
  • Typical compression ratio: 10:1 to 20:1
  • Handled by included NanoJPEG or optional libjpeg-turbo

JPEG Extended (1.2.840.10008.1.2.4.51):

  • Lossy compression, 12-bit samples
  • Extended JPEG for higher bit depths
  • Limited to 12-bit maximum
  • Less common

JPEG Lossless Process 14 (1.2.840.10008.1.2.4.57, 1.2.840.10008.1.2.4.70):

  • Lossless JPEG compression
  • Preserves exact pixel values
  • Typical compression ratio: 2:1 to 3:1
  • Native support included

JPEG-LS Compression

Lossless and near-lossless JPEG compression (requires CharLS library).

1.2.840.10008.1.2.4.80   JPEG-LS Lossless
1.2.840.10008.1.2.4.81   JPEG-LS Lossy (Near-Lossless)

JPEG-LS Lossless (1.2.840.10008.1.2.4.80):

  • Lossless compression optimized for continuous-tone images
  • Better compression than JPEG Lossless
  • Typical compression ratio: 2:1 to 4:1
  • Requires CharLS library (compile-time option)

JPEG-LS Near-Lossless (1.2.840.10008.1.2.4.81):

  • Near-lossless with bounded error
  • Higher compression than lossless
  • Controlled maximum absolute error
  • Requires CharLS library

JPEG2000 Compression

Wavelet-based compression for lossless and lossy modes (requires OpenJPEG or Jasper).

1.2.840.10008.1.2.4.90   JPEG 2000 Lossless
1.2.840.10008.1.2.4.91   JPEG 2000 Lossy

JPEG 2000 Lossless (1.2.840.10008.1.2.4.90):

  • Wavelet-based lossless compression
  • Better compression than JPEG Lossless
  • Typical compression ratio: 2:1 to 4:1
  • Requires OpenJPEG or Jasper library (compile-time option)
  • Supports high bit depths (up to 16-bit)

JPEG 2000 Lossy (1.2.840.10008.1.2.4.91):

  • Wavelet-based lossy compression
  • Adjustable quality/compression trade-off
  • Typical compression ratio: 10:1 to 50:1
  • Better image quality than JPEG at high compression

Experimental Transfer Syntaxes

Newer experimental compression formats.

1.2.840.10008.1.2.4.201   JPEG XS
1.2.840.10008.1.2.4.203   JPEG XS Progressive

JPEG XS:

  • Experimental, low-latency lightweight compression
  • Designed for real-time applications
  • Support varies, not widely used
  • May require specific library support

Deflated Transfer Syntax

Zlib-compressed DICOM.

1.2.840.10008.1.2.1.99   Deflated Explicit VR Little Endian

Deflated Explicit VR Little Endian:

  • DICOM data compressed with zlib/deflate
  • Entire dataset compressed, not just pixel data
  • Requires inflation before processing
  • Uncommon in medical imaging

Supported DICOM Modalities

Medical imaging modalities recognized and converted by dcm2niix.

CR   Computed Radiography
CT   Computed Tomography
MR   Magnetic Resonance
PT   Positron Emission Tomography (PET)
US   Ultrasound

Computed Radiography (CR):

  • Digital X-ray imaging
  • Single 2D images
  • Grayscale

Computed Tomography (CT):

  • X-ray based cross-sectional imaging
  • 3D volumes from axial slices
  • Supports gantry tilt correction
  • Hounsfield units (HU)

Magnetic Resonance (MR):

  • Primary focus of dcm2niix
  • All MR sequences: T1, T2, FLAIR, DWI, DTI, BOLD, ASL, etc.
  • Multi-echo, multi-coil, complex data
  • Vendor-specific features (Siemens CSA, Philips enhanced, GE)

Positron Emission Tomography (PT/PET):

  • Nuclear medicine imaging
  • Static and dynamic acquisitions
  • Multi-frame support
  • Decay correction metadata extraction

Ultrasound (US):

  • Real-time imaging
  • Single frames or cine loops
  • Color Doppler support

Supported Manufacturers

Vendor-specific handling and optimizations.

Siemens        Siemens Healthineers
GE             GE Healthcare
Philips        Philips Medical Systems
Canon          Canon Medical Systems (formerly Toshiba)
Toshiba        Toshiba Medical Systems
Mediso         Mediso Medical Imaging Systems
Hitachi        Hitachi Medical Systems
UIH            United Imaging Healthcare
MRSolutions    MR Solutions
Hyperfine      Hyperfine Research
Bruker         Bruker BioSpin
Leica          Leica Biosystems

Vendor-Specific Features

Siemens:

  • CSA (Common Siemens Architecture) header parsing
  • Mosaic format handling (e.g., multi-slice EPI stored as single image)
  • Diffusion gradient direction extraction from CSA
  • Private tag extractions (coil names, sequence details)

Philips:

  • Enhanced DICOM format support
  • Precise floating-point scaling (RWV - Real World Values)
  • Private tag parsing (scaling slope/intercept)
  • Multi-frame enhanced MR support

GE:

  • Private tag extraction (internal pulse sequence names)
  • Diffusion gradient cycling mode detection
  • GE-specific sequence identification

Canon/Toshiba:

  • Private tag recognition
  • Vendor-specific metadata extraction

UIH (United Imaging Healthcare):

  • Private tag support
  • Emerging vendor compatibility

Other Vendors:

  • Generic DICOM handling
  • Standard tag extraction
  • May lack vendor-specific optimizations

DICOM Storage Classes

DICOM SOP classes recognized by dcm2niix.

1.2.840.10008.5.1.4.1.1.4      MR Image Storage
1.2.840.10008.5.1.4.1.1.2      CT Image Storage
1.2.840.10008.5.1.4.1.1.128    PET Image Storage
1.2.840.10008.5.1.4.1.1.66     Segmentation Storage
1.2.840.10008.5.1.4.1.1.66.4   Segmentation Storage (Enhanced)
1.2.840.10008.5.1.4.1.1.77.1.6 VL Microscopic Image Storage

MR Image Storage:

  • Standard MR DICOM images
  • Single-frame and multi-frame
  • All MR sequences

Enhanced MR Image Storage:

  • Multi-frame enhanced MR DICOM
  • Per-frame metadata
  • Philips enhanced DICOM

CT Image Storage:

  • Standard CT DICOM images
  • Axial, sagittal, coronal reconstructions

PET Image Storage:

  • PET images with activity concentrations
  • Static and dynamic acquisitions

Segmentation Storage:

  • DICOM segmentation objects
  • Binary and fractional segmentations
  • May extract as separate ROI files

Compilation Options

Optional features that can be enabled/disabled at compile time.

Default Compilation

  • Uncompressed transfer syntaxes
  • RLE compression
  • JPEG Lossless (classic)
  • NanoJPEG for lossy JPEG (or libjpeg-turbo option)
  • miniz or zlib for NIfTI gzip compression

Optional Compilation Features

CharLS Support:

cmake -DUSE_JPEGLS=ON ..

Enables JPEG-LS lossless and near-lossless transfer syntaxes.

OpenJPEG Support:

cmake -DUSE_OPENJPEG=ON ..

Enables JPEG2000 lossless and lossy transfer syntaxes.

CloudFlare zlib:

cmake -DZLIB_IMPLEMENTATION=Cloudflare ..

Uses optimized zlib for faster gzip compression (2008+ CPU features).

libjpeg-turbo:

cmake -DUSE_TURBOJPEG=ON ..

Replaces NanoJPEG with faster libjpeg-turbo for lossy JPEG.

JNIfTI Support:

cmake -DmyEnableJNIFTI=ON ..

Enables JSON-based NIfTI formats (-e j and -e b).

Limitations and Unsupported Features

Transfer Syntaxes Not Supported

  • Proprietary vendor-specific compression (pre-DICOM formats)
  • Some rare JPEG variants
  • MPEG video compression (for DICOM video)
  • H.264/H.265 video compression

Image Types with Limited Support

  • Cine loops (exported as 4D volumes)
  • Spectroscopy (MRS) - use spec2nii tool instead
  • Waveforms (ECG, respiratory traces) - not extracted
  • Structured reports (SR) - not converted
  • Presentation states - limited extraction
  • Spatial registration objects - not processed

Pre-DICOM Formats

dcm2niix is designed for DICOM. For older proprietary formats:

  • GE Genesis/LX: Use dcm2nii (predecessor tool)
  • Siemens Numaris 3: Use dcm2nii
  • Elscint: Use dcm2nii
  • Bruker ParaVision: Use Bru2Nii or similar tools
  • Philips PAR/REC: Use dicm2nii or parrec2nii

Checking Supported Formats

To verify which optional features are compiled into your dcm2niix binary:

dcm2niix --version

Output will indicate:

  • Compiler used
  • Optional libraries included (JPEGLS, JP2, OpenJPEG, etc.)
  • Build date
  • Version string

Example output:

Chris Rorden's dcm2niiX version v1.0.20250506  Clang11.0.0 x86-64 (64-bit MacOS) JPEGLS JP2:OpenJPEG

Indicators:

  • JPEGLS - CharLS support enabled
  • JP2:OpenJPEG - JPEG2000 via OpenJPEG
  • JP2:Jasper - JPEG2000 via Jasper
  • No indicator - only default formats supported

Installation Methods and Format Support

PyPI Package (pip install dcm2niix)

  • Typically includes default formats
  • May include JPEGLS and OpenJPEG depending on platform
  • Check with dcm2niix --version

Conda (conda install -c conda-forge dcm2niix)

  • Usually includes most optional libraries
  • JPEGLS and OpenJPEG typically enabled

Homebrew macOS (brew install dcm2niix)

  • Includes JPEGLS and OpenJPEG
  • CloudFlare zlib for optimized compression

GitHub Releases (pre-compiled binaries)

  • Varies by release
  • Check release notes for included features

Building from Source

  • Full control over enabled features
  • Can enable all optional libraries
  • See COMPILE.md in repository

Format Recommendations

For Maximum Compatibility:

  • Request uncompressed or RLE transfer syntax from PACS
  • Avoids external library dependencies

For Maximum Compression:

  • Use JPEG2000 or JPEG-LS if available
  • Better compression than classic JPEG Lossless

For Fastest Processing:

  • Uncompressed or RLE
  • No decompression overhead

For Quantitative Analysis:

  • Lossless only: RLE, JPEG Lossless, JPEG-LS Lossless, JPEG2000 Lossless
  • Avoid lossy compression (baseline JPEG, lossy JPEG2000)

Notes

  • dcm2niix automatically detects transfer syntax from DICOM headers
  • Missing library support results in error message with transfer syntax UID
  • Most clinical DICOM uses uncompressed or JPEG Lossless
  • Research datasets may use JPEG2000 or JPEG-LS
  • Very old scanners may use proprietary pre-DICOM formats (use dcm2nii instead)