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


Python Dataset.MaximumFractionalValue方法代碼示例

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


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

示例1: instance

# 需要導入模塊: from dicom.dataset import Dataset [as 別名]
# 或者: from dicom.dataset.Dataset import MaximumFractionalValue [as 別名]
        file_meta.MediaStorageSOPInstanceUID = "1.2.840.10008.5.1.4.1.1.66.4" # !! Need valid UID here for real work
        file_meta.ImplementationClassUID = "1.2.840.10008.5.1.4.1.1.66.4" # !!! Need valid UIDs here

        # Required for Segmentation IOD
        file_meta.Modality = 'SEG'
        file_meta.SeriesNumber = '001'
        file_meta.ImageType = '1' # Derived = 1, Primary = 2
        file_meta.SamplesPerPixel = '1'
        file_meta.PhotometricInterpretation = 'MONOCHROME2'
        file_meta.PixelRepresentation = 0
        file_meta.BitsAllocated = 8 # Binary = 1
        file_meta.BitsStored = 8 # Binary = 1
        file_meta.HighBit = 7 # Binary = 0
        file_meta.SegmentationType = 'FRACTIONAL' #FRACTIONAL or BINARY
        file_meta.SegmentationFractionalType = 'OCCUPANCY' #Can be OCCUPANCY or PROBABILITY
        file_meta.MaximumFractionalValue = 116 # 116 is the number of labels in AAL
        file_meta.SegmentSequence = 'AAL' # List of segments?
        file_meta.SegmentNumber = 1 #Number identifying the segment



    print "Setting dataset values..."

    # Create the FileDataset instance (initially no data elements, but file_meta supplied)
    ds = FileDataset(filename, {}, file_meta=file_meta, preamble="\0"*128)

    # Add the data elements -- not trying to set all required here. Check DICOM standard
    ds.PatientsName = "Test^Firstname"
    ds.PatientID = "123456"

    # Populate required values for file meta information
開發者ID:nicholsn,項目名稱:pyAIM,代碼行數:33,代碼來源:nii2dcm.py


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