【问题标题】:Convert DICOM tag into something more readable将 DICOM 标签转换为更易读的东西
【发布时间】:2021-03-13 00:57:34
【问题描述】:

我正在使用pydicomDICOMWeb client。后者我用来从 DICOM 存储库中获取元数据。

在检索 DICOM 元数据时,我只将 DICOM 标记作为十六进制元组获取。我想知道如何使用 pydicom 查找标签并获得可读的标识符。

例如,如何将标签0x10,0x20 转换为其字符串表示/关键字("PatientID")? (参见DICOM data dictionary 的规格)

【问题讨论】:

    标签: python dicom pydicom


    【解决方案1】:

    pydicom 提供some utility functions 来处理DICOM data dictionary

    import pydicom as dicom 
    
    tag = dicom.tag.Tag(0x10,0x20)
    
    # Option 1) Retrieve the keyword:
    keyword = dicom.datadict.keyword_for_tag(tag)
    # Option 2) Retrieve the complete datadict entry:
    entry = dicom.datadict.get_entry(tag)
    representation, multiplicity, name, is_retired, keyword = entry
    
    # keyword: "PatientID"
    # name: "Patient ID"
    

    【讨论】:

      猜你喜欢
      • 2015-04-16
      • 2021-03-30
      • 1970-01-01
      • 2010-09-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多