Inheritance diagram for DcmSCU:
Public Member Functions | |
DcmSCU () | |
Constructor, just initializes internal class members. | |
virtual | ~DcmSCU () |
Virtual destructor. | |
OFCondition | addPresentationContext (const OFString &abstractSyntax, const OFList< OFString > &xferSyntaxes) |
Add presentation context to be used for association negotiation. | |
virtual OFCondition | initNetwork () |
Initialize network, i.e. prepare for association negotiation. | |
virtual OFCondition | negotiateAssociation () |
Negotiate association by using presentation contexts and parameters as defined by earlier function calls. | |
T_ASC_PresentationContextID | findPresentationContextID (const OFString &abstractSyntax, const OFString &transferSyntax) |
After negotiation association, this call returns the first usable presentation context given the desired abstract syntax and transfer syntax. | |
virtual OFCondition | sendECHORequest (const T_ASC_PresentationContextID presID) |
This function sends a C-ECHO command via network to another DICOM application. | |
virtual OFCondition | sendSTORERequest (const T_ASC_PresentationContextID presID, const OFString &dicomFile, DcmDataset *dset, DcmDataset *&rspCommandSet, DcmDataset *&rspStatusDetail, Uint16 &rspStatusCode) |
This function sends a C-STORE request on the currently opened association and receives the corresponding response then. | |
virtual OFCondition | sendFINDRequest (T_ASC_PresentationContextID presID, DcmDataset *queryKeys, FINDResponses *responses) |
Sends a C-FIND Request on given presentation context and receives list of responses. | |
virtual OFCondition | handleFINDResponse (Uint16 presContextID, FINDResponse *response, OFBool &waitForNextResponse) |
This is the standard handler for C-FIND message responses: It just adds up all responses it receives and prints a DEBUG message. | |
virtual OFCondition | sendCANCELRequest (Uint16 presContextID) |
Send C-FIND-CANCEL and, therefore, ends the C-FIND session, i.e. no further responses will be handled. | |
virtual OFCondition | sendACTIONRequest (const T_ASC_PresentationContextID presID, const OFString &sopInstanceUID, const Uint16 actionTypeID, DcmDataset *reqDataset, Uint16 &rspStatusCode) |
This function sends a N-ACTION request on the currently opened association and receives the corresponding response then. | |
virtual OFCondition | handleEVENTREPORTRequest (DcmDataset *&reqDataset, Uint16 &eventTypeID, const int timeout=0) |
Receives N-EVENT-REPORT request on the currently opened association and sends a corresponding response. | |
virtual void | closeAssociation (const DcmCloseAssociationType closeType) |
Closes the association created by this SCU. | |
void | setMaxReceivePDULength (const unsigned long maxRecPDU) |
Set maximum PDU length (to be received by SCU). | |
void | setDIMSEBlockingMode (const T_DIMSE_BlockingMode blockingMode) |
Set whether to send in DIMSE blocking or non-blocking mode. | |
void | setAETitle (const OFString &myAETtitle) |
Set SCU's AETitle to be used in association negotiation. | |
void | setPeerHostName (const OFString &peerHostName) |
Set SCP's host (hostname or IP address) to talk to in association negotiation. | |
void | setPeerAETitle (const OFString &peerAETitle) |
Set SCP's AETitle to talk to in association negotiation. | |
void | setPeerPort (const Uint16 peerPort) |
Set SCP's port number to connect to for association negotiation. | |
void | setDIMSETimeout (const Uint32 dimseTimeout) |
Set timeout for receiving DIMSE messages. | |
void | setACSETimeout (const Uint32 acseTimeout) |
Set timeout for receiving ACSE messages. | |
void | setAssocConfigFileAndProfile (const OFString &filename, const OFString &profile) |
Set an association configuration file and profile to be used. | |
void | setVerbosePCMode (const OFBool mode) |
Set whether to show presentation contexts in verbose or debug mode. | |
OFBool | isConnected () const |
Get current connection status. | |
Uint32 | getMaxReceivePDULength () const |
Returns maximum PDU length configured to be received by SCU. | |
T_DIMSE_BlockingMode | getDIMSEBlockingMode () const |
Returns whether DIMSE messaging is configured to be blocking or unblocking. | |
const OFString & | getAETitle () const |
Returns the SCU's own configured AETitle. | |
const OFString & | getPeerHostName () const |
Returns the SCP's (peer's) host name configured. | |
const OFString & | getPeerAETitle () const |
Returns the SCP's (peer's) AETitle configured. | |
Uint16 | getPeerPort () const |
Returns the SCP's (peer's) TCP/IP port configured. | |
Uint32 | getDIMSETimeout () const |
Returns the DIMSE timeout configured defining how long SCU will wait for DIMSE responses. | |
Uint32 | getACSETimeout () const |
Returns the timeout configured defining how long SCU will wait for messages during ACSE messaging (association negotiation). | |
OFBool | getVerbosePCMode () const |
Returns the verbose presentation context mode configured specifying whether details on the presentation contexts (negotiated during association setup) should be shown in verbose or debug mode. | |
OFBool | getTLSEnabled () const |
Returns whether SCU is configured to create a TLS connection with the SCP. | |
Protected Member Functions | |
OFCondition | sendDIMSEMessage (const T_ASC_PresentationContextID presID, T_DIMSE_Message *msg, DcmDataset *dataObject, DIMSE_ProgressCallback callback, void *callbackContext, DcmDataset **commandSet=NULL) |
Sends a DIMSE command and possibly also a dataset from a data object via network to another DICOM application. | |
OFCondition | getDatasetInfo (DcmDataset *dataset, OFString &sopClassUID, OFString &sopInstanceUID, E_TransferSyntax &transferSyntax) |
Returns SOP Class UID, SOP Instance UID and original transfer syntax for a given dataset. | |
OFCondition | useSecureConnection (DcmTransportLayer *tlayer) |
Tells DcmSCU to use a secure TLS connection described by the given TLS layer. | |
OFCondition | receiveDIMSECommand (T_ASC_PresentationContextID *presID, T_DIMSE_Message *msg, DcmDataset **statusDetail, DcmDataset **commandSet=NULL, const Uint32 timeout=0) |
Receive DIMSE command (excluding dataset!) over the currently open association. | |
OFCondition | receiveDIMSEDataset (T_ASC_PresentationContextID *presID, DcmDataset **dataObject, DIMSE_ProgressCallback callback, void *callbackContext) |
Receives one dataset (of instance data) via network from another DICOM application. | |
void | findPresentationContext (const T_ASC_PresentationContextID presID, OFString &abstractSyntax, OFString &transferSyntax) |
After negotiation association, this call returns the presentation context belonging to the given presentation context ID. | |
virtual Uint16 | checkEVENTREPORTRequest (T_DIMSE_N_EventReportRQ &request, DcmDataset *reqDataset) |
Check given N-EVENT-REPORT request and dataset for validity. | |
Private Member Functions | |
DcmSCU (const DcmSCU &src) | |
Private undefined copy-constructor. | |
DcmSCU & | operator= (const DcmSCU &src) |
Private undefined operator=. | |
Uint16 | nextMessageID () |
Returns next available message ID free to be used by SCU. | |
Private Attributes | |
T_ASC_Association * | m_assoc |
Associaton of this SCU. This class only handles 1 association at a time. | |
T_ASC_Network * | m_net |
The DICOM network the association is based on. | |
T_ASC_Parameters * | m_params |
Association parameters. | |
OFString | m_assocConfigFilename |
Configuration file for presentation contexts (optional). | |
OFString | m_assocConfigProfile |
Profile in configuration file that should be used (optional). | |
OFList< DcmSCUPresContext > | m_presContexts |
List of presentation contexts that should be negotiated. | |
OFString | m_assocConfigFile |
Configuration file containing association parameters. | |
T_DIMSE_Message * | m_openDIMSERequest |
The last DIMSE successfully sent, unresponded DIMSE request. | |
Uint32 | m_maxReceivePDULength |
Maximum PDU size. | |
T_DIMSE_BlockingMode | m_blockMode |
DIMSE blocking mode. | |
OFString | m_ourAETitle |
AEtitle of this application. | |
OFString | m_peer |
Peer hostname. | |
OFString | m_peerAETitle |
AEtitle of remote application. | |
Uint16 | m_peerPort |
Port of remote application entity. | |
Uint32 | m_dimseTimeout |
DIMSE timeout. | |
Uint32 | m_acseTimeout |
ACSE timeout. | |
OFBool | m_verbosePCMode |
Verbose PC mode. | |
Classes | |
struct | DcmSCUPresContext |
Defines presentation context, consisting of one abstract syntax name and a list of transfer syntaxes for this abstract syntax. More... |
The class offers support for negotiating associations and sending and receiving arbitrary DIMSE messages on that connection. DcmSCU has built-in C-ECHO support so derived classes do not have to implement that capability on their own.
Definition at line 110 of file scu.h.
DcmSCU::DcmSCU | ( | const DcmSCU & | src | ) | [private] |
Private undefined copy-constructor.
Shall never be called.
src | Source object |
OFCondition DcmSCU::addPresentationContext | ( | const OFString & | abstractSyntax, | |
const OFList< OFString > & | xferSyntaxes | |||
) |
Add presentation context to be used for association negotiation.
abstractSyntax | [in] Abstract syntax name in UID format | |
xferSyntaxes | [in] List of transfer syntaxes to be added for the given abstract syntax |
virtual OFCondition DcmSCU::initNetwork | ( | ) | [virtual] |
Initialize network, i.e. prepare for association negotiation.
Reimplemented in DcmTLSSCU.
virtual OFCondition DcmSCU::negotiateAssociation | ( | ) | [virtual] |
Negotiate association by using presentation contexts and parameters as defined by earlier function calls.
If negotiation fails, there is no need to close the association or to do anything else with this class.
Reimplemented in DcmTLSSCU.
T_ASC_PresentationContextID DcmSCU::findPresentationContextID | ( | const OFString & | abstractSyntax, | |
const OFString & | transferSyntax | |||
) |
After negotiation association, this call returns the first usable presentation context given the desired abstract syntax and transfer syntax.
abstractSyntax | [in] The abstract syntax (UID) to look for | |
transferSyntax | [in] The transfer syntax (UID) to look for. If empty, the transfer syntax is not checked. |
virtual OFCondition DcmSCU::sendECHORequest | ( | const T_ASC_PresentationContextID | presID | ) | [virtual] |
This function sends a C-ECHO command via network to another DICOM application.
presID | [in] Presentation context ID to use. A value of 0 lets SCP class tries to choose one on its own. |
virtual OFCondition DcmSCU::sendSTORERequest | ( | const T_ASC_PresentationContextID | presID, | |
const OFString & | dicomFile, | |||
DcmDataset * | dset, | |||
DcmDataset *& | rspCommandSet, | |||
DcmDataset *& | rspStatusDetail, | |||
Uint16 & | rspStatusCode | |||
) | [virtual] |
This function sends a C-STORE request on the currently opened association and receives the corresponding response then.
presID | [in] Contains in the end the ID of the presentation context which was specified in the DIMSE command. If 0 is given, the function tries to find an approriate presentation context itself. | |
dicomFile | [in] The filename of the DICOM file to be sent. Alternatively, a dataset can be given in the next parameter. If both are given the dataset from the file name is used. | |
dset | [in] The dataset to be sent. Alternatively, a filename can be specified in the previous parameter. If both are given the dataset from the file name is used. | |
rspCommandSet | [out] If this parameter is not NULL it will return a copy of the DIMSE command which was received from the other DICOM application. | |
rspStatusDetail | [out] If a non-NULL value is passed this variable will in the end contain detailed information with regard to the status information which is captured in the status element (0000,0900). Note that the value for element (0000,0900) is not contained in this return value but in internal msg. For details on the structure of this object, see DICOM standard part 7, annex C). | |
rspStatusCode | [out] The response status code received. 0 means success, others can be found in the DICOM standard. |
virtual OFCondition DcmSCU::sendFINDRequest | ( | T_ASC_PresentationContextID | presID, | |
DcmDataset * | queryKeys, | |||
FINDResponses * | responses | |||
) | [virtual] |
Sends a C-FIND Request on given presentation context and receives list of responses.
The function receives the first response and then calls the function handleFINDResponse which gets the relevant presentation context together with the response dataset and status information. Then it waits again for the next response, if there are more to come (i.e. response status is PENDING). In the end, after receiving all responses, the full list of responses is returned to the caller. If he is not interested, he just sets responses=NULL when calling the function. This function can be overwritten by actual SCU implementations but just should work fine for most people.
TODO |
virtual OFCondition DcmSCU::handleFINDResponse | ( | Uint16 | presContextID, | |
FINDResponse * | response, | |||
OFBool & | waitForNextResponse | |||
) | [virtual] |
This is the standard handler for C-FIND message responses: It just adds up all responses it receives and prints a DEBUG message.
Therefore, it is called by for each response received in sendFINDRequest(). The idea is of course to overwrite this function in a derived, actual SCU implementation if required. Thus, after each response, the caller of sendFINDRequest() can decide on its own whether he wants to cancel the C-FIND session, terminate the association, do something useful or whatever. That way this is a more object oriented kind of callback.
TODO |
virtual OFCondition DcmSCU::sendCANCELRequest | ( | Uint16 | presContextID | ) | [virtual] |
Send C-FIND-CANCEL and, therefore, ends the C-FIND session, i.e. no further responses will be handled.
A call to this function only makes sense if an association is open, the given presentation context represents a valid C-FIND-enabled SOP class and usually only, if the last command send on that presentation context was a C-FIND message.
TODO |
virtual OFCondition DcmSCU::sendACTIONRequest | ( | const T_ASC_PresentationContextID | presID, | |
const OFString & | sopInstanceUID, | |||
const Uint16 | actionTypeID, | |||
DcmDataset * | reqDataset, | |||
Uint16 & | rspStatusCode | |||
) | [virtual] |
This function sends a N-ACTION request on the currently opened association and receives the corresponding response then.
presID | [in] The ID of the presentation context to be used for sending the request message. Should not be 0. | |
sopInstanceUID | [in] The requested SOP Instance UID | |
actionTypeID | [in] The action type ID to be used | |
reqDataset | [in] The dataset to be sent | |
rspStatusCode | [out] The response status code received. 0 means success, others can be found in the DICOM standard. |
virtual OFCondition DcmSCU::handleEVENTREPORTRequest | ( | DcmDataset *& | reqDataset, | |
Uint16 & | eventTypeID, | |||
const int | timeout = 0 | |||
) | [virtual] |
Receives N-EVENT-REPORT request on the currently opened association and sends a corresponding response.
Calls checkEVENTREPORTRequest() in order to determine the DIMSE status code to be used for the N-EVENT-REPORT response.
reqDataset | [out] Pointer to the dataset received | |
eventTypeID | [out] Event Type ID from the command set received | |
timeout | [in] Optional timeout in seconds for receiving data. This value (if not 0) overwrites the standard DIMSE timeout and also enables the non-blocking mode for receiving the request. |
virtual void DcmSCU::closeAssociation | ( | const DcmCloseAssociationType | closeType | ) | [virtual] |
Closes the association created by this SCU.
Also resets the current association.
closeType | [in] Define whether to release or abort the association |
Reimplemented in DcmTLSSCU.
void DcmSCU::setMaxReceivePDULength | ( | const unsigned long | maxRecPDU | ) |
Set maximum PDU length (to be received by SCU).
maxRecPDU | [in] The maximum PDU size to use in bytes |
void DcmSCU::setDIMSEBlockingMode | ( | const T_DIMSE_BlockingMode | blockingMode | ) |
Set whether to send in DIMSE blocking or non-blocking mode.
blockingMode | [in] Either blocking or non-blocking mode |
void DcmSCU::setAETitle | ( | const OFString & | myAETtitle | ) |
Set SCU's AETitle to be used in association negotiation.
myAETtitle | [in] The SCU's AETitle to be used |
void DcmSCU::setPeerHostName | ( | const OFString & | peerHostName | ) |
Set SCP's host (hostname or IP address) to talk to in association negotiation.
peerHostName | [in] The SCP's hostname or IP address to be used |
void DcmSCU::setPeerAETitle | ( | const OFString & | peerAETitle | ) |
Set SCP's AETitle to talk to in association negotiation.
peerAETitle | [in] The SCP's AETitle to be used |
void DcmSCU::setPeerPort | ( | const Uint16 | peerPort | ) |
Set SCP's port number to connect to for association negotiation.
peerPort | [in] The SCP's port number |
void DcmSCU::setDIMSETimeout | ( | const Uint32 | dimseTimeout | ) |
Set timeout for receiving DIMSE messages.
dimseTimeout | [in] DIMSE Timeout in seconds for receiving data. If the blocking mode is DIMSE_NONBLOCKING and we are trying to read data from the incoming socket stream and no data has been received. |
void DcmSCU::setACSETimeout | ( | const Uint32 | acseTimeout | ) |
Set timeout for receiving ACSE messages.
acseTimeout | [in] ACSE Timeout in seconds used by timer for message timeouts during association negotiation |
Set an association configuration file and profile to be used.
filename | [in] File name of the association configuration file | |
profile | [in] Profile inside the association negotiation file |
void DcmSCU::setVerbosePCMode | ( | const OFBool | mode | ) |
Set whether to show presentation contexts in verbose or debug mode.
mode | [in] Show presentation contexts in verbose mode if OFTrue. By default, the presentation contexts are shown in debug mode. |
OFBool DcmSCU::isConnected | ( | ) | const |
Get current connection status.
Uint32 DcmSCU::getMaxReceivePDULength | ( | ) | const |
Returns maximum PDU length configured to be received by SCU.
T_DIMSE_BlockingMode DcmSCU::getDIMSEBlockingMode | ( | ) | const |
Returns whether DIMSE messaging is configured to be blocking or unblocking.
const OFString& DcmSCU::getAETitle | ( | ) | const |
Returns the SCU's own configured AETitle.
const OFString& DcmSCU::getPeerHostName | ( | ) | const |
Returns the SCP's (peer's) host name configured.
const OFString& DcmSCU::getPeerAETitle | ( | ) | const |
Returns the SCP's (peer's) AETitle configured.
Uint16 DcmSCU::getPeerPort | ( | ) | const |
Returns the SCP's (peer's) TCP/IP port configured.
Uint32 DcmSCU::getDIMSETimeout | ( | ) | const |
Returns the DIMSE timeout configured defining how long SCU will wait for DIMSE responses.
Uint32 DcmSCU::getACSETimeout | ( | ) | const |
Returns the timeout configured defining how long SCU will wait for messages during ACSE messaging (association negotiation).
OFBool DcmSCU::getVerbosePCMode | ( | ) | const |
Returns the verbose presentation context mode configured specifying whether details on the presentation contexts (negotiated during association setup) should be shown in verbose or debug mode.
The latter is the default.
OFBool DcmSCU::getTLSEnabled | ( | ) | const |
Returns whether SCU is configured to create a TLS connection with the SCP.
OFCondition DcmSCU::sendDIMSEMessage | ( | const T_ASC_PresentationContextID | presID, | |
T_DIMSE_Message * | msg, | |||
DcmDataset * | dataObject, | |||
DIMSE_ProgressCallback | callback, | |||
void * | callbackContext, | |||
DcmDataset ** | commandSet = NULL | |||
) | [protected] |
Sends a DIMSE command and possibly also a dataset from a data object via network to another DICOM application.
presID | [in] Presentation context ID to be used for message | |
msg | [in] Structure that represents a certain DIMSE command which shall be sent | |
dataObject | [in] The instance data which shall be sent to the other DICOM application; NULL, if there is none | |
callback | [in] Pointer to a function which shall be called to indicate progress | |
callbackContext | [in] Pointer to data which shall be passed to the progress indicating function | |
commandSet | [out] If this parameter is not NULL it will return a copy of the DIMSE command which is sent to the other DICOM application |
OFCondition DcmSCU::getDatasetInfo | ( | DcmDataset * | dataset, | |
OFString & | sopClassUID, | |||
OFString & | sopInstanceUID, | |||
E_TransferSyntax & | transferSyntax | |||
) | [protected] |
Returns SOP Class UID, SOP Instance UID and original transfer syntax for a given dataset.
dataset | [in] The dataset to read from | |
sopClassUID | [out] The value of attribute SOP Class UID if present | |
sopInstanceUID | [out] The value of attribute SOP Instance UID if present | |
transferSyntax | [out] The value of transfer syntax that originally was read from disk |
OFCondition DcmSCU::useSecureConnection | ( | DcmTransportLayer * | tlayer | ) | [protected] |
Tells DcmSCU to use a secure TLS connection described by the given TLS layer.
tlayer | [in] The TLS transport layer including all TLS parameters |
OFCondition DcmSCU::receiveDIMSECommand | ( | T_ASC_PresentationContextID * | presID, | |
T_DIMSE_Message * | msg, | |||
DcmDataset ** | statusDetail, | |||
DcmDataset ** | commandSet = NULL , |
|||
const Uint32 | timeout = 0 | |||
) | [protected] |
Receive DIMSE command (excluding dataset!) over the currently open association.
presID | [out] Contains in the end the ID of the presentation context which was specified in the DIMSE command received | |
msg | [out] The message received | |
statusDetail | [out] If a non-NULL value is passed this variable will in the end contain detailed information with regard to the status information which is captured in the status element (0000,0900). Note that the value for element (0000,0900) is not contained in this return value but in internal msg. For details on the structure of this object, see DICOM standard part 7, annex C). | |
commandSet | [out] If this parameter is not NULL, it will return a copy of the DIMSE command which was received from the other DICOM application. The caller is responsible to de-allocate the returned object! | |
timeout | [in] If this parameter is not 0, it specifies the timeout (in seconds) to be used for receiving the DIMSE command. Otherwise, the default timeout value is used (see setDIMSETimeout()). |
OFCondition DcmSCU::receiveDIMSEDataset | ( | T_ASC_PresentationContextID * | presID, | |
DcmDataset ** | dataObject, | |||
DIMSE_ProgressCallback | callback, | |||
void * | callbackContext | |||
) | [protected] |
Receives one dataset (of instance data) via network from another DICOM application.
presID | [out] Contains in the end the ID of the presentation context which was used in the PDVs that were received on the network. If the PDVs show different presentation context IDs, this function will return an error. | |
dataObject | [out] Contains in the end the information which was received over the network | |
callback | [in] Pointer to a function which shall be called to indicate progress | |
callbackContext | [in] Pointer to data which shall be passed to the progress indicating function |
void DcmSCU::findPresentationContext | ( | const T_ASC_PresentationContextID | presID, | |
OFString & | abstractSyntax, | |||
OFString & | transferSyntax | |||
) | [protected] |
After negotiation association, this call returns the presentation context belonging to the given presentation context ID.
presID | [in] The presentation context ID to look for | |
abstractSyntax | [out] The abstract syntax (UID) for that ID. Empty, if such a presentation context does not exist. | |
transferSyntax | [out] The transfer syntax (UID) for that ID. Empty, if such a presentation context does not exist. |
virtual Uint16 DcmSCU::checkEVENTREPORTRequest | ( | T_DIMSE_N_EventReportRQ & | request, | |
DcmDataset * | reqDataset | |||
) | [protected, virtual] |
Check given N-EVENT-REPORT request and dataset for validity.
This method is called by handleEVENTREPORTRequest() before sending the response in order to determine the DIMSE status code to be used for the response message.
request | [in] The N-EVENT-REPORT request message data structure | |
reqDataset | [in] The N-EVENT-REPORT request dataset received. Might be NULL. |
Private undefined operator=.
Shall never be called.
src | Source object |
Uint16 DcmSCU::nextMessageID | ( | ) | [private] |
Returns next available message ID free to be used by SCU.