【发布时间】:2020-06-11 18:08:16
【问题描述】:
我正在尝试使用
限制保留的 DICOM 标签for key in keys:
if key.upper() not in {'0028|0010','0028|0011'}:
image_slice.EraseMetaData(key)
在 Python 3.6 中 image_slice 的类型为 SimpleITK.SimpleITK.Image
然后我用
image_slice.GetMetaDataKeys()
查看剩下的标签,它们是我选择的标签。然后我用
保存图像writer.SetFileName(outputDir+os.path.basename(sliceFileNames[i]))
writer.Execute(image_slice)
其中 outputDir 是输出目录名称,os.path.basename(sliceFileNames[i]) 是 DICOM 图像名称。但是,当我使用 Weasis 或 MIPAV 打开图像时,我注意到标签比 image_slice 中的要多得多。比如有
(0002,0001) [OB] FileMetaInformationVersion: binary data
(0002,0002) [UI] MediaStorageSOPClassUID:
(0002,0003) [UI] MediaStorageSOPInstanceUID:
(0008,0020) [DA] StudyDate: (which is given the date that the file was created)
我想知道这些附加标签是如何以及在何处添加的。
【问题讨论】:
标签: python-3.x dicom simpleitk