The READ_IMAGE function reads the image contents of a file and returns the image in an IDL variable. If the image contains a palette it can be returned as well in three IDL variables. READ_IMAGE returns the image in the form of a two-dimensional array (for grayscale images) or a (3, n, m) array (for TrueColor images). READ_IMAGE can read most types of image files supported by IDL. See QUERY_IMAGE for a list of supported formats.
The following statements open and display a DICOM image file:
image = READ_IMAGE (FILEPATH('mr_knee.dcm',$
Result = READ_IMAGE (Filename [, Red, Green, Blue] [, IMAGE_INDEX=index] )
Result is the image array read from the file or scalar value of -1 if the file could not be read.
A scalar string containing the name of the file to read.
An optional named variable to receive the red channel of the color table if a color table exists.
An optional named variable to receive the green channel of the color table if a color table exists.
An optional named variable to receive the blue channel of the color table if a color table exists.
Set this keyword to the index of the image to read from the file. The default is 0, the first image.