Skip to content

DICOM thumbnail generation fails for JPEG 2000 compressed images #1332

@lassoan

Description

@lassoan

Thumbnail generation fails for images with TransferSyntax="JPEG 2000 (Lossless only)". Probably this is because DCMTK implements support for decoding such images in a commercial module (see https://dicom.offis.de/dcmjp2k.php.en). This made sense 10-20 years ago, when this transfer syntax was new, but not anymore, especially since its main competitor, pydicom, and other DICOM toolkits, such as GDCM support it for free.

I've generated an implementation using Claude Opus 4.5 - it required only a few prompts, now it works well!

Implementation in DCMTK: https://github.com/lassoan/DCMTK/tree/add-dcmjp2k

What remains to be done is to build OpenJPEG (https://github.com/uclouvain/openjpeg.git) as part of Slicer superbuild and pass it to CTK and Slicer builds. See testing code here (hardcoded paths should be replaced by path from the superbuild):
lassoan@943ae91
lassoan/Slicer@bde26d0

There is also a free free implementation, but the chatbot-generated code looks cleaner (and it is integrated into DCMTK).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions