Skip to main content

Using PICTools to Decode DICOM Pixel Data

office setting with desks, people, and computers

DICOM stands for Digital Imaging and Communications in Medicine. It is the standard format used for the management and communication of medical imaging information and associated data. It enables an integrated environment of medical imaging services such as computing tomography (CT), magnetic resonance imaging (MRI), and others. DICOM actually includes protocols and definitions for image storage and compression, image visualization, image presentation and reports on patient data and results. This blog will focus on the image component of DICOM files, and specifically on how to access and decode DICOM pixel data using Accusoft’s PICTools.

PICTools Medical

Accusoft offers a medical-specific version of PICTools called PICTools Medical. It supports lossy/lossless sequential JPEG, JPEG 2000, and JPEG-LS and can be used to encode or decode pixel data associated with these Transfer Syntax UIDs:

    • 1.2.840.10008. Lossy JPEG 8-bit samples
    • 1.2.840.10008. Lossy JPEG 12-bit samples
    • 1.2.840.10008. Lossless JPEG 2-bit to 16-bit samples
    • 1.2.840.10008. Lossless JPEG-LS 2-bit to 16-bit samples
    • 1.2.840.10008. Lossy JPEG-LS 2-bit to 16-bit samples
    • 1.2.840.10008. Lossless JPEG 2000 2-bit to 16-bit samples
    • 1.2.840.10008. Lossy JPEG 2000 2-bit to 16-bit samples
    • 1.2.840.10008. Lossless JPEG 2000 3D 2-bit to 16-bit samples
    • 1.2.840.10008. Lossy/Lossless JPEG 2000 3D 2-bit to 16-bit samples

According to the PICTools Programmer’s Guide, the approach taken by PICTools is to organize image compression/decompression technology into opcodes. Opcodes are basically modular cohesive libraries to enable said technology. In the case of PICTools Medical, here are the specific opcodes that are of interest:

  • OP_D2S(10) – High-Speed Sequential JPEG Compression
  • OP_S2D(11) – High-Speed Sequential JPEG Decompression
  • OP_D2SE(12) – High-Speed Sequential JPEG and ePIC Compression
  • OP_SE2D(18) – High-Speed Sequential JPEG and ePIC Decompression
  • OP_D2SEPLUS(64) – Sequential JPEG Compression Plus High Gray Support
  • OP_SE2DPLUS(65) – Sequential JPEG Decompression Plus High Gray Support
  • OP_J2KPRGB(66) – JPEG 2000 Compression
  • OP_J2KERGB(67) – JPEG 2000 Decompression
  • OP_J2KP(68) – JPEG 2000 Compression Plus High Bit Depths
  • OP_J2KE(69) – JPEG 2000 Decompression Plus High Bit Depths
  • OP_J2KP3D(78) – JPEG 2000 Part 2 3D Compression
  • OP_J2KE3D(79) – JPEG 2000 Part 2 3D Decompression
  • OP_J2KTRANSCODE(28) – JPEG 2000 Transcoder
  • OP_JLSP(60) – Compress DIB or RAW to JPEG-LS
  • OP_JLSE(61) – Expand JPEG-LS to DIB or Raw
  • OP_LIP3(46) – Lossless Image Compression (Lossless JPEG)
  • OP_LIE3(47) – Lossless Image Decompression (Lossless JPEG)
  • OP_LIP3PLUS(62) – Lossless Image Compression Plus High Gray Support
  • OP_LIE3PLUS(63) – Lossless Image Decompression Plus High Gray Support
  • OP_D2FPLUS(84) – Standard File Format Creation Plus GIF/LZW Support
  • OP_F2DPLUS(85) – Standard File Format Reading Plus GIF/LZW Support
  • OP_HDPHOTOP(26) – HD Photo Compression
  • OP_HDPHOTOE(27) – HD Photo Decompression

PICTools Medical also supports:

  • ISO 14495-1 (Accusoft’s JPEG LS)
  • ISO 15444-1 (Accusoft’s JPEG 2000)
  • ISO 15444-2 (Accusoft’s JPEG 2000 3D)
  • ISO 15444-9 (Accusoft’s JPIP)

For a more complete reference on DICOM Unique identifiers, please refer to the DICOM PS3.6 2019b Data Dictionary which includes Transfer Syntax UIDs used.

In the distribution of PICTools Medical, for each of the opcodes mentioned, a sample program that’s ready to use is included. For example, the lossy sequential JPEG decoder opcode, OP_SE2DPLUS, is demonstrated with the sample se2dnw.exe (Win) or se2dplx (Linux).

Learn how to access pixel data from DICOM files now. Download the rest of my article for a step-by-step process.


Neal Armstrong

Miguel Restrepo, SDK Software Development Manager

Miguel Restrepo joined Accusoft in 2018 as a software development manager in SDK. His teams provide development and support to BarcodeXpress, FormSuite, and PICTools. Miguel received his master’s and PhD degrees from the University of Illinois at Urbana-Champaign. Miguel has a passion for good communication and a positive, constructive approach to management and leadership. He enjoys software development, open source software, scientific computation, and other interesting projects and technologies like Raspberry Pi. When he’s not working, Miguel enjoys spending time with his wife and sons, gardening, cooking, and other fun activities.