questions > dcm2niix error: Unable to decode JPEG. Please use dcmdjpeg to uncompress data.
Showing 1-2 of 2 posts
Display:
Results per page:
Mar 19, 2024  04:03 PM | Jiyao Liu
dcm2niix error: Unable to decode JPEG. Please use dcmdjpeg to uncompress data.

I want to convert dicom files to nifty files, but I got this problem.



This is the source code:



converter = Dcm2niix()
converter.inputs.source_dir = source_dir
converter.inputs.compression = 9
converter.inputs.output_dir = output_dir
converter.inputs.out_filename = 'DWI'
converter.inputs.bids_format = False
converter.run()


Could you please help me figure it out?

Mar 19, 2024  05:03 PM | Chris Rorden
RE: dcm2niix error: Unable to decode JPEG. Please use dcmdjpeg to uncompress data.

  1. You should upgrade to the latest version of dcm2niix (from 2024) instead of a version from 2021.
  2. You will want to install a version of dcm2niix that has support for compressed DICOM transfer syntaxes.

You can get dcm2niix here:


  https://github.com/rordenlab/dcm2niix/re...


dcm2niix can be compiled with or without support for compressed transfer syntaxes. You can see this in the first line of the output. For example, an executable that supports JPEG2000 (JP2) and JPEG-lossless (JP-LS) would report:


 


Chris Rorden's dcm2niiX version v1.0.20240202  (JP2:OpenJPEG) (JP-LS:CharLS) Clang12.0.0 ARM (64-bit MacOS)


If you are unable to install a modern version of dcm2niix compiled with support for compressed images, you can decompress your images using dcmdjpeg


 


https://support.dcmtk.org/docs/dcmdjpeg.html