I'm developing a tool to compress DICOM images with Lossless JPEG. The
images have to be viewable on RadWorks 5.0.
My tool is based on the IJG source.
It worked for 24-bit color, 8 and 12-bit gray, but it was not working on 16
It seemed to be barfing on negative values.
My first idea was to shift all the values so that the values are in the
range 0 .. max, and set the Rescale Intercept value to get the original
values back when viewing.
This didn't seem to work very well, but if I shift one more, so the values
are in the range 1 .. max+1 then it works great!
This makes me feel good, but can anyone explain why? I'd rather not shift
the pixel values at all, if possible.
I can decode and display unshifted signed values with my own tool no
problem, it is just getting RadWorks to display the images that is giving me
I have the feeling that RadWorks is using the PICTools from Pegasus for
their Lossless JPEG routine.