Convert DICOM images to JPEG

May 6th, 2009 | Tags: , ,

Medical images, e.g. X-Rays, are commonly stored in the DICOM format. By default you won’t be able to open these in Ubuntu, but there is actually a package in the repositories which lets you convert DICOM image files to more common formats, e.g. JPEG, PNG or bitmap.

sudo apt-get install dcmtk
dcmj2pnm +oj img00000 img00000.jpg

The above commands will install the dcmtk package and take a DICOM image img00000 and convert it to lossy JPEG image img00000.jpg. The dcmj2pnm command also supports other output formats, e.g. PNG. To print the help text simply run

dcmj2pnm -h

There are other commands in the dcmtk package, e.g. dcmcjpeg which provides a lot of JPEG encoding options.

  1. drapsag
    February 15th, 2010 at 16:36
    Reply | Quote | #1

    thanx! works like a charm