本文整理匯總了Python中dicom.dataset.Dataset.TestOne方法的典型用法代碼示例。如果您正苦於以下問題:Python Dataset.TestOne方法的具體用法?Python Dataset.TestOne怎麽用?Python Dataset.TestOne使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類dicom.dataset.Dataset
的用法示例。
在下文中一共展示了Dataset.TestOne方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: as
# 需要導入模塊: from dicom.dataset import Dataset [as 別名]
# 或者: from dicom.dataset.Dataset import TestOne [as 別名]
"""
# D. Mason, 2013-01
from dicom.datadict import DicomDictionary, NameDict, CleanName
from dicom.dataset import Dataset
# Define items as (VR, VM, description, is_retired flag, keyword)
# Leave is_retired flag blank.
new_dict_items = {
0x10011001: ('UL', '1', "Test One", '', 'TestOne'),
0x10011002: ('OB', '1', "Test Two", '', 'TestTwo'),
0x10011003: ('UI', '1', "Test Three", '', 'TestThree'),
}
# Update the dictionary itself
DicomDictionary.update(new_dict_items)
# Update the reverse mapping from name to tag
new_names_dict = dict([(CleanName(tag), tag) for tag in
new_dict_items])
NameDict.update(new_names_dict)
# Test that it is working
ds = Dataset() # or could get one from read_file, etc
ds.TestOne = 42
ds.TestTwo = '12345'
ds.TestThree = '1.2.3.4.5'
print(ds.top())