Tuesday, August 21, 2007

Impressions of Compressions

There has been some talk on Aunt Minnie recently about compression, prompted by a Canadian study that showed you don't lose anything with lossy compression. Think about that one for a moment.

This prompted me to see for myself just how compression might affect an image. There is a ton of information on compression in this setting. Try the Wikipedia article on wavelet compression for starters. Frankly, the topic is so complex, I would have had to dust off my old engineering skills as well as my HP 41c, which I loaned to a physicist friend years ago. So, I thought it would be useful to (picto)graphically demonstrate what varying degrees of compression might do to a CT slice. I began with a DICOM image, the original size of which is 514 KB.




Then, using IrfanView, I applied JPEG 2000 compression (which uses wavelets) in varying degrees, with the results depicted below:











The number after "Lossy" is the degree of compression applied, which can range from 1 to 100, rather like the 1-12 selection offered for the original JPEG. IrfanView's JPEG 2000 compression plug-in uses the LuraWave JP2 module from LuraTech, if you're interested. You do have to keep in mind that I had to convert the images into regular JPEG for display here on Blogger.com, but you still get the idea. The image is pretty much unreadable at over 1:100 compression (I probably should have stated that as 100:1, but it's too late now!) However, I defy anyone to tell me that they can tell much difference between the higher quality compressions and the original. In particular, the lossless image is for all intent and purpose identical to the original, at least to my eye.

There are strong arguments made to store only the original full DICOM image, and this makes sense given the plummeting prices for storage. However, bandwidth, while ever less expensive, is still right up there. For example, we are having to consider the use of Metro Ethernet (MetroE) lines to boost the transmission speeds for our self-owned PACS. This will add somewhere from $50,000 to $100,000 to our yearly PACS expenses. Were we to use lossless compression, or even very high-level lossy compression, this would not be necessary. The question always comes down to this: Will I miss something on a compressed image that I would have seen on the full-fidelity original? Frankly, I don't think so.

4 comments :

Morten said...

Hmm, Dalai

"Lossless" really means lossless (for jpeg2000 it means it uses a fully reversible wavelet transformation) so there is *no* difference to the original image. Except for a slight performance penalty, there is no reason whatsoever not to use lossless compression.

Overall compression is not as good as your example would lead to believe though. Compressing CT, especially with the large amount of black in the images shown, are like shooting fish in a barrel. For the lossless case JPEG-LS usually gives slightly better results.

Dalai said...

This is obviously a gross demonstration of the possibilities of compression. Even if we assume a worst-case scenario of sorts that lossless only compresses the data by one-half, it still effectively doubles the bandwidth. Might as well take advantage. AGAIN, the real issue is whether or not something might be missed on a compressed image....

anders said...

Hi !
Of course what is visible or not after compression is a key question. But I would also like to point out the fact that performing compression/decompress on a whole set of images actually could be quite timeconsuming even on a modern pacs system. If this is not done with great care there is a great risk that some unnecessary performance issues might be evident. The theory is of course to compress/decompress as few times as possible but I have found that this is not always implemented by the suppliers.

Anonymous said...

You will find that the anatomical region being scanned greatly affects what is considered an acceptable level of compression.

For example, most radiologists I know don't like to read head CT at more than 10:1 lossy, while they are willing to go to 20 or 30:1 on abdomen slices.

This is believed to be due to the compression artifacts created from having a mix of bone and soft tissue in close proximity.