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