Codecs

December 6, 2017 ยท View on GitHub

The cornnerstoneWADOImageLoader uses the following third party libraries to decode the various ways DICOM images are compressed:

  1. OpenJPEG.js for JPEG2000 images. Based on the OpenJPEG library

  2. OHIF/image-JPEG2000 For JPEG2000 Images. Based on the PDF.js library

  3. CharLS.js for JPEG-LS images. Based on the CharLS library

  4. JPEGLossless Decoder JS for JPEG Lossless images.

  5. JPEG Lossy for JPEG Lossy images. Based on notmasteryet with changes contributed by gSquared

  6. pako.js for deflate based images.

JPEG2000

The OpenJPEG based codec is the default codec for JPEG2000 images. This codec is the default because the OpenJPEG library is in wide use, activily supported and believed to be able to decode most of if not all JPEG2000 images found in medical imaging. The PDF.js library is not recommended as it has known issues that nobody is fixing and not actively supported. The performance of the PDF.js library may be better on some browsers or with some types of images, here are some benchmarks:

Images from ftp://medical.nema.org/MEDICAL/Dicom/DataSets/WG04/compsamples_j2k.tar

iMac Retina 5k Late 2014 4GHz Intel Core i7 Chrome 50.0.2661.102 (64 bit)

ImageOpenJPEGPDF.js
NM1_J2KR233 ms103 ms
CT1_J2KR424 ms147 ms
RG1_J2KR6058 ms2311 ms
MG1_J2KR19312 ms7380 ms

iMac Retina 5k Late 2014 4GHz Intel Core i7 FireFox 46.0.1

ImageOpenJPEGPDF.js
NM1_J2KR240 ms102 ms
CT1_J2KR185 ms91 ms
RG1_J2KR3445 ms1594 ms
MG1_J2KR10295 ms14207 ms

iMac Retina 5k Late 2014 4GHz Intel Core i7 Safari 9.1.1

ImageOpenJPEGPDF.js
NM1_J2KR64 ms56 ms
CT1_J2KR115 ms94 ms
RG1_J2KR2367 ms1567 ms
MG1_J2KR6496 ms18547 ms