Exemplo n.º 1
0
# first create a partner
start_dcmqrscp(server_port=2001, server_AET='AE1', populate=True)
for ii in range(20):
    print

# call back


def OnAssociateResponse(association):
    print "Association response received"

# create application entity
MyAE = AE('localhost', 9999,
          [PatientRootFindSOPClass, VerificationSOPClass], [])
MyAE.OnAssociateResponse = OnAssociateResponse

# remote application entity
RemoteAE = {'Address': 'localhost', 'Port': 2001, 'AET': 'AE1'}

# 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

# send dataset using RTPlanStorageSOPClass
Exemplo n.º 2
0
import dcmqrscp
from utils import testfiles_dir

# start peer
dcmqrscp.start_dcmqrscp()

# call back


def OnAssociateResponse(association):
    print "Association response received"


# create application entity
MyAE = AE('localhost', 9999, [RTPlanStorageSOPClass, VerificationSOPClass], [])
MyAE.OnAssociateResponse = OnAssociateResponse

# remote application entity
RemoteAE = {'Address': 'localhost', 'Port': 2000, 'AET': 'OFFIS_AE'}

# create some dataset
d = dicom.read_file(os.path.join(testfiles_dir(), "rtplan.dcm"))

# create association with remote AE
print "Request association"
assoc = MyAE.RequestAssociation(RemoteAE)

# perform a DICOM ECHO
# time.sleep(2)
print "DICOM Echo ... ",
st = assoc.VerificationSOPClass.SCU(1)