當前位置: 首頁>>代碼示例>>Python>>正文


Python Dataset.ContourNumber方法代碼示例

本文整理匯總了Python中dicom.dataset.Dataset.ContourNumber方法的典型用法代碼示例。如果您正苦於以下問題:Python Dataset.ContourNumber方法的具體用法?Python Dataset.ContourNumber怎麽用?Python Dataset.ContourNumber使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在dicom.dataset.Dataset的用法示例。


在下文中一共展示了Dataset.ContourNumber方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: setUp

# 需要導入模塊: from dicom.dataset import Dataset [as 別名]
# 或者: from dicom.dataset.Dataset import ContourNumber [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
開發者ID:IMAGE-ET,項目名稱:dicomimport,代碼行數:24,代碼來源:test_filewriter.py

示例2: setUp

# 需要導入模塊: from dicom.dataset import Dataset [as 別名]
# 或者: from dicom.dataset.Dataset import ContourNumber [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
開發者ID:njvack,項目名稱:yadda,代碼行數:24,代碼來源:test_filewriter.py


注:本文中的dicom.dataset.Dataset.ContourNumber方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。