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.
- info
- Output of dicominfo.
Outputs
- img
- DICOM image data.
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