Python下对DICOM图像的读取研究
程序员文章站
2022-03-31 20:48:48
...
import dicom
import json
import os
def loadFileInformation(filename):
information = {}
ds = dicom.read_file(filename)
information['w'] = ds.Rows
information['h'] = ds.Columns
information['type'] = ds.Modality
information['PatientBirthDate'] = ds.PatientBirthDate
information['PatientSex'] = ds.PatientSex
information['StudyID'] = ds.StudyID
information['StudyDate'] = ds.StudyDate
information['StudyTime'] = ds.StudyTime
information['SOP Instance UID '] = ds.SOPInstanceUID
information['Manufacturer'] = ds.Manufacturer
print (dir(ds))
print (type(information))
return information
path = "E:\\image\\xxx.dcm"
a=loadFileInformation(path)
print (a)
上一篇: 【MATLAB】数据分析之函数数值积分
下一篇: 将avi视频转换为多帧的dicom图