CT影像文件格式DICOM详解
DICOM简介
DICOM(Digital Imaging and Communications in Medicine)即医学数字成像和通信,是医学图像和相关信息的国际标准(ISO 12052)。DICOM被广泛应用于放射医疗,心血管成像以及放射诊疗诊断设备(X射线,CT,核磁共振,超声等),并且在眼科和牙科等其它医学领域得到越来越深入广泛的应用。所有患者的医学图像都以 DICOM 文件格式进行存储。这个格式包含关于患者的 PHI(protected health information,https://en.wikipedia.org/wiki/Protected_health_information )信息,例如姓名,性别,年龄,以及其他图像相关信息比如捕获并生成图像的设备信息,医疗的一些上下文相关信息等。医学图像设备生成 DICOM 文件,医生使用 DICOM 阅读器(能够显示 DICOM 图像的计算机软件)阅读并对图像中发现的问题进行诊断。本人推荐的DICOM 阅读器为Mango
目前采用的标准是DICOM3.0,每一张图像中都携带着大量的信息,这些信息具体可以分为以下四类:(a)Patient(b)Study(c)Series(d)Image。每一个DICOM Tag都是由两个十六进制数的组合来确定的,分别为Group和Element。如(0010,0010)这个Tag表示的是Patient’s Name,它存储着这张DICOM图像的患者姓名。
一张CT图像有 512x512 个像素点,在dicom文件中每个像素由2字节表示,所以每张图片约512KB大小。图像中每个像素都是整数,专业名称为 Hounsfield scale 或 CT Number,是描述物质的放射密度的量化值(参考Wikipedia)。下表为常见物质的HU值。
DICOM信息获取
我们暂时不关注dicom信息的具体格式,我们关注如何用python获取到相关的信息以及那些信息是比较重要的。我们能获取到的信息分为两类:1.DICOM文件信息 2.DICOM具体的数据
获取信息的相关代码如下:
import pydicom as dicom
DATA_PATH = 'J:/dataset/LIDC-IDRI/LIDC-IDRI/LIDC-IDRI-0001/01-01-2000-30178/3000566-03192/'
#获取Dicom文件信息说明
f = dicom.read_file(DATA_PATH + '000001.dcm')
print(f)
import SimpleITK as sitk
import cv2
import matplotlib.pyplot as plt
#获取Dicom数据
ds = sitk.ReadImage(DATA_PATH + '000001.dcm')
img_array = sitk.GetArrayFromImage(ds)
print(img_array.shape)
plt.imshow(img_array[0],cmap="gray")
plt.show()
Dicom文件信息显示如下:
(0008, 0005) Specific Character Set CS: 'ISO_IR 100'
(0008, 0008) Image Type CS: ['ORIGINAL', 'PRIMARY', 'AXIAL']
(0008, 0016) SOP Class UID UI: CT Image Storage
(0008, 0018) SOP Instance UID UI: 1.3.6.1.4.1.14519.5.2.1.6279.6001.143451261327128179989900675595
(0008, 0020) Study Date DA: '20000101'
(0008, 0021) Series Date DA: '20000101'
(0008, 0022) Acquisition Date DA: '20000101'
(0008, 0023) Content Date DA: '20000101'
(0008, 0024) Overlay Date DA: '20000101'
(0008, 0025) Curve Date DA: '20000101'
(0008, 002a) Acquisition DateTime DT: '20000101'
(0008, 0030) Study Time TM: ''
(0008, 0032) Acquisition Time TM: ''
(0008, 0033) Content Time TM: ''
(0008, 0050) Accession Number SH: '2819497684894126'
(0008, 0060) Modality CS: 'CT'
(0008, 0070) Manufacturer LO: 'GE MEDICAL SYSTEMS'
(0008, 0090) Referring Physician's Name PN: ''
(0008, 1090) Manufacturer's Model Name LO: 'LightSpeed Plus'
(0008, 1155) Referenced SOP Instance UID UI: 1.3.6.1.4.1.14519.5.2.1.6279.6001.675906998158803995297223798692
(0010, 0010) Patient's Name PN: ''
(0010, 0020) Patient ID LO: 'LIDC-IDRI-0001'
(0010, 0030) Patient's Birth Date DA: ''
(0010, 0040) Patient's Sex CS: ''
(0010, 1010) Patient's Age AS: ''
(0010, 21d0) Last Menstrual Date DA: '20000101'
(0012, 0062) Patient Identity Removed CS: 'YES'
(0012, 0063) De-identification Method LO: 'DCM:113100/113105/113107/113108/113109/113111'
(0013, 0010) Private Creator LO: 'CTP'
(0013, 1010) Private tag data LO: 'LIDC-IDRI'
(0013, 1013) Private tag data LO: '62796001'
(0018, 0010) Contrast/Bolus Agent LO: 'IV'
(0018, 0015) Body Part Examined CS: 'CHEST'
(0018, 0022) Scan Options CS: 'HELICAL MODE'
(0018, 0050) Slice Thickness DS: "2.500000"
(0018, 0060) KVP DS: "120"
(0018, 0090) Data Collection Diameter DS: "500.000000"
(0018, 1020) Software Version(s) LO: 'LightSpeedApps2.4.2_H2.4M5'
(0018, 1100) Reconstruction Diameter DS: "360.000000"
(0018, 1110) Distance Source to Detector DS: "949.075012"
(0018, 1111) Distance Source to Patient DS: "541.000000"
(0018, 1120) Gantry/Detector Tilt DS: "0.000000"
(0018, 1130) Table Height DS: "144.399994"
(0018, 1140) Rotation Direction CS: 'CW'
(0018, 1150) Exposure Time IS: "570"
(0018, 1151) X-Ray Tube Current IS: "400"
(0018, 1152) Exposure IS: "4684"
(0018, 1160) Filter Type SH: 'BODY FILTER'
(0018, 1170) Generator Power IS: "48000"
(0018, 1190) Focal Spot(s) DS: "1.200000"
(0018, 1210) Convolution Kernel SH: 'STANDARD'
(0018, 5100) Patient Position CS: 'FFS'
(0020, 000d) Study Instance UID UI: 1.3.6.1.4.1.14519.5.2.1.6279.6001.298806137288633453246975630178
(0020, 000e) Series Instance UID UI: 1.3.6.1.4.1.14519.5.2.1.6279.6001.179049373636438705059720603192
(0020, 0010) Study ID SH: ''
(0020, 0011) Series Number IS: "3000566"
(0020, 0013) Instance Number IS: "80"
(0020, 0032) Image Position (Patient) DS: ['-166.000000', '-171.699997', '-207.500000']
(0020, 0037) Image Orientation (Patient) DS: ['1.000000', '0.000000', '0.000000', '0.000000', '1.000000', '0.000000']
(0020, 0052) Frame of Reference UID UI: 1.3.6.1.4.1.14519.5.2.1.6279.6001.229925374658226729607867499499
(0020, 1040) Position Reference Indicator LO: 'SN'
(0020, 1041) Slice Location DS: "-207.500000"
(0028, 0002) Samples per Pixel US: 1
(0028, 0004) Photometric Interpretation CS: 'MONOCHROME2'
(0028, 0010) Rows US: 512
(0028, 0011) Columns US: 512
(0028, 0030) Pixel Spacing DS: ['0.703125', '0.703125']
(0028, 0100) Bits Allocated US: 16
(0028, 0101) Bits Stored US: 16
(0028, 0102) High Bit US: 15
(0028, 0103) Pixel Representation US: 1
(0028, 0120) Pixel Padding Value US: 63536
(0028, 0303) Longitudinal Temporal Information M CS: 'MODIFIED'
(0028, 1050) Window Center DS: "-600"
(0028, 1051) Window Width DS: "1600"
(0028, 1052) Rescale Intercept DS: "-1024"
(0028, 1053) Rescale Slope DS: "1"
(0038, 0020) Admitting Date DA: '20000101'
(0040, 0002) Scheduled Procedure Step Start Date DA: '20000101'
(0040, 0004) Scheduled Procedure Step End Date DA: '20000101'
(0040, 0244) Performed Procedure Step Start Date DA: '20000101'
(0040, 2016) Placer Order Number / Imaging Servi LO: ''
(0040, 2017) Filler Order Number / Imaging Servi LO: ''
(0040, a075) Verifying Observer Name PN: 'Removed by CTP'
(0040, a123) Person Name PN: 'Removed by CTP'
(0040, a124) UID UI: 1.3.6.1.4.1.14519.5.2.1.6279.6001.335419887712224178340067932923
(0070, 0084) Content Creator's Name PN: ''
(0088, 0140) Storage Media File-set UID UI: 1.3.6.1.4.1.14519.5.2.1.6279.6001.211790042620307056609660772296
(7fe0, 0010) Pixel Data OW: Array of 524288 elements
DICOM的常用Tag分类和说明
数据显示成灰度图的结果如下:
————————————————
版权声明:本文为CSDN博主「zsddragon」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/zsddragon/article/details/98308487