Skip to content

Commit

Permalink
Output debug information on Presentation Context.
Browse files Browse the repository at this point in the history
Output debug information on the Presentation Context that is used for
the C-STORE request, i.e. the Presentation Context ID, SOP Class and
Transfer Syntax. For the latter two, the official UID keyword is used
(if defined in DICOM part 6).
  • Loading branch information
jriesmeier committed Feb 20, 2023
1 parent dd1b69c commit 4f5fe53
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions dcmnet/apps/storescu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1343,10 +1343,12 @@ storeSCU(T_ASC_Association *assoc, const char *fname)
presID = ASC_findAcceptedPresentationContextID(assoc, sopClass);
if (presID == 0)
{
const char *modalityName = dcmSOPClassUIDToModality(sopClass);
if (!modalityName) modalityName = dcmFindNameOfUID(sopClass);
if (!modalityName) modalityName = "unknown SOP class";
OFLOG_ERROR(storescuLogger, "No presentation context for: (" << modalityName << ") " << sopClass);
if (storescuLogger.isEnabledFor(OFLogger::ERROR_LOG_LEVEL))
{
const char *modalityName = dcmSOPClassUIDToModality(sopClass);
if (!modalityName) modalityName = dcmFindNameOfUID(sopClass, "unknown SOP class");
OFLOG_ERROR(storescuLogger, "No presentation context for: (" << modalityName << ") " << sopClass);
}
renameFile(fname, ".bad");
return DIMSE_NOVALIDPRESENTATIONCONTEXTID;
}
Expand Down Expand Up @@ -1385,6 +1387,14 @@ storeSCU(T_ASC_Association *assoc, const char *fname)
/* if required, dump some more general information */
OFLOG_INFO(storescuLogger, "Sending Store Request (MsgID " << msgId << ", "
<< dcmSOPClassUIDToModality(sopClass, "OT") << ")");
/* the following is needed, because the presentation context ID is not shown otherwise */
if (storescuLogger.isEnabledFor(OFLogger::DEBUG_LOG_LEVEL))
{
const char *sopClassName = dcmFindKeywordOfUID(sopClass, sopClass /*defaultValue*/);
const char *netXferName = dcmFindKeywordOfUID(netTransfer.getXferID(), netTransfer.getXferID() /*defaultValue*/);
OFLOG_DEBUG(storescuLogger, " using Presentation Context ID " << OFstatic_cast(int, presID)
<< " = " << sopClassName << " with " << netXferName << " transfer syntax");
}

/* finally conduct transmission of data */
cond = DIMSE_storeUser(assoc, presID, &req,
Expand Down

0 comments on commit 4f5fe53

Please sign in to comment.