Dicom Toolkit - dicomread


: image = dicomread (filename)
: image = dicomread (structure)
: image = dicomread (___, propertyname, propertyvalue)
: [image, cmap] = dicomread (___)

Load the image from a DICOM file.

Inputs

filename - a string giving the filename.*

structure - a structure with a field Filename (such as returned by dicominfo).

propertyname, propertyvalue - property name (string), property value for additional properties to function.

Known properties are:

frames

Either ’all’ (default), a scalar frame value or vector of frame values.

UseRVHeuristic

Value is currently silently ignored.

Outputs

image - An integer or float matrix will be returned, the number of bits will depend on the file. The image may be two or three dimensional, depending on the content of the file.

cmap - Cx3 colormap associated with the image. Each row is a 3 element RGB triplet ion the range of 0 .. 1. If the image does not have a color map, colormap is []

Examples

Load the image data of a dcm file:

> image = dicomread(file_in_loadpath('imdata/simple-test.dcm'))
image =
  0  0  0  0  0
  0  0  0  0  0
  0  0  0  0  0
  0  0  0  0  0
  0  0  0  0  0
  0  0  0  0  0
  0  0  0  0  0
  0  0  0  0  0
  0  0  0  0  0
  0  0  0  0  0

Load the 1st and 10th frame of image data from a dcm file:

> file = file_in_loadpath('imdata/US-PAL-8-10x-echo.dcm');
> X = dicomread (file, 'frames;, [1, 10]);

See also: dicominfo.