本文整理汇总了Python中pydicom.dataset.Dataset.ContourSequence方法的典型用法代码示例。如果您正苦于以下问题:Python Dataset.ContourSequence方法的具体用法?Python Dataset.ContourSequence怎么用?Python Dataset.ContourSequence使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pydicom.dataset.Dataset
的用法示例。
在下文中一共展示了Dataset.ContourSequence方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUp
# 需要导入模块: from pydicom.dataset import Dataset [as 别名]
# 或者: from pydicom.dataset.Dataset import ContourSequence [as 别名]
def setUp(self):
# Create simple dataset for all tests
ds = Dataset()
ds.PatientName = "Name^Patient"
# Set up a simple nested sequence
# first, the innermost sequence
subitem1 = Dataset()
subitem1.ContourNumber = 1
subitem1.ContourData = ['2', '4', '8', '16']
subitem2 = Dataset()
subitem2.ContourNumber = 2
subitem2.ContourData = ['32', '64', '128', '196']
sub_ds = Dataset()
sub_ds.ContourSequence = Sequence((subitem1, subitem2))
# Now the top-level sequence
ds.ROIContourSequence = Sequence((sub_ds,)) # Comma to make one-tuple
# Store so each test can use it
self.ds = ds