pynetdicom.sop_class.register_uid

pynetdicom.sop_class.register_uid(uid: str, keyword: str, service_class: Type[ServiceClass], dimse_msg_type: str = '') None[source]

Register a private or public SOP Class UID uid with the sop_class module.

Examples

Register the UID 1.2.246.352.70.1.70 with the StorageServiceClass:

>>> from pynetdicom import register_uid
>>> from pynetdicom.service_class import StorageServiceClass
>>> register_uid(
...     "1.2.246.352.70.1.70",
...     "FooStorage",
...     StorageServiceClass,
... )

Using a UID after registration:

>>> from pynetdicom import AE
>>> from pynetdicom.sop_class import FooStorage
>>> ae = AE()
>>> ae.add_supported_context(FooStorage)
Parameters:
  • uid (str) – The UID to be registered.

  • keyword (str) – The keyword to use for the UID, must be a valid Python identifier and may not be a Python keyword.

  • service_class (pynetdicom.service_class.ServiceClass) – The service that the uid will be registered with, such as StorageServiceClass. Note that this must be the class object itself and not a class instance.

  • dimse_msg_type (str, optional) – If service_class is QueryRetrieveServiceClass then this should be the DIMSE service message type that the uid is being registered to. One of ("C-FIND", "C-GET", "C-MOVE").