To read image data from a DICOM file, use the
dicomread function. The
dicomread function reads files that
comply with the DICOM specification but can also read certain common noncomplying
dicomread, 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
I = dicomread('CT-MONO2-16-ankle.dcm');
You can also use the metadata structure returned by
specify the file you want to read, as in the following example.
info = dicominfo('CT-MONO2-16-ankle.dcm'); I = dicomread(info);
To view the image data imported from a DICOM file, use one of the toolbox image display
imtool. 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.