/usr/include/dcmtk/dcmqrdb/dcmqrtis.h is in libdcmtk-dev 3.6.2-3build3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 | /*
*
* Copyright (C) 1993-2017, OFFIS e.V.
* All rights reserved. See COPYRIGHT file for details.
*
* This software and supporting documentation were developed by
*
* OFFIS e.V.
* R&D Division Health
* Escherweg 2
* D-26121 Oldenburg, Germany
*
*
* Module: dcmqrdb
*
* Author: Andrew Hewett
*
* Purpose: TI Common Constants, Types, Globals and Functions
*
*/
#ifndef DCMQRTIS_H
#define DCMQRTIS_H
#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */
#include "dcmtk/dcmnet/dicom.h"
#include "dcmtk/dcmnet/cond.h"
#include "dcmtk/dcmnet/assoc.h"
#include "dcmtk/dcmnet/dimse.h"
#include "dcmtk/ofstd/ofcmdln.h"
#include "dcmtk/dcmqrdb/dcmqrcnf.h"
class DcmQueryRetrieveDatabaseHandle;
/*
* Constants
*/
#define TI_MAXPEERS 100
#define TI_MAXDATABASES 100
#define TI_MAXSTUDIES 1000
#define TI_MAXSERIES 500
#define TI_MAXIMAGES 1000
/*
* Type definitions
*/
struct DCMTK_DCMQRDB_EXPORT TI_ImageEntry
{
DIC_UI sopInstanceUID;
DIC_IS imageNumber;
int intImageNumber;
} ;
struct DCMTK_DCMQRDB_EXPORT TI_SeriesEntry
{
DIC_UI seriesInstanceUID;
DIC_IS seriesNumber;
int intSeriesNumber;
DIC_CS modality;
TI_ImageEntry *images[TI_MAXIMAGES]; /* array of image pointers */
int imageCount;
time_t lastQueryTime; /* time we last queried db */
};
struct DCMTK_DCMQRDB_EXPORT TI_StudyEntry
{
DIC_UI studyInstanceUID;
DIC_CS studyID;
DIC_PN patientName;
DIC_LO patientID;
TI_SeriesEntry *series[TI_MAXSERIES]; /* array of series pointers */
int seriesCount;
time_t lastQueryTime; /* time we last queried db */
};
struct DCMTK_DCMQRDB_EXPORT TI_DBEntry
{
const char *title; /* the CTN AE Title associated with this DB */
const char **peerTitles; /* peer titles which can read this database
* and thus we can comminicate with */
int peerTitleCount; /* number of peer titles */
DcmQueryRetrieveDatabaseHandle *dbHandle; /* handle to current db */
TI_StudyEntry *studies[TI_MAXSTUDIES]; /* array of study pointers */
int studyCount;
int currentStudy; /* index of current study */
int currentSeries; /* index of current series in current study */
int currentImage; /* index of current image in current study */
time_t lastQueryTime; /* time we last queried db */
OFBool isRemoteDB; /* true if DB is remote */
};
struct DCMTK_DCMQRDB_EXPORT TI_GenericCallbackStruct
{
TI_DBEntry *db;
TI_StudyEntry *study;
TI_SeriesEntry *series;
};
typedef OFBool (*TI_GenericEntryCallbackFunction)(TI_GenericCallbackStruct *cbstruct, DcmDataset *reply);
/** this class provides the functionality of the telnet initiator application
*/
class DCMTK_DCMQRDB_EXPORT DcmQueryRetrieveTelnetInitiator
{
public:
/** constructor
* @param cfg configuration facility
*/
DcmQueryRetrieveTelnetInitiator(DcmQueryRetrieveConfig &cfg);
/** main entry point for console-based user interface
*/
void TI_userInput();
/** add remote peer to list of peers
* @param peerName name of peer
* @param configFileName name of configuration file from which peer was read
*/
OFBool addPeerName(const char *peerName, const char *configFileName);
/** print TI configuration to stdout
*/
void printConfig();
/** detach current association
* @param abortFlag if true, abort association instead of releasing it
*/
OFBool TI_detachAssociation(OFBool abortFlag);
/** set local aetitle
* @param ae aetitle
*/
void setAETitle(const char *ae)
{
myAETitle = ae;
}
/** set max receive PDU
* @param pdu max receive PDU size
*/
void setMaxPDU(OFCmdUnsignedInt pdu)
{
maxReceivePDULength = pdu;
}
/** activate first peer in list of peers
*/
void activateFirstPeer()
{
peerHostName = peerNames[0];
}
/** provide read/write access to network structure maintained by this object.
* Yes, this is ugly.
* @return pointer to pointer to network structure
*/
T_ASC_Network **accessNet()
{
return &net;
}
/// return number of databases
int getdbCount() const
{
return dbCount;
}
/** create configuration entries for remote databases
* @param configFileName name of configuration file
* @param remoteDBTitlesCount number of remote DB titles
* @param remoteDBTitles list of remote DB titles
*/
void createConfigEntries(
const char *configFileName,
int remoteDBTitlesCount,
const char **remoteDBTitles);
/** set the network transfer syntax
* @param xfer new network transfer syntax
*/
void setXferSyntax(E_TransferSyntax xfer) { networkTransferSyntax = xfer; }
/** set blocking mode and timeout for DIMSE operations
* @param blockMode blocking mode for DIMSE operations
* @param timeout timeout for DIMSE operations
*/
void setBlockMode(T_DIMSE_BlockingMode blockMode, int timeout)
{
blockMode_ = blockMode;
dimse_timeout_ = timeout;
}
private:
OFBool TI_attachAssociation();
OFBool TI_changeAssociation();
OFBool TI_sendEcho();
OFBool TI_storeImage(char *sopClass, char *sopInstance, char * imgFile);
OFBool TI_remoteFindQuery(
TI_DBEntry *db, DcmDataset *query,
TI_GenericEntryCallbackFunction callbackFunction,
TI_GenericCallbackStruct *callbackData);
OFBool TI_title(int arg, const char * /*cmdbuf*/ );
OFBool TI_attachDB(TI_DBEntry *db);
OFBool TI_database(int arg, const char * /*cmdbuf*/ );
OFBool TI_echo(int arg, const char * /*cmdbuf*/ );
OFBool TI_quit(int arg, const char * /*cmdbuf*/ );
OFBool TI_actualizeStudies();
OFBool TI_study(int arg, const char * /*cmdbuf*/ );
OFBool TI_actualizeSeries();
OFBool TI_series(int arg, const char * /*cmdbuf*/ );
OFBool TI_actualizeImages();
OFBool TI_image(int arg, const char * /*cmdbuf*/ );
OFBool TI_buildStudies(TI_DBEntry *db);
OFBool TI_buildSeries(TI_DBEntry *db, TI_StudyEntry *study);
OFBool TI_buildRemoteImages(TI_DBEntry *db, TI_StudyEntry *study, TI_SeriesEntry *series);
OFBool TI_buildImages(TI_DBEntry *db, TI_StudyEntry *study, TI_SeriesEntry *series);
OFBool TI_sendStudy(int arg, const char * /*cmdbuf*/ );
OFBool TI_sendSeries(int arg, const char * /*cmdbuf*/ );
OFBool TI_sendImage(int arg, const char * /*cmdbuf*/ );
OFBool TI_send(int /*arg*/, const char *cmdbuf);
OFBool TI_shortHelp(int /*arg*/ , const char * /*cmdbuf*/ );
OFBool TI_help(int arg, const char * /*cmdbuf*/ );
OFBool TI_buildRemoteStudies(TI_DBEntry *db);
OFBool TI_buildRemoteSeries(TI_DBEntry *db, TI_StudyEntry *study);
OFBool TI_dbReadable(const char *dbTitle);
time_t TI_dbModifyTime(const char *dbTitle);
OFCondition addPresentationContexts(T_ASC_Parameters *params);
void selectDestinationCharacterSet(OFString& destinationCharacterSet);
OFBool findDBPeerTitles(
const char *configFileName,
TI_DBEntry *dbEntry,
const char *peer);
/// the CTN databases we know
TI_DBEntry **dbEntries;
/// number of entries in databases we know
int dbCount;
/// current peer to talk to
const char *peerHostName;
/// list of peer names
const char *peerNames[TI_MAXPEERS];
/// number of peer names in list
int peerNamesCount;
/// my application entity title
const char *myAETitle;
/// active network
T_ASC_Network *net;
/// currently active association
T_ASC_Association *assoc;
/// number of bytes per PDU we can receive
OFCmdUnsignedInt maxReceivePDULength;
/// current database index
int currentdb;
/// current peer title
const char *currentPeerTitle;
/// configuration facility
DcmQueryRetrieveConfig& config;
/// network transfer syntax
E_TransferSyntax networkTransferSyntax;
/// blocking mode for DIMSE operations
T_DIMSE_BlockingMode blockMode_;
/// timeout for DIMSE operations
int dimse_timeout_;
};
#endif
|