DCMTK
Version 3.6.3
OFFIS DICOM Toolkit
|
Base class for implementing DICOM Service Class User functionality. More...
Classes | |
struct | DcmSCUPresContext |
Defines presentation context, consisting of one abstract syntax name and a list of transfer syntaxes for this abstract syntax. More... | |
Public Member Functions | |
DcmSCU () | |
Constructor, just initializes internal class members. | |
virtual | ~DcmSCU () |
Virtual destructor. | |
OFCondition | addPresentationContext (const OFString &abstractSyntax, const OFList< OFString > &xferSyntaxes, const T_ASC_SC_ROLE role=ASC_SC_ROLE_DEFAULT) |
Add presentation context to be used for association negotiation. More... | |
virtual OFCondition | initNetwork () |
Initialize network, i.e. prepare for association negotiation. More... | |
virtual OFCondition | negotiateAssociation () |
Negotiate association by using presentation contexts and parameters as defined by earlier function calls. More... | |
T_ASC_PresentationContextID | findPresentationContextID (const OFString &abstractSyntax, const OFString &transferSyntax, const T_ASC_SC_ROLE requestorRole=ASC_SC_ROLE_DEFAULT) |
After negotiation association, this call returns the first usable presentation context given the desired abstract syntax and transfer syntax. More... | |
T_ASC_PresentationContextID | findAnyPresentationContextID (const OFString &abstractSyntax, const OFString &transferSyntax) |
After a successful association negotiation, this function is called to return the presentation context ID that best matches the desired abstract syntax and transfer syntax (TS). More... | |
virtual OFCondition | sendECHORequest (const T_ASC_PresentationContextID presID) |
This function sends a C-ECHO command via network to another DICOM application. More... | |
virtual OFCondition | sendSTORERequest (const T_ASC_PresentationContextID presID, const OFFilename &dicomFile, DcmDataset *dataset, Uint16 &rspStatusCode, const OFString &moveOriginatorAETitle="", const Uint16 moveOriginatorMsgID=0) |
This function sends a C-STORE request on the currently opened association and receives the corresponding response then. More... | |
virtual OFCondition | sendMOVERequest (const T_ASC_PresentationContextID presID, const OFString &moveDestinationAETitle, DcmDataset *dataset, OFList< RetrieveResponse *> *responses) |
Sends a C-MOVE Request on given presentation context and receives list of responses. More... | |
virtual OFCondition | handleMOVEResponse (const T_ASC_PresentationContextID presID, RetrieveResponse *response, OFBool &waitForNextResponse) |
This is the standard handler for C-MOVE message responses: It just adds up all responses it receives and prints a DEBUG message. More... | |
virtual OFCondition | sendCGETRequest (const T_ASC_PresentationContextID presID, DcmDataset *dataset, OFList< RetrieveResponse *> *responses) |
Sends a C-GET Request on given presentation context and receives list of responses. More... | |
virtual OFCondition | handleCGETSession (const T_ASC_PresentationContextID presID, DcmDataset *dataset, OFList< RetrieveResponse *> *responses) |
Does the logic for switching between C-GET Response and C-STORE Requests. More... | |
virtual OFCondition | handleCGETResponse (const T_ASC_PresentationContextID presID, RetrieveResponse *response, OFBool &continueCGETSession) |
Function handling a single C-GET Response. More... | |
virtual OFCondition | handleSTORERequest (const T_ASC_PresentationContextID presID, DcmDataset *incomingObject, OFBool &continueCGETSession, Uint16 &cStoreReturnStatus) |
Function handling a single C-STORE Request. More... | |
virtual OFCondition | handleSTORERequestFile (T_ASC_PresentationContextID *presID, const OFString &filename, T_DIMSE_C_StoreRQ *request) |
Function handling a single C-STORE Request. More... | |
virtual OFCondition | sendFINDRequest (const T_ASC_PresentationContextID presID, DcmDataset *queryKeys, OFList< QRResponse *> *responses) |
Sends a C-FIND Request on given presentation context and receives list of responses. More... | |
virtual OFCondition | handleFINDResponse (const T_ASC_PresentationContextID presID, QRResponse *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. More... | |
virtual OFCondition | sendCANCELRequest (const T_ASC_PresentationContextID presID) |
Send C-CANCEL and, therefore, ends the C-FIND -GET or -MOVE session, i.e. no further responses will be handled. More... | |
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. More... | |
virtual OFCondition | sendEVENTREPORTRequest (const T_ASC_PresentationContextID presID, const OFString &sopInstanceUID, const Uint16 eventTypeID, DcmDataset *reqDataset, Uint16 &rspStatusCode) |
This function sends N-EVENT-REPORT request and receives the corresponding response. More... | |
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. More... | |
virtual void | closeAssociation (const DcmCloseAssociationType closeType) |
Closes the association created by this SCU. More... | |
virtual OFCondition | releaseAssociation () |
Releases the current association by sending an A-RELEASE request to the SCP. More... | |
virtual OFCondition | abortAssociation () |
Aborts the current association by sending an A-ABORT request to the SCP. More... | |
void | setMaxReceivePDULength (const Uint32 maxRecPDU) |
Set maximum PDU length (to be received by SCU) More... | |
void | setDIMSEBlockingMode (const T_DIMSE_BlockingMode blockingMode) |
Set whether to send in DIMSE blocking or non-blocking mode. More... | |
void | setAETitle (const OFString &myAETtitle) |
Set SCU's AE title to be used in association negotiation. More... | |
void | setPeerHostName (const OFString &peerHostName) |
Set SCP's host (host name or IP address) to talk to in association negotiation. More... | |
void | setPeerAETitle (const OFString &peerAETitle) |
Set SCP's AE title to talk to in association negotiation. More... | |
void | setPeerPort (const Uint16 peerPort) |
Set SCP's port number to connect to for association negotiation. More... | |
void | setDIMSETimeout (const Uint32 dimseTimeout) |
Set timeout for receiving DIMSE messages. More... | |
void | setACSETimeout (const Uint32 acseTimeout) |
Set timeout for receiving ACSE messages. More... | |
void | setConnectionTimeout (const Sint32 connectionTimeout) |
Set global timeout for connecting to the SCP. More... | |
void | setAssocConfigFileAndProfile (const OFString &filename, const OFString &profile) |
Set an association configuration file and profile to be used. More... | |
void | setStorageDir (const OFString &storeDir) |
Set the directory that should be used by the standard C-GET handler to store objects that come in with the corresponding C-STORE requests. More... | |
void | setStorageMode (const DcmStorageMode storageMode) |
Set the storage mode to be used. More... | |
void | setVerbosePCMode (const OFBool mode) |
Set whether to show presentation contexts in verbose or debug mode. More... | |
void | setDatasetConversionMode (const OFBool mode) |
Set the mode that specifies whether the transfer syntax of the dataset can be changed for network transmission. More... | |
void | setProgressNotificationMode (const OFBool mode) |
Set the mode that specifies whether the progress of sending and receiving DIMSE messages is notified by calling notifySENDProgress() and notifyRECEIVEProgress(), respectively. More... | |
OFBool | isConnected () const |
Get current connection status. More... | |
Uint32 | getMaxReceivePDULength () const |
Returns maximum PDU length configured to be received by SCU. More... | |
T_DIMSE_BlockingMode | getDIMSEBlockingMode () const |
Returns whether DIMSE messaging is configured to be blocking or unblocking. More... | |
const OFString & | getAETitle () const |
Returns the SCU's own configured AE title. More... | |
const OFString & | getPeerHostName () const |
Returns the SCP's (peer's) host configured. More... | |
const OFString & | getPeerAETitle () const |
Returns the SCP's (peer's) AE title configured. More... | |
Uint16 | getPeerPort () const |
Returns the SCP's (peer's) TCP/IP port configured. More... | |
Uint32 | getDIMSETimeout () const |
Returns DIMSE timeout in seconds for receiving data. More... | |
Uint32 | getACSETimeout () const |
Returns ACSE timeout in seconds used by timer for message timeouts during association negotiation. More... | |
Sint32 | getConnectionTimeout () const |
Returns the timeout configured defining how long SCU will wait for the SCP when requesting an association. More... | |
OFString | getStorageDir () const |
Returns the storage directory used for storing objects received with C-STORE requests in the context of C-GET sessions. More... | |
DcmStorageMode | getStorageMode () const |
Returns the storage mode enabled. More... | |
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. More... | |
OFBool | getDatasetConversionMode () const |
Returns the mode that specifies whether the transfer syntax of the dataset can be changed for network transmission. More... | |
OFBool | getProgressNotificationMode () const |
Returns the mode that specifies whether the progress of sending and receiving DIMSE messages is notified by calling notifySENDProgress() and notifyRECEIVEProgress(), respectively. More... | |
OFBool | getTLSEnabled () const |
Returns whether SCU is configured to create a TLS connection with the SCP. More... | |
void | freeNetwork () |
Deletes internal networking structures from memory. | |
Protected Member Functions | |
OFCondition | sendDIMSEMessage (const T_ASC_PresentationContextID presID, T_DIMSE_Message *msg, DcmDataset *dataObject, DcmDataset **commandSet=NULL) |
Sends a DIMSE command and possibly also a dataset from a data object via network to another DICOM application. More... | |
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. More... | |
OFCondition | useSecureConnection (DcmTransportLayer *tlayer) |
Tells DcmSCU to use a secure TLS connection described by the given TLS layer. More... | |
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. More... | |
OFCondition | receiveDIMSEDataset (T_ASC_PresentationContextID *presID, DcmDataset **dataObject) |
Receives one dataset (of instance data) via network from another DICOM application. More... | |
void | clearPresentationContexts () |
clear list of presentation contexts. More... | |
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. More... | |
virtual void | notifyInstanceStored (const OFString &filename, const OFString &sopClassUID, const OFString &sopInstanceUID) const |
This function is called if an object was received due to a C-GET request and can be overwritten by a user in order to be informed about such an event. More... | |
virtual void | notifySENDProgress (const unsigned long byteCount) |
This function is called while sending DIMSE messages, i.e. on each PDV of a dataset. More... | |
virtual void | notifyRECEIVEProgress (const unsigned long byteCount) |
This function is called while receiving DIMSE messages, i.e. on each PDV of a dataset. More... | |
virtual Uint16 | checkEVENTREPORTRequest (T_DIMSE_N_EventReportRQ &request, DcmDataset *reqDataset) |
Check given N-EVENT-REPORT request and dataset for validity. More... | |
virtual OFCondition | sendSTOREResponse (T_ASC_PresentationContextID presID, Uint16 status, const T_DIMSE_C_StoreRQ &request) |
Sends back a C-STORE response on the given presentation context, with the designated status, fitting the corresponding C-STORE request. More... | |
virtual OFString | createStorageFilename (DcmDataset *dataset) |
Helper function that generates a storage filename by extracting SOP Class and SOP Instance UID from a dataset and combining that with the configured storage directory. More... | |
virtual OFCondition | ignoreSTORERequest (T_ASC_PresentationContextID presID, const T_DIMSE_C_StoreRQ &request) |
Receives a DICOM dataset on a given presentation context ID but does not store it in memory or disk, thus ignoring it. More... | |
Static Protected Member Functions | |
static void | callbackSENDProgress (void *callbackContext, unsigned long byteCount) |
Callback function used for sending DIMSE messages. More... | |
static void | callbackRECEIVEProgress (void *callbackContext, unsigned long byteCount) |
Callback function used for receiving DIMSE messages. More... | |
Private Member Functions | |
DcmSCU (const DcmSCU &src) | |
Private undefined copy-constructor. More... | |
DcmSCU & | operator= (const DcmSCU &src) |
Private undefined operator=. More... | |
Uint16 | nextMessageID () |
Returns next available message ID free to be used by SCU. More... | |
Private Attributes | |
T_ASC_Association * | m_assoc |
Association 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 (default: 16384 bytes) | |
T_DIMSE_BlockingMode | m_blockMode |
DIMSE blocking mode (default: blocking) | |
OFString | m_ourAETitle |
AE title of this application (default: ANY-SCU) | |
OFString | m_peer |
Peer host (IP or host name) | |
OFString | m_peerAETitle |
AE title of remote application (default: ANY-SCP) | |
Uint16 | m_peerPort |
Port of remote application entity (default: 104) | |
Uint32 | m_dimseTimeout |
DIMSE timeout (default: unlimited) | |
Uint32 | m_acseTimeout |
ACSE timeout (default: 30 seconds) | |
OFString | m_storageDir |
Storage directory for objects received with C-STORE due to a running C-GET session. More... | |
DcmStorageMode | m_storageMode |
Set whether bit preserving storage should be enabled, i.e. any objects retrieved via C-STORE should be written directly to disk without any data correction/re-computation (e.g. group length calculations, padding, etc.). More... | |
OFBool | m_verbosePCMode |
Verbose PC mode (default: disabled) | |
OFBool | m_datasetConversionMode |
Dataset conversion mode (default: disabled) | |
OFBool | m_progressNotificationMode |
Progress notification mode (default: enabled) | |
Base class for implementing DICOM Service Class User functionality.
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.
|
private |
Private undefined copy-constructor.
Shall never be called.
src | Source object |
|
virtual |
Aborts the current association by sending an A-ABORT request to the SCP.
Please note that this abort only applies to associations that have been created by calling initNetwork() and negotiateAssociation().
OFCondition DcmSCU::addPresentationContext | ( | const OFString & | abstractSyntax, |
const OFList< OFString > & | xferSyntaxes, | ||
const T_ASC_SC_ROLE | role = ASC_SC_ROLE_DEFAULT |
||
) |
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 |
role | [in] The role to be negotiated |
|
staticprotected |
Callback function used for receiving DIMSE messages.
callbackContext | [in] The desired user callback data |
byteCount | [in] Progress bytes count |
|
staticprotected |
Callback function used for sending DIMSE messages.
callbackContext | [in] The desired user callback data |
byteCount | [in] Progress bytes count |
|
protectedvirtual |
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. |
|
protected |
clear list of presentation contexts.
In addition, any currently selected association configuration file is disabled.
|
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.
|
protectedvirtual |
Helper function that generates a storage filename by extracting SOP Class and SOP Instance UID from a dataset and combining that with the configured storage directory.
The SOP class is used to create an initial two letter abbreviation for the corresponding modality, e.g. CT. An example for a storage filename created by this function is "/storage_dir/CT.1.2.3.4.5" for a CT with SOP Instance UID "1.2.3.4.5". This function might be overwritten to change the filename behaviour completely. This function is only called if the SCU is in DCMSCU_STORAGE_DISK mode.
dataset | [in] The dataset that should be stored to disk |
T_ASC_PresentationContextID DcmSCU::findAnyPresentationContextID | ( | const OFString & | abstractSyntax, |
const OFString & | transferSyntax | ||
) |
After a successful association negotiation, this function is called to return the presentation context ID that best matches the desired abstract syntax and transfer syntax (TS).
The function tries to do the following:
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. |
|
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. |
T_ASC_PresentationContextID DcmSCU::findPresentationContextID | ( | const OFString & | abstractSyntax, |
const OFString & | transferSyntax, | ||
const T_ASC_SC_ROLE | requestorRole = ASC_SC_ROLE_DEFAULT |
||
) |
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. |
requestorRole | [in] The role to look for (denoting the role the association requestor plays) |
Uint32 DcmSCU::getACSETimeout | ( | ) | const |
Returns ACSE timeout in seconds used by timer for message timeouts during association negotiation.
const OFString& DcmSCU::getAETitle | ( | ) | const |
Returns the SCU's own configured AE title.
Sint32 DcmSCU::getConnectionTimeout | ( | ) | const |
Returns the timeout configured defining how long SCU will wait for the SCP when requesting an association.
-1 means infinite waiting (blocking), 0 means no waiting at all. Note that this is currently a global DCMTK setting.
OFBool DcmSCU::getDatasetConversionMode | ( | ) | const |
Returns the mode that specifies whether the transfer syntax of the dataset can be changed for network transmission.
This mainly covers the compression/decompression of datasets, which is disabled by default.
|
protected |
Returns SOP Class UID, SOP Instance UID and original transfer syntax for a given dataset.
If the dataset is NULL, all returned values will be undefined (i.e. empty or EXS_Unknown).
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. Will be unknown if the dataset was created in memory. |
T_DIMSE_BlockingMode DcmSCU::getDIMSEBlockingMode | ( | ) | const |
Returns whether DIMSE messaging is configured to be blocking or unblocking.
Uint32 DcmSCU::getDIMSETimeout | ( | ) | const |
Returns DIMSE timeout in seconds for receiving data.
If the blocking mode is DIMSE_NONBLOCKING the SCU will try to read data from the incoming socket stream for the number of seconds configured.
Uint32 DcmSCU::getMaxReceivePDULength | ( | ) | const |
Returns maximum PDU length configured to be received by SCU.
const OFString& DcmSCU::getPeerAETitle | ( | ) | const |
Returns the SCP's (peer's) AE title configured.
const OFString& DcmSCU::getPeerHostName | ( | ) | const |
Returns the SCP's (peer's) host configured.
Uint16 DcmSCU::getPeerPort | ( | ) | const |
Returns the SCP's (peer's) TCP/IP port configured.
OFBool DcmSCU::getProgressNotificationMode | ( | ) | const |
Returns the mode that specifies whether the progress of sending and receiving DIMSE messages is notified by calling notifySENDProgress() and notifyRECEIVEProgress(), respectively.
The progress notification is enabled by default.
OFString DcmSCU::getStorageDir | ( | ) | const |
Returns the storage directory used for storing objects received with C-STORE requests in the context of C-GET sessions.
Default is empty string which refers to the current working directory.
DcmStorageMode DcmSCU::getStorageMode | ( | ) | const |
Returns the storage mode enabled.
OFBool DcmSCU::getTLSEnabled | ( | ) | const |
Returns whether SCU is configured to create a TLS connection with the SCP.
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.
|
virtual |
Function handling a single C-GET Response.
This standard handler reads the status of the response and decides whether to receive any further messages related to the original C-GET Request or whether the last response was received or an error occurred.
presID | [in] The presentation context the C-GET Response was received on. |
response | [in] The response received |
continueCGETSession | [out] Defines whether it is decided to wait for further C-GET Responses/C-STORE Requests within this C-GET session |
|
virtual |
Does the logic for switching between C-GET Response and C-STORE Requests.
Sends a C-GET Request on given presentation context and receives list of responses. The full list of responses is returned to the caller. If he is not interested, he can set responses=NULL when calling the function. After sending a C-GET Request, there might be two different responses coming in: C-GET-RSP (optional after each received object and mandatory after the last object) or a mandatory C-STORE for each incoming object that is received due to the request. This function therefore either calls handleCGETResponse() or handleSTORERequest() in order to deal with the incoming message. All other messages lead to an error within this handler. This function can be overwritten by actual SCU implementations but just should work fine for most people.
presID | [in] The presentation context ID that should be used. Must be an odd number. |
dataset | [in] The dataset containing the information about the object(s) to be retrieved |
responses | [out] The incoming C-GET responses for this request. If the caller specifies NULL, no responses will be returned; otherwise there should be at least one final C-GET response (mandatory). C-GET responses after each DICOM object received are optional and may have been omitted by the server. |
|
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 |
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 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.
presID | [in] The presentation context ID where the response was received on. |
response | [in] The C-FIND response received. |
waitForNextResponse | [out] Denotes whether SCU should try to receive another response. If set to OFTrue, then sendFINDRequest() will continue waiting for responses. The current implementation does that for all responses do not have status SUCESSS. If set to OFFalse, sendFINDRequest() will return control to the caller. |
|
virtual |
This is the standard handler for C-MOVE message responses: It just adds up all responses it receives and prints a DEBUG message.
Therefore, it is called for each response received in sendMOVERequest(). The idea is of course to overwrite this function in a derived, actual SCU implementation if required. Thus, after each response, the caller of sendMOVERequest() can decide on its own whether he wants to cancel the C-MOVE session, terminate the association, do something useful or whatever. Thus this function is a more object-oriented kind of callback.
presID | [in] The presentation context ID where the response was received on. |
response | [in] The C-MOVE response received. |
waitForNextResponse | [out] Denotes whether SCU should try to receive another response. If set to OFTrue, then sendMOVERequest() will continue waiting for responses. The current implementation does that for all responses do not have status Failed, Warning, Success or unknown. If set to OFFalse, sendMOVERequest() will return control to the caller. |
|
virtual |
Function handling a single C-STORE Request.
If storage mode is set to disk (default), this function is called and the incoming object stored to disk.
presID | [in] The presentation context the C-STORE Request was received on. |
incomingObject | [in] The dataset (the object) received. The function takes ownership of the dataset, i.e. deletes it after processing. |
continueCGETSession | [out] Defines whether it is decided to wait for further C-GET Responses/C-STORE requests within this C-GET session. |
cStoreReturnStatus | [out] Denotes the desired C-STORE return status. |
|
virtual |
Function handling a single C-STORE Request.
If storage mode is set to bit preserving, this function is called and the incoming object stored directly to disk, i.e. not stored fully in memory.
presID | [in] The presentation context the C-STORE Response was received on. |
filename | [in] The filename to store to |
request | [in] The incoming C-STORE request command set |
|
protectedvirtual |
Receives a DICOM dataset on a given presentation context ID but does not store it in memory or disk, thus ignoring it.
presID | [in] The presentation context to be used |
request | [in] The corresponding C-STORE request |
|
virtual |
Initialize network, i.e. prepare for association negotiation.
If the SCU is already connected, the call will not be successful and the old connection keeps open.
Reimplemented in DcmTLSSCU.
OFBool DcmSCU::isConnected | ( | ) | const |
Get current connection status.
|
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 DcmStorageSCU, and DcmTLSSCU.
|
private |
Returns next available message ID free to be used by SCU.
|
protectedvirtual |
This function is called if an object was received due to a C-GET request and can be overwritten by a user in order to be informed about such an event.
The default implementation just prints a DEBUG message. Note that this function is not called if the SCU is in storage mode DCMSCU_STORAGE_IGNORE.
filename | [in] The filename written |
sopClassUID | [in] The SOP Class UID of the object written |
sopInstanceUID | [in] The SOP Instance UID of the object written |
|
protectedvirtual |
This function is called while receiving DIMSE messages, i.e. on each PDV of a dataset.
The default implementation just prints a TRACE message on the number of bytes received so far. By overwriting this method, the progress of the receive process can be shown to the user in a more appropriate way. The progress notification can also be disabled completely by calling setProgressNotificationMode().
byteCount | [in] Number of bytes received so far |
|
protectedvirtual |
This function is called while sending DIMSE messages, i.e. on each PDV of a dataset.
The default implementation just prints a TRACE message on the number of bytes sent so far. By overwriting this method, the progress of the send process can be shown to the user in a more appropriate way. The progress notification can also be disabled completely by calling setProgressNotificationMode().
byteCount | [in] Number of bytes sent so far |
Private undefined operator=.
Shall never be called.
src | Source object |
|
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()). |
|
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 |
|
virtual |
Releases the current association by sending an A-RELEASE request to the SCP.
Please note that this release only applies to associations that have been created by calling initNetwork() and negotiateAssociation().
|
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 |
Send C-CANCEL and, therefore, ends the C-FIND -GET or -MOVE 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/GET/MOVE-enabled SOP class and usually only, if the last command send on that presentation context was a C-FIND message.
presID | [in] The presentation context ID where the C-CANCEL should be sent on. |
|
virtual |
Sends a C-GET Request on given presentation context and receives list of responses.
It then switches control to the function handleCGETSession(). The full list of responses is returned to the caller. If he is not interested, he can set responses=NULL when calling the function. This function can be overwritten by actual SCU implementations but just should work fine for most people.
presID | [in] The presentation context ID that should be used. Must be an odd number. |
dataset | [in] The dataset containing the information about the object(s) to be retrieved |
responses | [out] The incoming C-GET responses for this request. If the caller specifies NULL, no responses will be returned; otherwise there should be at least one final C-GET response (mandatory). C-GET responses after each DICOM object received are optional and may have been omitted by the server. |
|
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 |
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 |
|
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 |
This function sends N-EVENT-REPORT request and receives the corresponding response.
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 |
eventTypeID | [in] The event type ID to be used |
reqDataset | [in] The request dataset to be sent |
rspStatusCode | [out] The response status code received. 0 means success, others can be found in the DICOM standard. |
|
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.
presID | [in] The presentation context ID that should be used. Must be an odd number. |
queryKeys | [in] The dataset containing the query keys to be searched for on the server (SCP). |
responses | [out] The incoming C-FIND responses for this request. The caller is responsible for providing a non-NULL pointer for this case. After receiving the results, the caller is responsible for freeing the memory of this variable. If NULL is specified, the responses will be not returned to the caller. |
|
virtual |
Sends a C-MOVE Request on given presentation context and receives list of responses.
The function receives the first response and then calls the function handleMOVEResponse() 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.
presID | [in] The presentation context ID that should be used. Must be an odd number. |
moveDestinationAETitle | [in] The move destination's AE title, i.e. the one that is used for connection to the storage server. |
dataset | [in] The dataset containing the information about the object(s) to be retrieved. |
responses | [out] The incoming C-MOVE responses for this request. The caller is responsible for providing a non-NULL pointer for this case. After receiving the results, the caller is responsible for freeing the memory of this variable. If NULL is specified, the responses will not be returned to the caller. |
|
virtual |
This function sends a C-STORE request on the currently opened association and receives the corresponding response then.
If required and supported, the dataset of the SOP instance can be converted automatically to the network transfer syntax that was negotiated (and is specified by the parameter 'presID'). However, this feature is disabled by default. See setDatasetConversionMode() on how to enable it.
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 appropriate presentation context itself (based on SOP class and original transfer syntax of the 'dicomFile' or 'dataset'). |
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. |
dataset | [in] The dataset to be sent. Alternatively, a filename can be specified in the previous parameter. If both are given the dataset from the filename is used. |
rspStatusCode | [out] The response status code received. 0 means success, others can be found in the DICOM standard. |
moveOriginatorAETitle | [in] If this C-STORE is started due to a C-MOVE request, this parameter informs the C-STORE SCP about the C-MOVE client's AE title. |
moveOriginatorMsgID | [in] If this C-STORE is started due to a C-MOVE request, this parameter informs the C-STORE SCP about the C-MOVE message ID. |
|
protectedvirtual |
Sends back a C-STORE response on the given presentation context, with the designated status, fitting the corresponding C-STORE request.
presID | [in] The presentation context ID to be used. |
status | [in] The storage DIMSE status to be used. |
request | [in] The C-STORE request that should be responded to. |
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 |
void DcmSCU::setAETitle | ( | const OFString & | myAETtitle | ) |
Set SCU's AE title to be used in association negotiation.
myAETtitle | [in] The SCU's AE title to be used |
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::setConnectionTimeout | ( | const Sint32 | connectionTimeout | ) |
Set global timeout for connecting to the SCP.
Note that this is a global DCMTK setting i.e. it affects all code that uses dcmnet to start a DICOM association to another host. Setting the timeout to -1 sets an infinite timeout, i.e. any association request will wait forever (blocking) until the SCP accepts the connection request. A value of 0 lets the SCU return immediately if the SCP is not reachable at the first attempt.
connectionTimeout | [in] Connection Timeout in seconds when connecting to SCPs. -1 will wait forever (blocking mode). |
void DcmSCU::setDatasetConversionMode | ( | const OFBool | mode | ) |
Set the mode that specifies whether the transfer syntax of the dataset can be changed for network transmission.
This mainly covers the compression/decompression of datasets, which is disabled by default.
mode | [in] Allow dataset conversion if OFTrue |
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::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 the SCU will try to read data from the incoming socket stream for the number of seconds configured. |
void DcmSCU::setMaxReceivePDULength | ( | const Uint32 | maxRecPDU | ) |
Set maximum PDU length (to be received by SCU)
maxRecPDU | [in] The maximum PDU size to use in bytes |
void DcmSCU::setPeerAETitle | ( | const OFString & | peerAETitle | ) |
Set SCP's AE title to talk to in association negotiation.
peerAETitle | [in] The SCP's AE title to be used |
void DcmSCU::setPeerHostName | ( | const OFString & | peerHostName | ) |
Set SCP's host (host name or IP address) to talk to in association negotiation.
peerHostName | [in] The SCP's hostname or IP address 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::setProgressNotificationMode | ( | const OFBool | mode | ) |
Set the mode that specifies whether the progress of sending and receiving DIMSE messages is notified by calling notifySENDProgress() and notifyRECEIVEProgress(), respectively.
The progress notification is enabled by default.
mode | [in] Disable progress notification if OFFalse |
void DcmSCU::setStorageDir | ( | const OFString & | storeDir | ) |
Set the directory that should be used by the standard C-GET handler to store objects that come in with the corresponding C-STORE requests.
storeDir | [in] The directory to store to. It is checked in handleSTORERequest() whether the directory is writeable and readable. By default, the received objects are stored in the current working directory. |
void DcmSCU::setStorageMode | ( | const DcmStorageMode | storageMode | ) |
Set the storage mode to be used.
Default is DCMSCU_STORAGE_DISK.
storageMode | The storage mode to be used. |
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. |
|
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 |
|
private |
Storage directory for objects received with C-STORE due to a running C-GET session.
By default, the received objects are stored in the current working directory.
|
private |
Set whether bit preserving storage should be enabled, i.e. any objects retrieved via C-STORE should be written directly to disk without any data correction/re-computation (e.g. group length calculations, padding, etc.).
This is especially interesting for retaining valid signatures, and also to receive huge files which cannot be fully received in memory. Default value: DCMSCU_STORAGE_DISK