Charls with medical-imaging.

Sep 30, 2009 at 2:47 PM

I am trying to make charls decode dicom images compressed by the dcm4che image archive. Unfortunately without much luck. 

I manage to run JpegLsReadHeader and it returns correct values. This can be verified by comparing to the dicom encoded values. 

However, when I try to decode the pixel-data I get an error caused by an exception thrown from scan.h:268.

- So how to proceed from here ?

The header is:

width = 512
height = 512
bitspersample = 16
bytesperline = 1024
components = 1
allowedError = 0
ilv = 0
color xform = 0
bgrout = 0

and I use charls 1.0.1 beta 9. Sep. - compiled on a redhat el5.


Oct 1, 2009 at 9:52 AM

I now think that I know what is going on. Dcm4che uses jai for compressing to jpeg-ls, and that implementation has an issue with images that has more than 8 bits per sample.


The bug is described here:

Oct 2, 2009 at 8:33 PM


Thanks for the feedback. I don't know about jai's level of JPEG-LS compliance, which appears to be the issue here. The link you posted is not working for me. If you have specific images that worry you, you can check them against the UBC implementation, and if that leaves you with questions, post the images/bitstreams to me. I can parse Dicom if that's your format.