OFFIS DCMTK  Version 3.6.0
dfindscu.h
1 /*
2  *
3  * Copyright (C) 1994-2010, OFFIS e.V.
4  * All rights reserved. See COPYRIGHT file for details.
5  *
6  * This software and supporting documentation were developed by
7  *
8  * OFFIS e.V.
9  * R&D Division Health
10  * Escherweg 2
11  * D-26121 Oldenburg, Germany
12  *
13  *
14  * Module: dcmnet
15  *
16  * Author: Marco Eichelberg / Andrew Hewett
17  *
18  * Purpose: Classes for Query/Retrieve Service Class User (C-FIND operation)
19  *
20  * Last Update: $Author: joergr $
21  * Update Date: $Date: 2010-10-14 13:17:22 $
22  * CVS/RCS Revision: $Revision: 1.5 $
23  * Status: $State: Exp $
24  *
25  * CVS/RCS Log at end of file
26  *
27  */
28 
29 #ifndef DFINDSCU_H
30 #define DFINDSCU_H
31 
32 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */
33 #include "dcmtk/ofstd/ofcond.h" /* for class OFCondition */
34 #include "dcmtk/dcmdata/dcxfer.h" /* for E_TransferSyntax */
35 #include "dcmtk/dcmnet/dimse.h" /* for T_DIMSE_BlockingMode */
36 
37 // forward declarations of classes and structs
38 class DcmDataset;
39 class DcmTransportLayer;
41 struct T_ASC_Association;
42 struct T_ASC_Parameters;
43 struct T_DIMSE_C_FindRQ;
44 struct T_DIMSE_C_FindRSP;
45 
59 {
60 public:
61 
64 
66  virtual ~DcmFindSCUCallback() {}
67 
74  virtual void callback(
75  T_DIMSE_C_FindRQ *request,
76  int responseCount,
77  T_DIMSE_C_FindRSP *rsp,
78  DcmDataset *responseIdentifiers) = 0;
79 
85  void setAssociation(T_ASC_Association *assoc);
86 
92  void setPresentationContextID(T_ASC_PresentationContextID presId);
93 
94 protected: /* the two member variables are protected and can be accessed from derived classes */
95 
98 
100  T_ASC_PresentationContextID presId_;
101 };
102 
103 
108 {
109 public:
116  OFBool extractResponsesToFile,
117  int cancelAfterNResponses);
118 
121 
128  virtual void callback(
129  T_DIMSE_C_FindRQ *request,
130  int responseCount,
131  T_DIMSE_C_FindRSP *rsp,
132  DcmDataset *responseIdentifiers);
133 
134 private:
135 
138 
141 };
142 
143 
150 {
151 public:
152 
154  DcmFindSCU();
155 
157  virtual ~DcmFindSCU();
158 
163  OFCondition initializeNetwork(int acse_timeout);
164 
177 
182 
223  const char *peer,
224  unsigned int port,
225  const char *ourTitle,
226  const char *peerTitle,
227  const char *abstractSyntax,
228  E_TransferSyntax preferredTransferSyntax,
229  T_DIMSE_BlockingMode blockMode,
230  int dimse_timeout,
231  Uint32 maxReceivePDULength,
232  OFBool secureConnection,
233  OFBool abortAssociation,
234  unsigned int repeatCount,
235  OFBool extractResponsesToFile,
236  int cancelAfterNResponses,
237  OFList<OFString> *overrideKeys,
238  DcmFindSCUCallback *callback = NULL,
239  OFList<OFString> *fileNameList = NULL);
240 
249  static OFBool writeToFile(const char* ofname, DcmDataset *dataset);
250 
251 private:
252 
265  T_ASC_Parameters *params,
266  const char *abstractSyntax,
267  E_TransferSyntax preferredTransferSyntax);
268 
289  T_ASC_Association * assoc,
290  const char *fname,
291  int repeatCount,
292  const char *abstractSyntax,
293  T_DIMSE_BlockingMode blockMode,
294  int dimse_timeout,
295  OFBool extractResponsesToFile,
296  int cancelAfterNResponses,
297  OFList<OFString> *overrideKeys,
298  DcmFindSCUCallback *callback = NULL) const;
299 
300 private:
301 
304 
305 };
306 
307 #endif
308 
309 /*
310  * CVS Log
311  * $Log: dfindscu.h,v $
312  * Revision 1.5 2010-10-14 13:17:22 joergr
313  * Updated copyright header. Added reference to COPYRIGHT file.
314  *
315  * Revision 1.4 2009-11-18 11:53:58 uli
316  * Switched to logging mechanism provided by the "new" oflog module.
317  *
318  * Revision 1.3 2009-07-10 13:21:04 onken
319  * Moved override key functionality to DcmPathProcessor.
320  *
321  * Revision 1.2 2009-07-08 16:14:25 onken
322  * Added support for specifying tag paths as override keys.
323  *
324  * Revision 1.1 2007-02-19 13:13:28 meichel
325  * Refactored findscu code into class DcmFindSCU, which is now part of the dcmnet
326  * library, and a short command line tool that only evaluates command line
327  * parameters and then makes use of this class. This facilitates re-use of the
328  * findscu code in other applications.
329  *
330  *
331  */
virtual ~DcmFindSCU()
destructor. Destroys network structure if not done already.
OFCondition setTransportLayer(DcmTransportLayer *tLayer)
enable user-defined transport layer.
virtual void callback(T_DIMSE_C_FindRQ *request, int responseCount, T_DIMSE_C_FindRSP *rsp, DcmDataset *responseIdentifiers)
callback method that is called once for each incoming C-FIND-RSP message.
T_ASC_Network * net_
pointer to network structure
Definition: dfindscu.h:303
OFCondition dropNetwork()
destroy network struct.
support class for console applications.
Definition: ofconapp.h:49
OFBool extractResponsesToFile_
if true, C-FIND-RSP datasets will be stored as DICOM files
Definition: dfindscu.h:137
virtual ~DcmFindSCUCallback()
destructor
Definition: dfindscu.h:66
void setPresentationContextID(T_ASC_PresentationContextID presId)
assigns a value to member variable presId_.
factory class which creates transport layer connections.
Definition: dcmlayer.h:74
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 pa...
virtual ~DcmFindSCUDefaultCallback()
destructor
Definition: dfindscu.h:120
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.
int cancelAfterNResponses_
if non-negative, a C-FIND-CANCEL will be issued after the given number of incoming C-FIND-RSP message...
Definition: dfindscu.h:140
DcmFindSCUCallback()
default constructor
OFCondition initializeNetwork(int acse_timeout)
initialize the network structure.
T_ASC_Association * assoc_
pointer to current association. Will contain valid value when callback() is called.
Definition: dfindscu.h:97
Abstract base class for Find SCU callbacks.
Definition: dfindscu.h:58
T_ASC_PresentationContextID presId_
current presentation context ID. Will contain valid value when callback() is called.
Definition: dfindscu.h:100
a class handling the DICOM dataset format (files without meta header)
Definition: dcdatset.h:46
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 DICO...
virtual void callback(T_DIMSE_C_FindRQ *request, int responseCount, T_DIMSE_C_FindRSP *rsp, DcmDataset *responseIdentifiers)=0
callback method that is called once for each incoming C-FIND-RSP message.
This class implements a complete DICOM C-FIND SCU, including association set-up, execution of the C-F...
Definition: dfindscu.h:149
void setAssociation(T_ASC_Association *assoc)
assigns a value to member variable assoc_.
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...
DcmFindSCUDefaultCallback(OFBool extractResponsesToFile, int cancelAfterNResponses)
constructor
DcmFindSCU()
constructor, does not execute any network-related code
Default implementation of FindSCU callback class.
Definition: dfindscu.h:107
General purpose class for condition codes.
Definition: ofcond.h:305


Generated on Sun Aug 23 2015 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.9.1