本文整理匯總了Python中dicom.dataset.Dataset.Contours方法的典型用法代碼示例。如果您正苦於以下問題:Python Dataset.Contours方法的具體用法?Python Dataset.Contours怎麽用?Python Dataset.Contours使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類dicom.dataset.Dataset
的用法示例。
在下文中一共展示了Dataset.Contours方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: setUp
# 需要導入模塊: from dicom.dataset import Dataset [as 別名]
# 或者: from dicom.dataset.Dataset import Contours [as 別名]
def setUp(self):
# Create simple dataset for all tests
ds = Dataset()
ds.PatientsName = "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.Contours = Sequence((subitem1, subitem2)) # XXX in 0.9.5 will need sub_ds.ContourSequence
# Now the top-level sequence
ds.ROIContours = Sequence((sub_ds,)) # Comma necessary to make it a one-tuple
# Store so each test can use it
self.ds = ds