Patient Root doesn't work with DcmSCU ?

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
ChoCChoK
Posts: 7
Joined: Mon, 2017-12-11, 12:50

Patient Root doesn't work with DcmSCU ?

#1 Post by ChoCChoK »

Hi,

I'm coding a Q/R application, but I have some difficulties to do a C-FIND with Patient Root Q/R Model Information : the DcmSCU class doesn't find a Presentation Context fitting the situation with findUncompressedPC(UID_FINDPatientRootQueryRetrieveInformationModel, scu) in the example given in the official website. For clarity, here is the code of this function :

Code: Select all

Uint8 MN_DCM_client::findUncompressedPC(const OFString& sopClass, DcmSCU &scu)
{
    Uint8 pc;
    pc = scu.findPresentationContextID(sopClass, UID_LittleEndianExplicitTransferSyntax);
    if (pc == 0)
        pc = scu.findPresentationContextID(sopClass, UID_BigEndianExplicitTransferSyntax);
    if (pc == 0)
        pc = scu.findPresentationContextID(sopClass, UID_LittleEndianImplicitTransferSyntax);
    return pc;
}
And here is the code of DcmSCU::findPresentationContextID :

Code: Select all

// Returns usable presentation context ID for a given abstract syntax UID and
// transfer syntax UID. 0 if none matches.
T_ASC_PresentationContextID DcmSCU::findPresentationContextID(const OFString &abstractSyntax,
                                                              const OFString &transferSyntax,
                                                              const T_ASC_SC_ROLE requestorRole)
{
  if (!isConnected())
    return 0;

  DUL_PRESENTATIONCONTEXT *pc;
  LST_HEAD **l;
  OFBool found = OFFalse;

  if (abstractSyntax.empty()) return 0;

  /* first of all we look for a presentation context
   * matching both abstract and transfer syntax
   */
  l = &m_assoc->params->DULparams.acceptedPresentationContext;
  pc = (DUL_PRESENTATIONCONTEXT*) LST_Head(l);
  (void)LST_Position(l, (LST_NODE*)pc);
  while (pc && !found)
  {
    found = (strcmp(pc->abstractSyntax, abstractSyntax.c_str()) == 0);
    found &= (pc->result == ASC_P_ACCEPTANCE);
    if (!transferSyntax.empty())  // ignore transfer syntax if not specified
      found &= (strcmp(pc->acceptedTransferSyntax, transferSyntax.c_str()) == 0);
    if (found) found &= pc->acceptedSCRole == ascRole2dulRole(requestorRole);
    if (!found) pc = (DUL_PRESENTATIONCONTEXT*) LST_Next(l);
  }
  if (found)
    return pc->presentationContextID;

  return 0;   /* not found */
}
I tested it on Fuji PACS and on local Orthanc Server, and in both cases, it doesn't work and findUncompressedPC returns 0. Just to be clear, all the steps before are working and, for example, C-ECHO works (with Study Root Q/R Information Model). In fact, the only reason that pushes me to use the Patient Root Q/R Model Information is that when I use the Study Root Q/R Model Information, it works in Orthanc but not in Fuji, this last giving me back an Out of Resources error. In their documentation, it's pretty clear that the user have to use first a Patient Root Q/R Model Information C-FIND request to retrieve Patient UID before he can retrieve studies or series. Then, I tested findscu.exe with the -P parameter (which permits to use patient root information model), and it worked (with Little Endian Implicit which is technically supported by the function above) ! So i'm wondering how to do the same using the DcmSCU class provided in the DCMTK package.

What PresID is used by findscu.exe with Patient Root Q/R Model Information and Little Endian Implicit ? I'm searching on my own but maybe someone already has the answer.

Have a nice day,
ChoCChoK.

ChoCChoK
Posts: 7
Joined: Mon, 2017-12-11, 12:50

Re: Patient Root doesn't work with DcmSCU ?

#2 Post by ChoCChoK »

Hi again !

Oh, I just had to add the FIND Patient Root Q/R Information Model with DcmSCU::addPresentationContext(UID_FINDPatientRootQueryRetrieveInformationModel, ...). I'm sorry, that was stupid of me.

Have a nicer day !
ChoCChoK.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest