예제 #1
0
    transfer_syntax.remove(ExplicitVRLittleEndian)
    transfer_syntax.insert(0, ExplicitVRLittleEndian)

if args.prefer_big and ExplicitVRBigEndian in transfer_syntax:
    transfer_syntax.remove(ExplicitVRBigEndian)
    transfer_syntax.insert(0, ExplicitVRBigEndian)


def on_c_echo(context, info):
    """Optional implementation of the AE.on_c_echo callback."""
    # Return a Success response to the peer
    # We could also return a pydicom Dataset with a (0000, 0900) Status
    #   element
    return 0x0000


# Create application entity
ae = AE(ae_title=args.aetitle, port=args.port)
ae.add_supported_context(VerificationSOPClass, transfer_syntax)
ae.maximum_pdu_size = args.max_pdu

# Set timeouts
ae.network_timeout = args.timeout
ae.acse_timeout = args.acse_timeout
ae.dimse_timeout = args.dimse_timeout

# Set callback
ae.on_c_echo = on_c_echo

ae.start()
예제 #2
0
 def test_on_c_echo(self):
     """Test default callback raises exception"""
     ae = AE(scu_sop_class=[VerificationSOPClass])
     ae.on_c_echo()