当前位置: 首页>>代码示例>>Python>>正文


Python Dataset.SmallestImagePixelValue方法代码示例

本文整理汇总了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))
开发者ID:DimitriPapadopoulos,项目名称:pydicom,代码行数:15,代码来源:test_dataset.py

示例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)
开发者ID:DimitriPapadopoulos,项目名称:pydicom,代码行数:18,代码来源:test_dataset.py

示例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)
开发者ID:moloney,项目名称:pydicom,代码行数:23,代码来源:test_dataset.py


注:本文中的pydicom.dataset.Dataset.SmallestImagePixelValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。