dicom文件tag详解

dicom文件tag详解

Dicom全称是医学数字图像与通讯,这里讲diocm格式文件的tag标记做详细解读。
dicom中文协议文档:http://download.csdn.net/download/wenzhi20102321/9897014

dicom文件结构:

dicom文件,整体结构先是128字节所谓的导言部分,跳过就是了,然后是dataElement元素依次排列的方式, 就是一个dataElement接一个dataElement的方式排到文件结尾.我们要读取dicom里面的各种数据就是在各个数据元素中。通俗的讲dataElement就是指tag,就是破Dicom标准里定义的数据字典,每个dataElement中的tag决定自身或整个文件的某些数据类型或自身dataElement内容类别。

标记tag(2字节UInt16分组号和2字节UInt16元素号);

tag是4个字节表示的 前两字节是组号后两字节是元素号 比如0008(组号) 0018(元素号)。
我们获取dicom里面的数据,就是根据tag,来知道这个dataElement里面是否是我们需要的数据,然后读取该dataElement里面的数据。

一般我们获取dataElement中的数据的主要组号

0002组描述设备通讯,0008组描述特征参数,0010组描述患者信息,0028组描述图像信息参数
根据这些组号,我们大概就知道这个组的tag里面存放什么数据了吧!
还是有很多其他组号的,但是里面的数据不常用到,tag总共大约有2000个,但是我们常用的数据就那么几个!

dicom文件数据中所有dataElement从前到后按tag又可简单分段:文件元tag,普通tag,像素tag。

1.文件元tag(组号+0000):不受传输语法影响,总是以显示VR方式表示,因为它里面就定义了传输语法;文件元tag的dataElement,并没有多大的意义,它的VF数值是整个组所有dataElement的字节长度,一个dicom中可以只有一个文件元tag,也可以有多个文件元tag。

2.普通tag:除了文件元tag和像素tag,其余的都是普tag数据。包括:图像宽,高,数据传输格式,病人姓名,病人生日,病历医院,病历科室,病情的描述等等数据;

3.像素tag(7fe0,0010):表示dataElement存储的是病历的图像数据。

上面这段话,信息量其实是很多的,比如什么是显示VR、隐式VR,传输语法又是怎么回事?

最关键的两个tag:

1.tag:0002,0010,决定普通tag的读取方式 little字节序还是big字节序,隐式VR还是显示VR。由它的值决定

2.tag:7fe0,0010,像素数据开始处

使用工具snate DICOM打开dicom文件,查看数据效果:


工具下载地址,下载后直接用:http://download.csdn.net/download/wenzhi20102321/9895616
上面图片每一行数据就是一个dataElement数据,可以看到tag值,VR值,VL值,VF值。
但是一般工具也是看不到图像的tag数据,因为他的VF数据有几万个字节,怎么显示!
上面可以看到tag的组号和元素号,都是按照顺序从小到大的顺序排列的,dicom中dataElement也是这样排列的。
所以dicom文件都是前面先读取到很多数据,最后面再读取图像的字节数据。

下面是一部分重要的tag展示:

Patient Tag

Group(组号) Element(元素号) Tag Description 中文解释 VR
0010 0010 Patient’s Name 患者姓名 PN
0010 0020 P1atient ID患者ID LO
0010 0030 Patient’s Birth Date 患者出生日期 DA
0010 0032 Patient’s Birth Time 患者出生时间 TM
0010 0040 Patient’s Sex 患者性别 CS
0010 1030 Patient’s Weight 患者体重 DS
0010 21C0 Pregnancy Status 怀孕状态 US

Study Tag

Group Elemen Tag Description 中文解释 VR
0008 0050 Accession Number:A RIS generated number that identifies the order for the Study. 检查号:RIS的生成序号,用以标识做检查的次序. SH
0020 0010 Study ID 检查ID. SH
0020 000D Study Instance UID: Unique identifier for the Study. 检查实例号:唯一标记不同检查的号码. UI
0008 0020 Study Date: Date the Study started. 检查日期:检查开始的日期. DA
0008 0030 Study Time:Time the Study started. 检查时间:检查开始的时间. TM
0008 0061 Modalities in Study 一个检查中含有的不同检查类型. CS
0008 0015 Body Part Examined 检查的部位. CS
0008 1030 Study Description 检查的描述. LO
0010 1010 Patient’s Age 做检查时刻的患者年龄,而不是此刻患者的真实年龄. AS

Series Tag

Group Element Tag Description 中文解释 VR
0020 0011 Series Number:A number that identifies this Series. 序列号:识别不同检查的号. IS
0020 000E Series Instance UID:Unique identifier for the Series. 序列实例号:唯一标记不同序列的号码. UI
0008 0060 Modality 检查模态(MRI/CT/CR/DR) CS
0008 103E Series Description 检查描述和说明 LO
0008 0021 Series Date 检查日期 DA
0008 0031 Series Time 检查时间 TM
0020 0032 Image Position (Patient):The x, y and z coordinates of the upper left hand corner of the image, in mm. 图像位置:图像的左上角在空间坐标系中的x,y,z坐标,单位是毫米.如果在检查中,则指该序列中第一张影像左上角的坐标. DS
0020 0037 Image Orientation (Patient):The direction cosines of the first row and the first column with respect to the patient. 图像方位 DS
0018 0050 Slice Thickness:Nominal slice thickness, in mm. 层厚. DS
0018 0088 Spacing Between Slices 层与层之间的间距,单位为mm DS
0020 1041 Slice Location:Relative position of exposure expressed in mm. 实际的相对位置,单位为mm. DS
0018 0023 MR Acquisition 收购者 CS
0018 0015 Body Part Examined 身体部位. CS

Image Tag

Group Element Tag Description 中文解释 VR
0008 0008 Image Type:Image identification characteristics. CS
0008 0018 SOP Instance UID SOP实例 UID.
0008 0023 Content Date:The date the image pixel data creation started. 影像拍摄的日期. DA
0008 0033 Content Time 影像拍摄的时间. TM
0020 0013 Image/Instance Number:A number that identifies this image. 图像码:辨识图像的号码. IS
0028 0002 Samples Per Pixel:Number of samples (planes) in this image. 图像上的采样率. US
0028 0004 Photometric Interpretation:Specifies the intended interpretation of the pixel data. 光度计的解释,对于CT图像,用两个枚举值MONOCHROME1,MONOCHROME2.用来判断图像是否是彩色的,MONOCHROME1/2是灰度图, RGB则是真彩色图,还有其他. CS
0028 0010 Rows: Number of rows in the image. 图像的总行数,行分辨率. US
0028 0011 Columns: Number of columns in the image. 图像的总列数,列分辨率. US
0028 0030 Pixel Spacing:Physical distance in the patient between the center of each pixel. 像素间距.像素中心之间的物理间距. DS
0028 0100 Bits Allocated:Number of bits allocated for each pixel sample. Each sample shall have the same number of bits allocated. 分配的位数:存储每一个像素值时分配的位数,每一个样本应该拥有相同的这个值. US
0028 0101 Bits Stored:Number of bits stored for each pixel sample. Each sample shall have the same number of bits stored 存储的位数:有12到16列举值.存储每一个像素用的位数.每一个样本应该有相同值. US
0028 0102 High Bit:Most significant bit for pixel sample data. Each sample shall have the same high bit. 高位. US
0028 0103 Pixel Representation:Data representation of the pixel samples. Each sample shall have the same pixel representation.Enum: 0000H=unsigned integer,0001H=2’s omplement. 像素数据的表现类型:这是一个枚举值,分别为十六进制数0000和0001.0000H = 无符号整数,0001H = 2的补码. US
0028 1050 Window Center 窗位. DS
0028 1051 Window Width 窗宽. DS
0028 1052 Rescale Intercept:The value b in relationship between stored values (SV) and the output units.Output units = m*SV + b.Required if Modality LUT Sequence (0028, 0030) is not present. 截距:如果表明不同模态的LUT颜色对应表不存在时,则使用方程Units = m*SV + b,计算真实的像素值到呈现像素值。其中这个值为表达式中的b。 DS
0028 1053 Rescale Slope:m in the equation specified by Rescale Intercept (0028,1052).Required if Rescale Intercept is present. 斜率.这个值为表达式中的m。 DS
0028 1054 Rescale Type:Specifies the output units of Rescale Slope (0028,1053) and Rescale Intercept (0028,1052).Enum: US=Unspecified Requried if Photometric Interpretation is MONOCHROME2, and Bits Stored is greater than 1.This specifies an identity Modality LUT transformation. 输出值的单位.这是一个枚举值, LO

所有dicom的tag列表(英文版):http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/DICOM.html
看了这些tag,应该对dicom文件有了更多了了解吧。
关于VR的详细知识,可以看我详细介绍VR的博客页面。
其实这些数据用得并不多,一般就用到病人的姓名,病人ID,医院,科室,还有设置图像要用到图形的窗位和窗宽。

dicom传输的相关知识也只能介绍到这里,很多知识还没有理解透彻,只是把这些知识罗列出来,给大家参考一下!

dicom文件解析知识的其他地址:

1.dicom文件详解

http://blog.csdn.net/wenzhi20102321/article/details/75127362

2.dicom文件的值类型VR详解

http://blog.csdn.net/wenzhi20102321/article/details/75127140

3.dicom文件tag详解

http://blog.csdn.net/wenzhi20102321/article/details/75127101

4.android 解析并显示dicom文件的数据和图像

http://blog.csdn.net/wenzhi20102321/article/details/75040225

5.java代码使用ImageJ解析dicom文件成图片

http://blog.csdn.net/wenzhi20102321/article/details/74995084

前面5个是我自己写的,后面是一些我自己看过的相关资料:

6.Dicom文件解析

http://blog.csdn.net/leaf6094189/article/details/8510325

7.使用dcm4che3获取Dicom的bmp格式缩略图

http://blog.csdn.net/Kerrigeng/article/details/60866656

8.使用dcm4che3解析DICOM中,中文乱码问题

http://blog.csdn.net/Kerrigeng/article/details/53942846

9.使用dcm4che3对jpeg压缩的dcm文件进行解压

http://blog.csdn.net/Kerrigeng/article/details/62215647

10.DICOM的常用Tag分类和说明

http://www.cnblogs.com/stephen2014/p/4579443.html

11.dicom的大牛zssure的博客,几十篇文章

http://blog.csdn.net/zssureqh/article/category/1389985

12.dicom协议中文文档下载

http://download.csdn.net/detail/wenzhi20102321/9897014

13.Sante DICOM Editor 4,查看dicom文件的工具,直接打开用

http://download.csdn.net/detail/wenzhi20102321/9895616

共勉:其实我们都可以认为,世界都是“我”的!

你可能感兴趣的:(dicom图像文件)