本文整理匯總了Python中dicom.dataset.Dataset.SmallestImagePixelValue方法的典型用法代碼示例。如果您正苦於以下問題:Python Dataset.SmallestImagePixelValue方法的具體用法?Python Dataset.SmallestImagePixelValue怎麽用?Python Dataset.SmallestImagePixelValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類dicom.dataset.Dataset
的用法示例。
在下文中一共展示了Dataset.SmallestImagePixelValue方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: testTagExceptionPrint
# 需要導入模塊: from dicom.dataset import Dataset [as 別名]
# 或者: from dicom.dataset.Dataset import SmallestImagePixelValue [as 別名]
def testTagExceptionPrint(self):
# When printing datasets, a tag number should appear in error
# messages
ds = Dataset()
ds.PatientID = "123456" # Valid value
ds.SmallestImagePixelValue = 0 # Invalid value
expected_msg = "Invalid tag (0028, 0106): object of type 'int' has no len()"
self.failUnlessExceptionArgs(expected_msg, TypeError, lambda: str(ds))
示例2: testTagExceptionWalk
# 需要導入模塊: from dicom.dataset import Dataset [as 別名]
# 或者: from dicom.dataset.Dataset import SmallestImagePixelValue [as 別名]
def testTagExceptionWalk(self):
# When recursing through dataset, a tag number should appear in
# error messages
ds = Dataset()
ds.PatientID = "123456" # Valid value
ds.SmallestImagePixelValue = 0 # Invalid value
expected_msg = "Invalid tag (0028, 0106): object of type 'int' has no len()"
callback = lambda dataset, data_element: str(data_element)
func = lambda: ds.walk(callback)
self.failUnlessExceptionArgs(expected_msg, TypeError, func)