Main Content

Read Image Data from DICOM Files

To read image data from a DICOM file, use thedicomreadfunction. Thedicomread函数读取files that comply with the DICOM specification but can also read certain common noncomplying files.

When usingdicomread, you can specify the file name as an argument, as in the following example. The example reads the sample DICOM file that is included with the toolbox.

I = dicomread('CT-MONO2-16-ankle.dcm');

You can also use the metadata structure returned bydicominfoto specify the file you want to read, as in the following example.

info = dicominfo('CT-MONO2-16-ankle.dcm'); I = dicomread(info);

View DICOM Images

To view the image data imported from a DICOM file, use one of the toolbox image display functionsimshoworimtool. Note, however, that because the image data in this DICOM file is signed 16-bit data, you must use the autoscaling syntax with either display function to make the image viewable.

imshow(I,'DisplayRange',[])

See Also

Apps

Functions

Related Topics