本文整理汇总了Python中pydicom.dataset.Dataset.StudyInstanceUID方法的典型用法代码示例。如果您正苦于以下问题:Python Dataset.StudyInstanceUID方法的具体用法?Python Dataset.StudyInstanceUID怎么用?Python Dataset.StudyInstanceUID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pydicom.dataset.Dataset
的用法示例。
在下文中一共展示了Dataset.StudyInstanceUID方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testEqualityNoSequence
# 需要导入模块: from pydicom.dataset import Dataset [as 别名]
# 或者: from pydicom.dataset.Dataset import StudyInstanceUID [as 别名]
def testEqualityNoSequence(self):
"""Dataset: equality returns correct value with simple dataset"""
d = Dataset()
d.SOPInstanceUID = "1.2.3.4"
self.assertTrue(d == d)
e = Dataset()
e.SOPInstanceUID = "1.2.3.4"
self.assertTrue(d == e)
e.SOPInstanceUID = "1.2.3.5"
self.assertFalse(d == e)
# Check VR
del e.SOPInstanceUID
e.add(DataElement(0x00080018, "PN", "1.2.3.4"))
self.assertFalse(d == e)
# Check Tag
del e.SOPInstanceUID
e.StudyInstanceUID = "1.2.3.4"
self.assertFalse(d == e)
# Check missing Element in self
e.SOPInstanceUID = "1.2.3.4"
self.assertFalse(d == e)
# Check missing Element in other
d = Dataset()
d.SOPInstanceUID = "1.2.3.4"
d.StudyInstanceUID = "1.2.3.4.5"
e = Dataset()
e.SOPInstanceUID = "1.2.3.4"
self.assertFalse(d == e)
示例2: testEqualityNoSequence
# 需要导入模块: from pydicom.dataset import Dataset [as 别名]
# 或者: from pydicom.dataset.Dataset import StudyInstanceUID [as 别名]
def testEqualityNoSequence(self):
"""Dataset: equality returns correct value with simple dataset"""
# Test empty dataset
assert Dataset() == Dataset()
d = Dataset()
d.SOPInstanceUID = '1.2.3.4'
d.PatientName = 'Test'
assert d == d
e = Dataset()
e.PatientName = 'Test'
e.SOPInstanceUID = '1.2.3.4'
assert d == e
e.SOPInstanceUID = '1.2.3.5'
assert not d == e
# Check VR
del e.SOPInstanceUID
e.add(DataElement(0x00080018, 'PN', '1.2.3.4'))
assert not d == e
# Check Tag
del e.SOPInstanceUID
e.StudyInstanceUID = '1.2.3.4'
assert not d == e
# Check missing Element in self
e.SOPInstanceUID = '1.2.3.4'
assert not d == e
# Check missing Element in other
d = Dataset()
d.SOPInstanceUID = '1.2.3.4'
d.StudyInstanceUID = '1.2.3.4.5'
e = Dataset()
e.SOPInstanceUID = '1.2.3.4'
assert not d == e
示例3: testEqualityNoSequence
# 需要导入模块: from pydicom.dataset import Dataset [as 别名]
# 或者: from pydicom.dataset.Dataset import StudyInstanceUID [as 别名]
def testEqualityNoSequence(self):
"""Dataset: equality returns correct value with simple dataset"""
d = Dataset()
d.SOPInstanceUID = '1.2.3.4'
d.PatientName = 'Test'
self.assertTrue(d == d)
e = Dataset()
e.PatientName = 'Test'
e.SOPInstanceUID = '1.2.3.4'
self.assertTrue(d == e)
e.SOPInstanceUID = '1.2.3.5'
self.assertFalse(d == e)
# Check VR
del e.SOPInstanceUID
e.add(DataElement(0x00080018, 'PN', '1.2.3.4'))
self.assertFalse(d == e)
# Check Tag
del e.SOPInstanceUID
e.StudyInstanceUID = '1.2.3.4'
self.assertFalse(d == e)
# Check missing Element in self
e.SOPInstanceUID = '1.2.3.4'
self.assertFalse(d == e)
# Check missing Element in other
d = Dataset()
d.SOPInstanceUID = '1.2.3.4'
d.StudyInstanceUID = '1.2.3.4.5'
e = Dataset()
e.SOPInstanceUID = '1.2.3.4'
self.assertFalse(d == e)