Exemplo n.º 1
0
def OnAssociateResponse(association):
    print "Association response received"


def OnReceiveStore(SOPClass, DS):
    print "Received C-STORE"
    print DS
    return 0

# create application entity
MyAE = AE(
    'LocalAE', 9998, [PatientRootGetSOPClass, VerificationSOPClass],
    [RTPlanStorageSOPClass, CTImageStorageSOPClass, MRImageStorageSOPClass,
     RTImageStorageSOPClass])
MyAE.OnAssociateResponse = OnAssociateResponse
MyAE.OnReceiveStore = OnReceiveStore

# 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
def OnReceiveStore(SOPClass, DS):
    print "Received C-STORE"
    print DS
    return 0


# create application entity
MyAE = AE('LocalAE', 9998, [PatientRootGetSOPClass, VerificationSOPClass], [
    RTPlanStorageSOPClass,
    CTImageStorageSOPClass,
    MRImageStorageSOPClass,
    RTImageStorageSOPClass,
])
MyAE.OnAssociateResponse = OnAssociateResponse
MyAE.OnReceiveStore = OnReceiveStore

# 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
print "DICOM GetSCU ... ",