Matlab:dicomread读取dicom文件函数

功能:读取 DICOM 图像

Syntax

X = dicomread(filename)
X = dicomread(info)%%
[X,map] = dicomread(...)
[X,map,alpha] = dicomread(...)
[X,map,alpha,overlays] = dicomread(...)
[...] = dicomread(filename, 'frames', v)
[...] = dicomread(___,'UseVRHeuristic',TF)

Description

X = dicomread(filename) 通过从dicom文件名,读取图像数据。(单帧图像,返回MxN数组;单帧彩色图像返回MxNx3数组;多帧图像返回4-D数组)

X = dicomread(info) 通过读取Dicom头文件的元数据结构体,读取图像信息。

[X,map] = dicomread(...) returns the image X and the colormap map. If X is a grayscale or true-color image, map is empty.

[X,map,alpha] = dicomread(...) returns the image X, the colormap map, and an alpha channel matrix for X. The values of alpha are 0 if the pixel is opaque; otherwise they are row indices into map. The RGB value in map should be substituted for the value in X to use alphaalpha has the same height and width as X and is 4-D for a multiframe image.

[X,map,alpha,overlays] = dicomread(...) returns the image X, the colormap map, an alpha channel matrix for X, and any overlays from the DICOM file. Each overlay is a 1-bit black and white image with the same height and width as X. If multiple overlays are present in the file, overlays is a 4-D multiframe image. If no overlays are in the file,overlays is empty.

[...] = dicomread(filename, 'frames', v) reads only the frames in the vector vfrom the image. v must be an integer scalar, a vector of integers, or the string 'all'. The default value is 'all'.

[...] = dicomread(___,'UseVRHeuristic',TF) instructs the parser to use a heuristic to help read certain noncompliant files which switch value representation (VR) modes incorrectly. dicomread displays a warning if the heuristic is used. When TFis true (the default), a small number of compliant files will not be read correctly. Set TFto false to read these compliant files.

Class Support

X can be uint8int8uint16, or int16map must be double. alpha has the same size and type as Xoverlays is a logical array.

Examples

Use dicomread to retrieve the data array, X, and colormap matrix, map, needed to create a montage.

[X, map] = dicomread('US-PAL-8-10x-echo.dcm');
montage(X, map, 'Size', [2 5]);

Call dicomread with the information retrieved from the DICOM file using dicominfoand display the image using imshow. Adjust the contrast of the image usingimcontrast.

info = dicominfo('CT-MONO2-16-ankle.dcm');
Y = dicomread(info);
figure, imshow(Y);
imcontrast;

常规例子: 

info = dicominfo([dicom_pat_path '\' image_name]);%功能:图像处理函数,从指定的dicom文件中读取大量dicom元数据信息
CT = double(dicomread(info));

  • 1
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值