questions > Error: OpenJPEG j2k_to_image failed to decode
Showing 1-5 of 5 posts
Display:
Results per page:
Jun 4, 2017  09:06 PM | jack gspm
Error: OpenJPEG j2k_to_image failed to decode
Hi,
Using dcm2niiX version v1.0.20170528 (OpenJPEG build) Clang8.0.0 (64-bit MacOS).
Error: OpenJPEG j2k_to_image failed to decode
Any ideas?
thanks!

jack
Jun 7, 2017  12:06 PM | Chris Rorden
RE: Error: OpenJPEG j2k_to_image failed to decode
Jack
 Thanks for bringing this to our attention. Clearly the JPEG2000 libraries are not always statically linked when the software is built with our new build system. I have sent you an executable that resolves this. Since this problem is specific to MacOS, you can also use the version of dcm2niix that is built-into MRIcro (Import menu)- this software is included with the NITRC MRIcroGL download. 

While dcm2niix can (will) be able to decode lossless JPEG2000 DICOM images, I strongly suggest that you do not use this format for storage. This encoding is not well supported, and the benefits are minimal compared to general file (zip/gz) or disk based compression. Using any rare format is problematic, and in this specific case one of the two popular open-source JPEG-2000 libraries does not handle the 16-bit images seen in medical imaging (https://en.wikipedia.org/wiki/JPEG_2000). This format also blocks you from using the fantastic and free dcmtk tools (http://dicom.offis.de/dcmjp2k.php.en  "This module is not freely available and must be licensed separately"). My personal opinion is that JPEG2000 has little future: it marginal benefit over the older, simpler, wildly popular classic JPEG. On the other hand, the modern HEIF format outperforms JPEG2000 and has seen widespread adoption in software and hardware allowing for little developer/computational cost for a better result (https://en.wikipedia.org/wiki/High_Effic...). While I am not sure if DICOM will adopt HEIF, I think the popularity of HEIF will hinder the development and support of JPEG2000.
Jun 9, 2017  12:06 PM | Chris Rorden
RE: Error: OpenJPEG j2k_to_image failed to decode
Ningfei Li fixed this in the latest release. Please test this out.
 https://github.com/rordenlab/dcm2niix/releases/tag/v1.0.20170609
Dec 30, 2023  01:12 PM | nora mila
RE: Error: OpenJPEG j2k_to_image failed to decode


The error regarding OpenJPEG's failure to decode JPEG2000 images can be resolved with the latest release of dcm2niix available at GitHub link. Another solution for MacOS is using the version of dcm2niix included in MRIcro (found in the Import menu) from NITRC MRIcroGL download.


Furthermore, I recommend avoiding JPEG2000 format for storage due to limited support, especially for 16-bit medical imaging. For better results, consider alternatives like HEIF format. Explore third party tool like JPEG Compressor for optional image formats and optimization.

Dec 31, 2023  05:12 PM | Chris Rorden
RE: Error: OpenJPEG j2k_to_image failed to decode

Please ensure a human audits the responses of generative AI when replying to forums. The question here is about DICOM, which does not support HEIF as a transfer syntax. Likewise, the external link you provide does not support DICOM images. You can see comments regarding DICOM JPEG compression here:  https://crnl.readthedocs.io/jpeg_formats...


I do sincerely appreciate community support, and encourage thoughtful responses to open questions. However, I have to admit that when I first saw this I thought it was a Turing test ( MILA = ML + AI )