READ_DICOM
The READ_DICOM function reads an image from a DICOM file along with any associated color table.The return array type depends on the DICOM image pixel type.
This routine is written in the IDL language. Its source code can be found in the file read_dicom.pro
in the lib
subdirectory of the IDL distribution.
Examples
TVSCL,READ_DICOM(FILEPATH('mr_knee.dcm',$
SUBDIR=['examples','data']))
Syntax
Result = READ_DICOM (Filename [, Red, Green, Blue] [, IMAGE_INDEX=index] [, /DICOMEX] )
Return Value
The return value can be a 2-D array for grayscale or a 3-D array for TrueColor images. TrueColor images are always returned in pixel interleave format. The return value will be 0 (zero) if Filename is not a valid DICOM file.
Arguments
Filename
This argument is a scalar string that contains the full pathname of the file to read.
Red, Green, Blue
Named variables that will contain the red, green, and blue color vectors from the DICOM file if they exist.
Note: DICOM color vectors contain 16- bit color values that may need to be converted for use with IDL graphics routines.
Keywords
IMAGE_INDEX
Set this keyword to the index of the image to read from the file.
DICOMEX
By default, if the IDLffDicomEx object is available, IDL uses the IDLffDicomEx object to read the DICOM file. If this object is not available or if this keyword is set to 0, IDL uses the IDLffDICOM object to read the DICOM file.
Note: READ_DICOM always returns the image array in DICOM format where the first pixel in the returned array is the top left-hand pixel in the frame. This is different than the IDLffDicomEx::GetPixelData method, which returns pixel data in standard IDL format where the first pixel in the returned array is the bottom left-hand pixel in the frame.
Version History
5.2 |
Introduced |
6.2 |
Added DICOMEX keyword |