How to decode manually JPEG Lossless, Non-Hierarchical, First-Order Prediction

2.5k Views Asked by At

I'm trying to create a DICOM viewer on my own, using only JavaScript and HTML5. I'm working on this project for the last few days and now I successfully parse all textual information I need and I can also correctly read and display uncompressed Grayscale and RGB images. Now I'm trying to display the so called "JPEG Lossless, Nonhierarchical, First- Order Prediction" type of image (in the DICOM file, it is enumarated with the Transfer Syntax Unique Identification: 1.2.840.10008.1.2.4.70) but I'm stuck. I want to read the Pixel Data of the image manually and build the image out of it. There is no actual information on how the bits are stored in the DICOM documentation and I really tried to find a good description of this kind of JPEG on the internet but with no success. Can you give me some advice on what exactly I have to read to solve my problem. Thank you all :)

2

There are 2 best solutions below

0
On

FYI, the Orthanc server for medical imaging already provides JPEG Lossless decompression through a REST API, which allows JavaScript/HTML5 applications to very easily display DICOM images in Web browsers. You can for instance have a look at the DWV plugin by Yves Martel.

0
On

Check this document, probably it leads you into the right direction JPEG Lossless Codec

There are also some more links which may help: dclunie jpeg sources