dicomread

Reads DICOM image from DICOM file.

Attention: Valid only with Altair DICOM Extension.

Syntax

img=dicomread(filename)

img=dicomread(info)

Inputs

filename
Path of the DICOM file.
Type: string
info
Output of dicominfo.
Type: struct

Outputs

img
DICOM image data.
2D matrix if image is a single frame.
3D matrix if image is a multi frame, MxNxP matrix where P represents the frame.
Type: matrix

Example

dicomread example single frame.

img = dicomread('Path/To/File/0015.DCM');
      imwrite(img,'test.png')  
      size(img)
ans = [Matrix] 1 x 2
1024  1024

dicomread example multi frame.

img = dicomread('Path/To/File/1-1.DCM');
      size(img)
      imwrite(img(:,:,22),'test.png') %writing frame 22 to a png file
ans = [Matrix] 1 x 3
436  436  281

dicomread example single frame using info.

info = dicominfo('Path/To/File/0015.DCM');
        img = dicomread(info);
      imwrite(img,'test.png')  
      size(img)
ans = [Matrix] 1 x 2
1024  1024