DcmFindSCU Class Reference

This class implements a complete DICOM C-FIND SCU, including association set-up, execution of the C-FIND transaction including processing of results, and closing of the association. More...

List of all members.

Public Member Functions

 DcmFindSCU ()
 constructor, does not execute any network-related code
virtual ~DcmFindSCU ()
 destructor. Destroys network structure if not done already.
OFCondition initializeNetwork (int acse_timeout)
 initialize the network structure.
OFCondition setTransportLayer (DcmTransportLayer *tLayer)
 enable user-defined transport layer.
OFCondition dropNetwork ()
 destroy network struct.
OFCondition performQuery (const char *peer, unsigned int port, const char *ourTitle, const char *peerTitle, const char *abstractSyntax, E_TransferSyntax preferredTransferSyntax, T_DIMSE_BlockingMode blockMode, int dimse_timeout, Uint32 maxReceivePDULength, OFBool secureConnection, OFBool abortAssociation, unsigned int repeatCount, OFBool extractResponsesToFile, int cancelAfterNResponses, OFList< OFString > *overrideKeys, DcmFindSCUCallback *callback=NULL, OFList< OFString > *fileNameList=NULL)
 main worker method that negotiates an association, executes one or more C-FIND-RQ transactions, processes the responses and closes the association once everything is finished (or an error has occured).

Static Public Member Functions

static OFBool writeToFile (const char *ofname, DcmDataset *dataset)
 static helper function that writes the content of the given dataset into a DICOM file (using the DICOM file format with metaheader).

Private Member Functions

OFCondition addPresentationContext (T_ASC_Parameters *params, const char *abstractSyntax, E_TransferSyntax preferredTransferSyntax)
 add presentation context for given abstract syntax and given preferred transfer syntax to the ACSE parameter struct.
OFCondition findSCU (T_ASC_Association *assoc, const char *fname, int repeatCount, const char *abstractSyntax, T_DIMSE_BlockingMode blockMode, int dimse_timeout, OFBool extractResponsesToFile, int cancelAfterNResponses, OFList< OFString > *overrideKeys, DcmFindSCUCallback *callback=NULL) const
 perform a single C-FIND transaction on association that is already open.

Private Attributes

T_ASC_Networknet_
 pointer to network structure


Detailed Description

This class implements a complete DICOM C-FIND SCU, including association set-up, execution of the C-FIND transaction including processing of results, and closing of the association.

By default, incoming C-FIND-RSP messages will be displayed on console and, optionally, also stored in files. By providing a user-defined callback, other types of processing are possible.

Definition at line 149 of file dfindscu.h.


Member Function Documentation

OFCondition DcmFindSCU::initializeNetwork ( int  acse_timeout  ) 

initialize the network structure.

This should be done only once.

Parameters:
acse_timeout timeout for ACSE operations, in seconds
Returns:
EC_Normal if successful, an error code otherwise

OFCondition DcmFindSCU::setTransportLayer ( DcmTransportLayer tLayer  ) 

enable user-defined transport layer.

This method is needed when the network association should use a non-default transport layer (e.g. a TLS connection). In this case a fully initialized transport layer object must be passed with this call after a call to initializeNetwork, but prior to any call to performQuery. The transport layer object will not be deleted by this class and must remain alive until this object is deleted or a new transport layer is set.

Parameters:
tLayer pointer to transport layer object
Returns:
EC_Normal if successful, an error code otherwise

OFCondition DcmFindSCU::dropNetwork (  ) 

destroy network struct.

This should be done only once.

Returns:
EC_Normal if successful, an error code otherwise

OFCondition DcmFindSCU::performQuery ( const char *  peer,
unsigned int  port,
const char *  ourTitle,
const char *  peerTitle,
const char *  abstractSyntax,
E_TransferSyntax  preferredTransferSyntax,
T_DIMSE_BlockingMode  blockMode,
int  dimse_timeout,
Uint32  maxReceivePDULength,
OFBool  secureConnection,
OFBool  abortAssociation,
unsigned int  repeatCount,
OFBool  extractResponsesToFile,
int  cancelAfterNResponses,
OFList< OFString > *  overrideKeys,
DcmFindSCUCallback callback = NULL,
OFList< OFString > *  fileNameList = NULL 
)

main worker method that negotiates an association, executes one or more C-FIND-RQ transactions, processes the responses and closes the association once everything is finished (or an error has occured).

Parameters:
peer hostname or IP address of peer SCP host
port TCP port number of peer SCP host
ourTitle calling AE title
peerTitle called AE title
abstractSyntax SOP Class UID or Meta SOP Class UID of service
preferredTransferSyntax. May be Unknown, Implicit Little Endian, or any of the two uncompressed explicit VR transfer syntaxes. By default (unknown), local endian explicit VR is proposed first, followed by opposite endian explicit VR, followed by implicit VR. This behaviour can be modified by explicitly specifying the preferred explicit VR transfer syntax. With Little Endian Implicit, only Implicit VR is proposed.
blockMode DIMSE blocking mode
dimse_timeout timeout for DIMSE operations (in seconds)
maxReceivePDULength limit the maximum PDU size for incoming PDUs to the given value. This value should be less than or equal to ASC_DEFAULTMAXPDU, and is usually identical to ASC_DEFAULTMAXPDU (other values are only useful for debugging purposes).
secureConnection this flag, if true, requests a secure TLS connection to be used instead of a normal connection. This will only work if DCMTK has been compiled with OpenSSL support (WITH_OPENSSL) and if a transport layer object supporting secure connections has been set with setTransportLayer() prior to this call.
abortAssociation abort association instead of releasing it (for debugging purposes)
repeatCount number of times this query should be repeated (for debugging purposes, works only with default callback)
extractResponsesToFile if true, extract incoming response messages to file (works only with default callback)
cancelAfterNResponses issue C-FIND-CANCEL after given number of responses (works only with default callback)
overrideKeys list of keys/paths that override those in the query files, if any. Either the list of query files or override keys or both should be non-empty, because the query dataset will be empty otherwise. For path syntax see DcmPath.
callback user-provided non-default callback handler object. For default callback, pass NULL.
fileNameList list of query files. Each file is expected to be a DICOM file containing a dataset that is used as a query, possibly modified by override keys, if any. This parameter, if non-NULL, points to a list of filenames (paths).
Returns:
EC_Normal if successful, an error code otherwise

static OFBool DcmFindSCU::writeToFile ( const char *  ofname,
DcmDataset dataset 
) [static]

static helper function that writes the content of the given dataset into a DICOM file (using the DICOM file format with metaheader).

This method produces a temporary copy of the dataset and should, therefore, not be used with very large datasets.

Parameters:
ofname filename to write
dataset dataset to store in file
Returns:
EC_Normal if successful, an error code otherwise

OFCondition DcmFindSCU::addPresentationContext ( T_ASC_Parameters params,
const char *  abstractSyntax,
E_TransferSyntax  preferredTransferSyntax 
) [private]

add presentation context for given abstract syntax and given preferred transfer syntax to the ACSE parameter struct.

Parameters:
params ACSE parameter struct to be modified
abstractSyntax SOP Class UID or Meta SOP Class UID of service
preferredTransferSyntax. May be Unknown, Implicit Little Endian, or any of the two uncompressed explicit VR transfer syntaxes. By default (unknown), local endian explicit VR is proposed first, followed by opposite endian explicit VR, followed by implicit VR. This behaviour can be modified by explicitly specifying the preferred explicit VR transfer syntax. With Little Endian Implicit, only Implicit VR is proposed.
Returns:
EC_Normal if successful, an error code otherwise

OFCondition DcmFindSCU::findSCU ( T_ASC_Association assoc,
const char *  fname,
int  repeatCount,
const char *  abstractSyntax,
T_DIMSE_BlockingMode  blockMode,
int  dimse_timeout,
OFBool  extractResponsesToFile,
int  cancelAfterNResponses,
OFList< OFString > *  overrideKeys,
DcmFindSCUCallback callback = NULL 
) const [private]

perform a single C-FIND transaction on association that is already open.

Parameters:
assoc DIMSE association
fname file name for the query file to be used with this query. May be NULL.
repeatCount number of times this query should be repeated (for debugging purposes, works only with default callback)
abstractSyntax SOP Class UID or Meta SOP Class UID of service
blockMode DIMSE blocking mode
dimse_timeout timeout for DIMSE operations (in seconds)
extractResponsesToFile if true, extract incoming response messages to file (works only with default callback)
cancelAfterNResponses issue C-FIND-CANCEL after given number of responses (works only with default callback)
overrideKeys dataset with keys that override those in the query file, if any. Either query file or override keys or both should be non-empty, because the query dataset will be empty otherwise.
callback user-provided non-default callback handler object. For default callback, pass NULL.
Returns:
EC_Normal if successful, an error code otherwise


The documentation for this class was generated from the following file:


Generated on 6 Jan 2011 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.5.1