00001 /* 00002 * 00003 * Copyright (C) 1994-2005, OFFIS 00004 * 00005 * This software and supporting documentation were developed by 00006 * 00007 * Kuratorium OFFIS e.V. 00008 * Healthcare Information and Communication Systems 00009 * Escherweg 2 00010 * D-26121 Oldenburg, Germany 00011 * 00012 * THIS SOFTWARE IS MADE AVAILABLE, AS IS, AND OFFIS MAKES NO WARRANTY 00013 * REGARDING THE SOFTWARE, ITS PERFORMANCE, ITS MERCHANTABILITY OR 00014 * FITNESS FOR ANY PARTICULAR USE, FREEDOM FROM ANY COMPUTER DISEASES OR 00015 * ITS CONFORMITY TO ANY SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND 00016 * PERFORMANCE OF THE SOFTWARE IS WITH THE USER. 00017 * 00018 * Module: dcmdata 00019 * 00020 * Author: Gerd Ehlers, Andrew Hewett 00021 * 00022 * Purpose: Definition of the class DcmTag 00023 * 00024 * Last Update: $Author: meichel $ 00025 * Update Date: $Date: 2005/12/08 16:28:44 $ 00026 * Source File: $Source: /share/dicom/cvs-depot/dcmtk/dcmdata/include/dcmtk/dcmdata/dctag.h,v $ 00027 * CVS/RCS Revision: $Revision: 1.21 $ 00028 * Status: $State: Exp $ 00029 * 00030 * CVS/RCS Log at end of file 00031 * 00032 */ 00033 00034 #ifndef DCTAG_H 00035 #define DCTAG_H 00036 00037 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ 00038 #include "dcmtk/ofstd/ofcond.h" 00039 #include "dcmtk/dcmdata/dctagkey.h" 00040 #include "dcmtk/dcmdata/dcvr.h" 00041 00043 #define DcmTag_ERROR_TagName "Unknown Tag & Data" 00044 00045 00055 class DcmTag: public DcmTagKey 00056 { 00057 public: 00059 DcmTag(); 00060 00067 DcmTag(const DcmTagKey& akey); 00068 00076 DcmTag(Uint16 g, Uint16 e); 00077 00084 DcmTag(const DcmTagKey& akey, const DcmVR& avr); 00085 00093 DcmTag(Uint16 g, Uint16 e, const DcmVR& avr); 00094 00096 DcmTag(const DcmTag& tag); 00097 00099 ~DcmTag(); 00100 00102 DcmTag& operator=(const DcmTag& tag); 00103 00105 DcmVR setVR(const DcmVR& avr); 00106 00108 DcmVR getVR() const { return vr; } 00109 00111 DcmEVR getEVR() const { return vr.getEVR(); } 00112 00114 const char* getVRName() const { return vr.getVRName(); } 00115 00119 Uint16 getGTag() const { return getGroup(); } 00120 00124 Uint16 getETag() const { return getElement(); } 00125 00129 DcmTagKey getXTag() const 00130 { 00131 return * OFstatic_cast(const DcmTagKey *, this); 00132 } 00133 00141 const char* getTagName(); 00142 00147 const char* getPrivateCreator() const; 00148 00154 void setPrivateCreator(const char *privCreator); 00155 00161 void lookupVRinDictionary(); 00162 00167 OFBool isSignable() const; 00168 00171 OFBool isUnknownVR() const; 00172 00174 OFCondition error() const { return errorFlag; } 00175 00176 // --- static helper functions --- 00177 00189 static OFCondition findTagFromName(const char *name, 00190 DcmTag &value); 00191 private: 00192 00196 void updateTagName(const char *c); 00197 00201 void updatePrivateCreator(const char *c); 00202 00204 DcmVR vr; 00205 00207 char *tagName; 00208 00210 char *privateCreator; 00211 00213 OFCondition errorFlag; 00214 00215 }; 00216 00217 00218 // *** global constants ******************************** 00219 00220 00221 #define ItemTag (DcmTag(DCM_Item)) 00222 #define InternalUseTag (DcmTag(DcmTagKey(0xfffe, 0xfffe))) 00223 00224 00225 #endif /* !DCTAG_H */ 00226 00227 /* 00228 ** CVS/RCS Log: 00229 ** $Log: dctag.h,v $ 00230 ** Revision 1.21 2005/12/08 16:28:44 meichel 00231 ** Changed include path schema for all DCMTK header files 00232 ** 00233 ** Revision 1.20 2003/08/14 09:00:56 meichel 00234 ** Adapted type casts to new-style typecast operators defined in ofcast.h 00235 ** 00236 ** Revision 1.19 2002/07/23 14:21:27 meichel 00237 ** Added support for private tag data dictionaries to dcmdata 00238 ** 00239 ** Revision 1.18 2002/05/24 09:49:13 joergr 00240 ** Renamed some parameters/variables to avoid ambiguities. 00241 ** 00242 ** Revision 1.17 2002/04/30 13:12:12 joergr 00243 ** Added static helper function to convert strings (tag names or group/element 00244 ** numbers) to DICOM tag objects. 00245 ** 00246 ** Revision 1.16 2001/11/19 15:23:10 meichel 00247 ** Cleaned up signature code to avoid some gcc warnings. 00248 ** 00249 ** Revision 1.15 2001/11/16 15:54:40 meichel 00250 ** Adapted digital signature code to final text of supplement 41. 00251 ** 00252 ** Revision 1.14 2001/09/25 17:19:29 meichel 00253 ** Adapted dcmdata to class OFCondition 00254 ** 00255 ** Revision 1.13 2001/06/01 15:48:45 meichel 00256 ** Updated copyright header 00257 ** 00258 ** Revision 1.12 2000/04/14 16:00:58 meichel 00259 ** Restructured class DcmTag. Instances don't keep a permanent pointer 00260 ** to a data dictionary entry anymore. Required for MT applications. 00261 ** 00262 ** Revision 1.11 2000/03/08 16:26:19 meichel 00263 ** Updated copyright header. 00264 ** 00265 ** Revision 1.10 1999/03/31 09:24:49 meichel 00266 ** Updated copyright header in module dcmdata 00267 ** 00268 ** Revision 1.9 1998/07/15 15:48:54 joergr 00269 ** Removed several compiler warnings reported by gcc 2.8.1 with 00270 ** additional options, e.g. missing copy constructors and assignment 00271 ** operators, initialization of member variables in the body of a 00272 ** constructor instead of the member initialization list, hiding of 00273 ** methods by use of identical names, uninitialized member variables, 00274 ** missing const declaration of char pointers. Replaced tabs by spaces. 00275 ** 00276 ** Revision 1.8 1997/05/06 09:26:44 hewett 00277 ** The DcmTag::getVMMax() method now returns a maximum value if the attribute 00278 ** is unknown. This makes the default VM=1-n (before it was VM=1). 00279 ** 00280 ** Revision 1.7 1997/03/26 17:18:01 hewett 00281 ** Added member function to obtain a DcmTag's data dictionary reference. 00282 ** 00283 ** Revision 1.6 1996/04/19 08:37:21 andreas 00284 ** correct bug with DEBUG and not DEBUG parts. It was not possible to compile 00285 ** the dcmdata library with DEBUG and programs using dcmdata without DEBUG 00286 ** (and vice versa) 00287 ** 00288 ** Revision 1.5 1996/03/13 14:48:32 hewett 00289 ** Added useful VR access methods. 00290 ** 00291 ** Revision 1.4 1996/03/12 15:32:49 hewett 00292 ** Added constructor with parameter to explicity set the VR. 00293 ** 00294 ** Revision 1.3 1996/01/05 13:23:01 andreas 00295 ** - changed to support new streaming facilities 00296 ** - more cleanups 00297 ** - merged read / write methods for block and file transfer 00298 ** 00299 ** Revision 1.2 1995/11/23 16:38:03 hewett 00300 ** Updated for loadable data dictionary + some cleanup (more to do). 00301 ** 00302 */