代码拉取完成,页面将自动刷新
import pydicom
import numpy
from pydicom.tag import Tag
ds = pydicom.read_file(r"C:\Users\sushine\Desktop\IMRT\CT.150114-0004.1.dcm")
print(ds.pixel_array.shape)
t1 = Tag(0x00100010)
t2 = Tag(0x10,0x20)
print(t1,t2)
ds.save_as(r"C:\Users\sushine\Desktop\IMRT\newdcm.dcm")
# del ds.PatientID
# if "PatientID" in ds:
# print("PatientID is existed")
# else:
# print("PatientID is deleted")
#
# if "PatientName" in ds:
# print("PatientName is existed")
# data_element = ds.data_element("PatientName")
# print(data_element)
# print(ds.dir("pat"))
# ds.PatientID = "12345"
# ds[0x10,0x10].value = "Test"
#
# print(ds.PatientID)
# print(ds[0x10,0x10].value)
# beam = ds.BeamSequence[0].BeamName
# print(beam)
# tpd = ds.DoseReferenceSequence[0].TargetPrescriptionDose
# print(tpd)
#
# tpd1 = ds[0x300a,0x00b0][0][0x300a,0x00c2].value
# print(tpd1)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。