本文整理汇总了Python中pydicom.dataset.Dataset.QueryRetrieveLevel方法的典型用法代码示例。如果您正苦于以下问题:Python Dataset.QueryRetrieveLevel方法的具体用法?Python Dataset.QueryRetrieveLevel怎么用?Python Dataset.QueryRetrieveLevel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pydicom.dataset.Dataset
的用法示例。
在下文中一共展示了Dataset.QueryRetrieveLevel方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_conversion_rq
# 需要导入模块: from pydicom.dataset import Dataset [as 别名]
# 或者: from pydicom.dataset.Dataset import QueryRetrieveLevel [as 别名]
def test_conversion_rq(self):
""" Check conversion to a -RQ PDU produces the correct output """
primitive = C_MOVE_ServiceParameters()
primitive.MessageID = 7
primitive.AffectedSOPClassUID = '1.2.840.10008.5.1.4.1.1.2'
primitive.Priority = 0x02
primitive.MoveDestination = validate_ae_title("MOVE_SCP")
refIdentifier = Dataset()
refIdentifier.PatientID = '*'
refIdentifier.QueryRetrieveLevel = "PATIENT"
primitive.Identifier = BytesIO(encode(refIdentifier, True, True))
dimse_msg = C_MOVE_RQ()
dimse_msg.primitive_to_message(primitive)
pdvs = dimse_msg.Encode(1, 16382)
# Command Set
ref = b'\x03\x00\x00\x00\x00\x04\x00\x00\x00\x62\x00\x00\x00\x00\x00\x02' \
b'\x00\x1a\x00\x00\x00\x31\x2e\x32\x2e\x38\x34\x30\x2e\x31\x30\x30' \
b'\x30\x38\x2e\x35\x2e\x31\x2e\x34\x2e\x31\x2e\x31\x2e\x32\x00\x00' \
b'\x00\x00\x01\x02\x00\x00\x00\x21\x00\x00\x00\x10\x01\x02\x00\x00' \
b'\x00\x07\x00\x00\x00\x00\x06\x10\x00\x00\x00\x4d\x4f\x56\x45\x5f' \
b'\x53\x43\x50\x20\x20\x20\x20\x20\x20\x20\x20\x00\x00\x00\x07\x02' \
b'\x00\x00\x00\x02\x00\x00\x00\x00\x08\x02\x00\x00\x00\x01\x00'
self.assertEqual(pdvs[0].presentation_data_value_list[0][1], ref)
# Dataset
ref = b'\x02\x08\x00\x52\x00\x08\x00\x00\x00\x50\x41\x54\x49\x45\x4e\x54' \
b'\x20\x10\x00\x20\x00\x02\x00\x00\x00\x2a\x20'
self.assertEqual(pdvs[1].presentation_data_value_list[0][1], ref)
示例2: test_conversion_rsp
# 需要导入模块: from pydicom.dataset import Dataset [as 别名]
# 或者: from pydicom.dataset.Dataset import QueryRetrieveLevel [as 别名]
def test_conversion_rsp(self):
""" Check conversion to a -RSP PDU produces the correct output """
primitive = C_FIND_ServiceParameters()
primitive.MessageIDBeingRespondedTo = 5
primitive.AffectedSOPClassUID = '1.2.840.10008.5.1.4.1.1.2'
primitive.Status = 0xFF00
refIdentifier = Dataset()
refIdentifier.QueryRetrieveLevel = "PATIENT"
refIdentifier.RetrieveAETitle = validate_ae_title("FINDSCP")
refIdentifier.PatientName = "ANON^A^B^C^D"
primitive.Identifier = BytesIO(encode(refIdentifier, True, True))
dimse_msg = C_FIND_RSP()
dimse_msg.primitive_to_message(primitive)
pdvs = dimse_msg.Encode(1, 16382)
# Command Set
ref = b'\x03\x00\x00\x00\x00\x04\x00\x00\x00\x4a\x00\x00\x00\x00\x00\x02' \
b'\x00\x1a\x00\x00\x00\x31\x2e\x32\x2e\x38\x34\x30\x2e\x31\x30\x30' \
b'\x30\x38\x2e\x35\x2e\x31\x2e\x34\x2e\x31\x2e\x31\x2e\x32\x00\x00' \
b'\x00\x00\x01\x02\x00\x00\x00\x20\x80\x00\x00\x20\x01\x02\x00\x00' \
b'\x00\x05\x00\x00\x00\x00\x08\x02\x00\x00\x00\x01\x00\x00\x00\x00' \
b'\x09\x02\x00\x00\x00\x00\xff'
self.assertEqual(pdvs[0].presentation_data_value_list[0][1], ref)
ref = b'\x02\x08\x00\x52\x00\x08\x00\x00\x00\x50\x41\x54\x49\x45\x4e\x54' \
b'\x20\x08\x00\x54\x00\x10\x00\x00\x00\x46\x49\x4e\x44\x53\x43\x50' \
b'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x10\x00\x10\x00\x0c\x00\x00' \
b'\x00\x41\x4e\x4f\x4e\x5e\x41\x5e\x42\x5e\x43\x5e\x44'
self.assertEqual(pdvs[1].presentation_data_value_list[0][1], ref)
示例3: test_assignment
# 需要导入模块: from pydicom.dataset import Dataset [as 别名]
# 或者: from pydicom.dataset.Dataset import QueryRetrieveLevel [as 别名]
def test_assignment(self):
""" Check assignment works correctly """
primitive = C_FIND_ServiceParameters()
primitive.MessageID = 11
self.assertEqual(primitive.MessageID, 11)
primitive.MessageIDBeingRespondedTo = 13
self.assertEqual(primitive.MessageIDBeingRespondedTo, 13)
primitive.AffectedSOPClassUID = '1.2.4.10'
self.assertEqual(primitive.AffectedSOPClassUID, '1.2.4.10')
primitive.Priority = 0x02
self.assertEqual(primitive.Priority, 0x02)
refDataset = Dataset()
refDataset.PatientID = '*'
refDataset.QueryRetrieveLevel = "PATIENT"
primitive.Identifier = BytesIO(encode(refDataset, True, True))
#self.assertEqual(primitive.DataSet, refDataset)
primitive.Status = 0x0000
self.assertEqual(primitive.Status, 0x0000)
primitive.Status = 0xC123
self.assertEqual(primitive.Status, 0xC123)
示例4: on_c_find
# 需要导入模块: from pydicom.dataset import Dataset [as 别名]
# 或者: from pydicom.dataset.Dataset import QueryRetrieveLevel [as 别名]
def on_c_find(dataset):
basedir = "../test/dicom_files/"
dcm_files = ["CTImageStorage.dcm"]
dcm_files = [os.path.join(basedir, x) for x in dcm_files]
for dcm in dcm_files:
data = read_file(dcm, force=True)
d = Dataset()
d.QueryRetrieveLevel = dataset.QueryRetrieveLevel
d.RetrieveAETitle = args.aetitle
d.PatientName = data.PatientName
yield d
示例5: dict
# 需要导入模块: from pydicom.dataset import Dataset [as 别名]
# 或者: from pydicom.dataset.Dataset import QueryRetrieveLevel [as 别名]
RemoteAE = dict(Address=args.remotehost, Port=args.remoteport, AET=args.aec)
# create association with remote AE
print "Request association"
assoc = MyAE.RequestAssociation(RemoteAE)
# perform a DICOM ECHO
print "DICOM Echo ... ",
st = assoc.VerificationSOPClass.SCU(1)
print 'done with status "%s"' % st
print "DICOM FindSCU ... ",
d = Dataset()
d.PatientsName = args.searchstring
d.QueryRetrieveLevel = "PATIENT"
d.PatientID = "*"
st = assoc.PatientRootFindSOPClass.SCU(d, 1)
print 'done with status "%s"' % st
for ss in st:
if not ss[1]:
continue
# print ss[1]
try:
d.PatientID = ss[1].PatientID
except:
continue
print "Moving"
print d
assoc2 = MyAE.RequestAssociation(RemoteAE)
示例6: Parse
# 需要导入模块: from pydicom.dataset import Dataset [as 别名]
# 或者: from pydicom.dataset.Dataset import QueryRetrieveLevel [as 别名]
pass
# Format examples:
# "(gggg,eeee)=" Null value
# "(gggg,eeee)=CITIZEN*" Typical use
# "(gggg,eeee)[0].Modality=CT" Sequence
# "(gggg,eeee)[*].Modality=CT" Sequence with wildcard
# "(gggg,eeee)=1\\2\\3\\4" VM of 4
# Parse (), [], ., =, \\
# () to get tag
# ()[]()[]()[]()
# ()[].()[].()[].()
# Create query dataset
dataset = Dataset()
dataset.PatientsName = '*'
dataset.QueryRetrieveLevel = "PATIENT"
# Query/Retrieve Information Models
if args.worklist:
query_model = 'W'
elif args.patient:
query_model = 'P'
elif args.study:
query_model = 'S'
elif args.psonly:
# Retired
query_model = 'O'
else:
query_model = 'W'
# Send query