DCMTK  Version 3.6.1 20170228
OFFIS DICOM Toolkit
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
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...

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. More...
 
OFCondition setTransportLayer (DcmTransportLayer *tLayer)
 enable user-defined transport layer. More...
 
OFCondition dropNetwork ()
 destroy network struct. More...
 
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, const char *outputDirectory=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 occurred). More...
 

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). More...
 

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. More...
 
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 char *outputDirectory=NULL) const
 perform a single C-FIND transaction on association that is already open. More...
 
 DcmFindSCU (const DcmFindSCU &other)
 Private undefined copy constructor.
 
DcmFindSCUoperator= (const DcmFindSCU &other)
 Private undefined assignment operator.
 

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.

Member Function Documentation

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
paramsACSE parameter struct to be modified
abstractSyntaxSOP Class UID or Meta SOP Class UID of service
preferredTransferSyntaxMay 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 behavior 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::dropNetwork ( )

destroy network struct.

This should be done only once.

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 char *  outputDirectory = NULL 
) const
private

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

Parameters
assocDIMSE association
fnamefile name for the query file to be used with this query. May be NULL.
repeatCountnumber of times this query should be repeated (for debugging purposes, works only with default callback)
abstractSyntaxSOP Class UID or Meta SOP Class UID of service
blockModeDIMSE blocking mode
dimse_timeouttimeout for DIMSE operations (in seconds)
extractResponsesToFileif true, extract incoming response messages to file (works only with default callback)
cancelAfterNResponsesissue C-FIND-CANCEL after given number of responses (works only with default callback)
overrideKeyslist 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.
callbackuser-provided non-default callback handler object. For default callback, pass NULL.
outputDirectorydirectory used to store the output files (e.g. response messages). If NULL, the current directory is used.
Returns
EC_Normal if successful, an error code otherwise
OFCondition DcmFindSCU::initializeNetwork ( int  acse_timeout)

initialize the network structure.

This should be done only once.

Parameters
acse_timeouttimeout for ACSE operations, in seconds
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,
const char *  outputDirectory = 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 occurred).

Parameters
peerhostname or IP address of peer SCP host
portTCP port number of peer SCP host
ourTitlecalling AE title
peerTitlecalled AE title
abstractSyntaxSOP Class UID or Meta SOP Class UID of service
preferredTransferSyntaxMay 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 behavior can be modified by explicitly specifying the preferred explicit VR transfer syntax. With Little Endian Implicit, only Implicit VR is proposed.
blockModeDIMSE blocking mode
dimse_timeouttimeout for DIMSE operations (in seconds)
maxReceivePDULengthlimit 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).
secureConnectionthis 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.
abortAssociationabort association instead of releasing it (for debugging purposes)
repeatCountnumber of times this query should be repeated (for debugging purposes, works only with default callback)
extractResponsesToFileif true, extract incoming response messages to file (works only with default callback)
cancelAfterNResponsesissue C-FIND-CANCEL after given number of responses (works only with default callback)
overrideKeyslist 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.
callbackuser-provided non-default callback handler object. For default callback, pass NULL.
fileNameListlist 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).
outputDirectorydirectory used to store the output files (e.g. response messages). If NULL, the current directory is used.
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
tLayerpointer to transport layer object
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
ofnamefilename to write
datasetdataset to store in file
Returns
EC_Normal if successful, an error code otherwise

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


Generated on Tue Feb 28 2017 for DCMTK Version 3.6.1 20170228 by Doxygen 1.8.8