1

I am trying to accept all the presentation contexts in the association negotiation.

After adding the abstract syntax to the supported context, the association is getting aborted. Logs -

D: Accept Parameters:
D: ======================= OUTGOING A-ASSOCIATE-AC PDU ========================
D: Our Implementation Class UID:      1.2.826.0.1.3680043.9.3811.2.0.2
D: Our Implementation Version Name:   PYNETDICOM_202
D: Application Context Name:    1.2.840.10008.3.1.1.1
D: Responding Application Name: resp. AE Title
D: Our Max PDU Receive Size:    65536
D: Presentation Contexts:
D:   Context ID:        1 (Accepted)
D:     Abstract Syntax: =1.3.46.670589.2.5.1.1
D:     Accepted SCP/SCU Role: Default
D:     Accepted Transfer Syntax: =Implicit VR Little Endian
D:   Context ID:        3 (Accepted)
D:     Abstract Syntax: =1.3.46.670589.2.5.1.1
D:     Accepted SCP/SCU Role: Default
D:     Accepted Transfer Syntax: =Explicit VR Little Endian
D: Accepted Extended Negotiation: None
D: Accepted Asynchronous Operations Window Negotiation: None
D: User Identity Negotiation Response: None
D: ========================== END A-ASSOCIATE-AC PDU ==========================
D: pydicom.read_dataset() TransferSyntax="Little Endian Implicit"
I: Received Store Request
D: ========================== INCOMING DIMSE MESSAGE ==========================
D: Message Type                  : C-STORE RQ
D: Presentation Context ID       : 3
D: Message ID                    : 1
D: Affected SOP Class UID        : 1.3.46.670589.2.5.1.1
D: Affected SOP Instance UID     : 1.2.840.113663.1500.1.441344181.10.1.20230914.95415.944
D: Data Set                      : Present
D: Priority                      : Medium
D: ============================ END DIMSE MESSAGE =============================
E: No supported service class available for the SOP Class UID '1.3.46.670589.2.5.1.1'
I: Aborting Association
D: Abort Parameters:
D: =========================== OUTGOING A-ABORT PDU ===========================
D: Abort Source: DUL service-user
D: Abort Reason: (no value available)
D: ============================= END A-ABORT PDU ==============================

Tried:

ae.add_requested_context(UID(""))

ae.add_requested_context(UID(""),ALL_TRANSFER_SYNTAXES)

ae.add_supported_context(UID(""))

ae.add_supported_context(UID(""), ALL_TRANSFER_SYNTAXES)

How do I accept images of all SOPClassUID s and write them to disk?

3
  • The incoming files have - 1.2.840.10008.1.2.4.50 (JPEG baseline) and 1.2.840.10008.1.2.1 (Explicit VR Little Endian ) Commented Dec 6, 2023 at 18:05
  • The abstract syntax 1.3.46.670589.2.5.1.1 is private SOP Class. Hence the issue Commented Dec 6, 2023 at 18:07
  • Use _config.UNRESTRICTED_STORAGE_SERVICE. Support for registering private SOP classes will be in the next version. Commented Dec 6, 2023 at 21:19

1 Answer 1

1

There are currently two ways to use private SOP classes with pynetdicom:

  1. Use _config.UNRESTRICTED_STORAGE_SERVICE.
  2. Patch the function as below:
from pynetdicom import sop_class
from pynetdicom.service_class import StorageServiceClass

original_func = sop_class.uid_to_service_class

def my_translator(uid):
    if uid == "1.3.46.670589.2.5.1.1":
        return StorageServiceClass

    return original_func(uid)

sop_class.uid_to_service_class = my_translator

In v2.1 you'll be able to use register_uid() instead:

from pynetdicom import register_uid
from pynetdicom.service_class import StorageServiceClass

register_uid("1.3.46.670589.2.5.1.1", "MySOPClassName", StorageServiceClass)

# and then either use the UID string directly, or import via
from pynetdicom.sop_class import MySOPClassName
7
  • If I were to accept any abstract syntaxes, i would go for option 1 , correct? Commented Dec 6, 2023 at 22:36
  • And would that be the equivalent of this - ae.addTransferCapability( new TransferCapability(null, "*", TransferCapability.Role.SCP, TRANSFER_SYNTAX_CHAIN)); in java? Commented Dec 6, 2023 at 22:37
  • Yes, option 1 will accept any unknown abstract syntax as part of the storage service, no idea about java. Commented Dec 7, 2023 at 1:55
  • if i do this - ae.add_supported_context("1.3.46.670589.2.5.1.1",ALL_TRANSFER_SYNTAXES). I get the error - E: No supported service class available for the SOP Class UID '1.3.46.670589.2.5.1.1'. But this sop does not have pixel data. So i just want to be able to store it. How do I do that? Commented Sep 20 at 13:56
  • That is the option 2 you mentioned above, correct? Commented Sep 20 at 13:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.