本文整理汇总了Python中pydicom.dataset.Dataset.SmallestImagePixelValue方法的典型用法代码示例。如果您正苦于以下问题:Python Dataset.SmallestImagePixelValue方法的具体用法?Python Dataset.SmallestImagePixelValue怎么用?Python Dataset.SmallestImagePixelValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pydicom.dataset.Dataset
的用法示例。
在下文中一共展示了Dataset.SmallestImagePixelValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testTagExceptionPrint
# 需要导入模块: from pydicom.dataset import Dataset [as 别名]
# 或者: from pydicom.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
if compat.in_PyPy:
expected_msg = "Invalid tag (0028, 0106): 'int' has no length"
else:
expected_msg = "Invalid tag (0028, 0106): object of type 'int' " "has no len()"
self.failUnlessExceptionArgs(expected_msg, TypeError, lambda: str(ds))
示例2: testTagExceptionWalk
# 需要导入模块: from pydicom.dataset import Dataset [as 别名]
# 或者: from pydicom.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
if compat.in_PyPy:
expected_msg = "Invalid tag (0028, 0106): 'int' has no length"
else:
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)
示例3: testTagExceptionWalk
# 需要导入模块: from pydicom.dataset import Dataset [as 别名]
# 或者: from pydicom.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
if compat.in_PyPy:
expected_msg = ("With tag (0028, 0106) got exception: "
"'int' has no length")
else:
expected_msg = ("With tag (0028, 0106) got exception: "
"object of type 'int' has no len()")
def callback(dataset, data_element):
return str(data_element)
def func(dataset=ds):
return dataset.walk(callback)
self.failUnlessExceptionArgs(expected_msg, TypeError, func)