Arunkumar Kathirvel
Arunkumar Kathirvel

Reputation: 264

How to decompress jpeg2000 encoded files using OpenJPEG?

I doing an image service to decompress dicom images ans save them as BMP(using dcmtk). Incase of jpeg2000 it is adviced to use OpenJPEG(2.1.1). How can i pass the compressed image to OpenJPEG and get Uncompressed image back. Suggestions are welcomed..

Upvotes: 0

Views: 2622

Answers (1)

malat
malat

Reputation: 12490

Here is a simple way, since you are receiving DICOM with JPEG 2000 encapsulated stream in it, simply pass the DICOM directly to GDCM to uncompress it. Then forward the decompressed DICOM to your regular DCMTK pipeline:

$ gdcmconv --raw input_jp2.dcm output_raw.dcm

GDCM by default is build with OpenJPEG 2.1.x.

Of course, if you are familiar with C++, you could directly call the C++ API directly, in particular have a look at the class gdcm::ImageChangeTransferSyntax.

Reference:

Upvotes: 2

Related Questions