00001 /* 00002 * 00003 * Copyright (C) 1994-2010, OFFIS e.V. 00004 * All rights reserved. See COPYRIGHT file for details. 00005 * 00006 * This software and supporting documentation were partly developed by 00007 * 00008 * OFFIS e.V. 00009 * R&D Division Health 00010 * Escherweg 2 00011 * D-26121 Oldenburg, Germany 00012 * 00013 * For further copyrights, see the following paragraphs. 00014 * 00015 */ 00016 00017 /* 00018 ** Copyright (C) 1993/1994, OFFIS, Oldenburg University and CERIUM 00019 ** 00020 ** This software and supporting documentation were 00021 ** developed by 00022 ** 00023 ** Institut OFFIS 00024 ** Bereich Kommunikationssysteme 00025 ** Westerstr. 10-12 00026 ** 26121 Oldenburg, Germany 00027 ** 00028 ** Fachbereich Informatik 00029 ** Abteilung Prozessinformatik 00030 ** Carl von Ossietzky Universitaet Oldenburg 00031 ** Ammerlaender Heerstr. 114-118 00032 ** 26111 Oldenburg, Germany 00033 ** 00034 ** CERIUM 00035 ** Laboratoire SIM 00036 ** Faculte de Medecine 00037 ** 2 Avenue du Pr. Leon Bernard 00038 ** 35043 Rennes Cedex, France 00039 ** 00040 ** for CEN/TC251/WG4 as a contribution to the Radiological 00041 ** Society of North America (RSNA) 1993 Digital Imaging and 00042 ** Communications in Medicine (DICOM) Demonstration. 00043 ** 00044 ** THIS SOFTWARE IS MADE AVAILABLE, AS IS, AND NEITHER OFFIS, 00045 ** OLDENBURG UNIVERSITY NOR CERIUM MAKE ANY WARRANTY REGARDING 00046 ** THE SOFTWARE, ITS PERFORMANCE, ITS MERCHANTABILITY OR 00047 ** FITNESS FOR ANY PARTICULAR USE, FREEDOM FROM ANY COMPUTER 00048 ** DISEASES OR ITS CONFORMITY TO ANY SPECIFICATION. THE 00049 ** ENTIRE RISK AS TO QUALITY AND PERFORMANCE OF THE SOFTWARE 00050 ** IS WITH THE USER. 00051 ** 00052 ** Copyright of the software and supporting documentation 00053 ** is, unless otherwise stated, jointly owned by OFFIS, 00054 ** Oldenburg University and CERIUM and free access is hereby 00055 ** granted as a license to use this software, copy this 00056 ** software and prepare derivative works based upon this 00057 ** software. However, any distribution of this software 00058 ** source code or supporting documentation or derivative 00059 ** works (source code and supporting documentation) must 00060 ** include the three paragraphs of this copyright notice. 00061 ** 00062 */ 00063 00064 /* 00065 ** 00066 ** Author: Andrew Hewett Created: 11-08-93 00067 ** 00068 ** Module: diutil 00069 ** 00070 ** Purpose: 00071 ** This file contains the interface to 00072 ** some general useful dicom utility routines 00073 ** 00074 ** Module Prefix: DU_ 00075 ** 00076 ** Last Update: $Author: joergr $ 00077 ** Update Date: $Date: 2010-12-01 08:26:10 $ 00078 ** CVS/RCS Revision: $Revision: 1.12 $ 00079 ** Status: $State: Exp $ 00080 ** 00081 ** CVS/RCS Log at end of file 00082 */ 00083 00084 #ifndef DIUTIL_H 00085 #define DIUTIL_H 00086 00087 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ 00088 00089 #include "dcmtk/dcmnet/dicom.h" 00090 #include "dcmtk/dcmdata/dcdatset.h" 00091 #include "dcmtk/dcmnet/dimse.h" 00092 #include "dcmtk/oflog/oflog.h" 00093 00094 00095 OFLogger DCM_dcmnetGetLogger(); 00096 00097 #define DCMNET_TRACE(msg) OFLOG_TRACE(DCM_dcmnetGetLogger(), msg) 00098 #define DCMNET_DEBUG(msg) OFLOG_DEBUG(DCM_dcmnetGetLogger(), msg) 00099 #define DCMNET_INFO(msg) OFLOG_INFO(DCM_dcmnetGetLogger(), msg) 00100 #define DCMNET_WARN(msg) OFLOG_WARN(DCM_dcmnetGetLogger(), msg) 00101 #define DCMNET_ERROR(msg) OFLOG_ERROR(DCM_dcmnetGetLogger(), msg) 00102 #define DCMNET_FATAL(msg) OFLOG_FATAL(DCM_dcmnetGetLogger(), msg) 00103 00104 00105 char* DU_stripTrailingSpaces(char *s); 00106 char* DU_stripLeadingSpaces(char *s); 00107 char* DU_stripLeadingAndTrailingSpaces(char *s); 00108 00109 OFBool DU_getStringDOElement(DcmItem *obj, DcmTagKey t, char *s); 00110 OFBool DU_putStringDOElement(DcmItem *obj, DcmTagKey t, const char *s); 00111 OFBool DU_getShortDOElement(DcmItem *obj, DcmTagKey t, Uint16 *us); 00112 OFBool DU_putShortDOElement(DcmItem *obj, DcmTagKey t, Uint16 us); 00113 00114 OFBool DU_findSOPClassAndInstanceInDataSet( 00115 DcmItem *obj, 00116 char* sopClass, 00117 char* sopInstance, 00118 OFBool tolerateSpacePaddedUIDs = OFFalse); 00119 00120 OFBool DU_findSOPClassAndInstanceInFile( 00121 const char *fname, 00122 char* sopClass, 00123 char* sopInstance, 00124 OFBool tolerateSpacePaddedUIDs = OFFalse); 00125 00126 const char *DU_cstoreStatusString(Uint16 statusCode); 00127 const char *DU_cfindStatusString(Uint16 statusCode); 00128 const char *DU_cmoveStatusString(Uint16 statusCode); 00129 const char *DU_cgetStatusString(Uint16 statusCode); 00130 00131 const char *DU_ncreateStatusString(Uint16 statusCode); 00132 const char *DU_ngetStatusString(Uint16 statusCode); 00133 const char *DU_nsetStatusString(Uint16 statusCode); 00134 const char *DU_nactionStatusString(Uint16 statusCode); 00135 const char *DU_ndeleteStatusString(Uint16 statusCode); 00136 const char *DU_neventReportStatusString(Uint16 statusCode); 00137 00138 #endif 00139 00140 /* 00141 ** CVS Log 00142 ** $Log: diutil.h,v $ 00143 ** Revision 1.12 2010-12-01 08:26:10 joergr 00144 ** Added OFFIS copyright header (beginning with the year 1994). 00145 ** 00146 ** Revision 1.11 2010-10-14 13:17:22 joergr 00147 ** Updated copyright header. Added reference to COPYRIGHT file. 00148 ** 00149 ** Revision 1.10 2010-05-21 11:47:52 uli 00150 ** Replaced DU_fileSize() with OFStandard::getFileSize(). 00151 ** 00152 ** Revision 1.9 2009-11-18 11:53:58 uli 00153 ** Switched to logging mechanism provided by the "new" oflog module. 00154 ** 00155 ** Revision 1.8 2007-07-12 12:18:00 onken 00156 ** Added status codes and corresponding printing routines for DIMSE-N. 00157 ** 00158 ** Revision 1.7 2005/12/08 16:02:22 meichel 00159 ** Changed include path schema for all DCMTK header files 00160 ** 00161 ** Revision 1.6 2002/11/25 18:00:37 meichel 00162 ** Converted compile time option to leniently handle space padded UIDs 00163 ** in the Storage Service Class into command line / config file option. 00164 ** 00165 ** Revision 1.5 2000/02/03 11:50:11 meichel 00166 ** Moved UID related functions from dcmnet (diutil.h) to dcmdata (dcuid.h) 00167 ** where they belong. Renamed access functions to dcmSOPClassUIDToModality 00168 ** and dcmGuessModalityBytes. 00169 ** 00170 ** Revision 1.4 1999/06/10 10:56:35 meichel 00171 ** Adapted imagectn to new command line option scheme. 00172 ** Added support for Patient/Study Only Q/R model and C-GET (experimental). 00173 ** 00174 ** Revision 1.3 1998/01/14 14:37:06 hewett 00175 ** Added basic support for the Structured Reporting (SR) SOP Classes. 00176 ** 00177 ** Revision 1.2 1997/07/21 08:40:11 andreas 00178 ** - Replace all boolean types (BOOLEAN, CTNBOOLEAN, DICOM_BOOL, BOOL) 00179 ** with one unique boolean type OFBool. 00180 ** 00181 ** Revision 1.1.1.1 1996/03/26 18:38:45 hewett 00182 ** Initial Release. 00183 ** 00184 ** 00185 */