Personal tools
You are here: Home / cmgui / Wiki / dicom
Log in

Forgot your password?



An MRI or CT scan produces a series of dicom images. These usually have the file extension .ima or .dcm

For a good introduction to the dicom format see:

Dicom images usually require specialised software to read and display them.


Cmgui can read dicom images in and use them to create volume textures. You can indicate an image is of dicom format by using dcm

# read in mri data and create a volume texture
gfx create texture tract image dcm:images/BIER_Peter_3_000.ima number_pattern 000 number_series 7 262 1 width 1 height 1 depth 1 distortion 0 0 0 colour 0 0 0 alpha 0 decal linear_filter resize_nearest_filter clamp_wrap;

Note that depending on what version you use, it may not support 12bit or 16bit dicom images. You can view the dicom header to determine how many bits your image is (see below for how to view header info). If 12 or 16 bits you may need to convert your images to another format first (see below for software which can do this).

Viewing and Conversion

If you are on a linux machine then chances are you already have the Image Magick tools installed. Try viewing your dicoms using the Image Magick display command 'display bob.dcm'. Note that some 16 bit or 12 bit dicoms can not be handled by Image Magick. If the image displays correctly you should be able to convert a dicom file into another graphics format using the convert command, eg:

convert bob.dcm bob.png

If the display command doesn't work on your dicom try using another viewer/converter.

Another option on linux for viewing and conversion is xmedcon (or medcon). This can be downloaded from

If on a windows machine ImageJ is a good viewer to use which can also convert to other formats. ImageJ is avaliable from You can also install it on windows and linux.

The DCM2JPG console application is another tool I have used for converting to jpg.

If you are using a Mac, the software OsiriX is a very powerful medical image viewer that can be used to view dicom images and header info.

Dicom headers

Note that the dicom format stores header information within the file as while as the captured image. The dicom header info contains useful data about the image and acquistion including how many mm per pixel and the slice thickness.

On a linux machine Image Magick can be used to extract some dicom header information by using the identify command in verbose mode (even if it is a 16 bit image):

identify -verbose bob.dcm

Alternatively you can use the identify option when converting to extract some info

convert -identify bob.dcm bob.jpg

Many other dicom related tools allow you to view header information. On a Mac I recommend using Osirix.