Skip to content

Full jpg decompression support #45

Description

@dicom

Currently, the ruby-dicom library is only able to handle a small subset of the compressed transfer syntaxes allowed in the DICOM standard. For Run Length Encoding, we have a straight ruby implementation, and for jpg encoded image data, we try to use RMagick to decode the images. This works fine for some of the 'simpler' jpg variants, however, surprisingly enough, it seems that RMagick (in reality ImageMagick) is not able to handle all of the JPG variants. For example the following 3 variants have been shown to fail:

  • 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]): Default Transfer Syntax for Lossless JPEG Image Compression
  • 1.2.840.10008.1.2.4.90 - JPEG 2000 Image Compression (Lossless Only)

It would be awesome if ruby-dicom were able to decompress the pixel data in all DICOM files, no matter the compression algorithm used. What would be a good way to achieve this?

Look at how other open source libraries, e.g. GDCM, dcmtk, etc do it?

Use an alternative JPEG library? Some time ago I briefly checked out the PVRG-JPEG library, which seems to handle everything that is jpeg. It exists in the Ubuntu repositories, where it can be installed and run through terminal. For source code, and some additional information, check out this link:
http://www.panix.com/~eli/jpeg/

Any suggestions, or even better yet, code contributions, are welcome!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions